diff --git a/lib/Runtime/Language/JavascriptOperators.cpp b/lib/Runtime/Language/JavascriptOperators.cpp index 5cde27228f0..cf23a2ee9d6 100644 --- a/lib/Runtime/Language/JavascriptOperators.cpp +++ b/lib/Runtime/Language/JavascriptOperators.cpp @@ -6983,8 +6983,6 @@ namespace Js if (funcCallee->IsStrictMode()) { JavascriptFunction* restrictedPropertyAccessor = library->GetThrowTypeErrorRestrictedPropertyAccessorFunction(); - argsObj->SetAccessors(PropertyIds::caller, restrictedPropertyAccessor, restrictedPropertyAccessor, PropertyOperation_NonFixedValue); - argsObj->SetAccessors(PropertyIds::callee, restrictedPropertyAccessor, restrictedPropertyAccessor, PropertyOperation_NonFixedValue); } diff --git a/lib/Runtime/Types/DictionaryTypeHandler.cpp b/lib/Runtime/Types/DictionaryTypeHandler.cpp index ac9a5588918..557ca0e725c 100644 --- a/lib/Runtime/Types/DictionaryTypeHandler.cpp +++ b/lib/Runtime/Types/DictionaryTypeHandler.cpp @@ -17,7 +17,6 @@ namespace Js { DictionaryTypeHandlerBase * dictTypeHandler = New(recycler, 8, 0, 0); - dictTypeHandler->Add(scriptContext->GetPropertyName(Js::PropertyIds::caller), PropertyWritable, scriptContext); dictTypeHandler->Add(scriptContext->GetPropertyName(Js::PropertyIds::callee), PropertyWritable, scriptContext); dictTypeHandler->Add(scriptContext->GetPropertyName(Js::PropertyIds::length), PropertyBuiltInMethodDefaults, scriptContext); dictTypeHandler->Add(scriptContext->GetPropertyName(Js::PropertyIds::_symbolIterator), PropertyBuiltInMethodDefaults, scriptContext); diff --git a/test/DebuggerCommon/ES6_letconst_eval_strict_fn.js.dbg.baseline b/test/DebuggerCommon/ES6_letconst_eval_strict_fn.js.dbg.baseline index 026283c7bc5..f8cb8b07256 100644 --- a/test/DebuggerCommon/ES6_letconst_eval_strict_fn.js.dbg.baseline +++ b/test/DebuggerCommon/ES6_letconst_eval_strict_fn.js.dbg.baseline @@ -6,7 +6,6 @@ "locals": { "arguments": { "#__proto__": "Object {...}", - "caller": "Error ", "callee": "Error ", "length": "number 0", "Symbol.iterator": "function " @@ -22,4 +21,4 @@ "a": "number 1" } } -] \ No newline at end of file +] diff --git a/test/es6/classes.js b/test/es6/classes.js index 0c7d07f2531..a583ab58160 100644 --- a/test/es6/classes.js +++ b/test/es6/classes.js @@ -948,7 +948,7 @@ var tests = [ { name: "Extends expression of a class declaration or expression is strict mode", body: function() { - var BadClass = class extends function() { arguments.caller; } {}; + var BadClass = class extends function() { arguments.callee; } {}; assert.throws(function() { Object.getPrototypeOf(BadClass).arguments; }, TypeError, "The extends expression of a class expression should be parsed in strict mode", "'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context"); assert.throws(function() { new BadClass(); }, TypeError, "New'ing a class with a parent constructor that throws in strict mode, should throw", "'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context"); diff --git a/test/strict/05.arguments_sm.baseline b/test/strict/05.arguments_sm.baseline index 6ad3e8ae71b..2c1d0e4dba6 100644 --- a/test/strict/05.arguments_sm.baseline +++ b/test/strict/05.arguments_sm.baseline @@ -8,17 +8,6 @@ arguments.callee:setter : function() { [native code] } arguments.callee:value : undefined -arguments.caller:configurable : false -arguments.caller:enumerable : false -arguments.caller:writable : undefined -arguments.caller:getter : function() { - [native code] -} -arguments.caller:setter : function() { - [native code] -} -arguments.caller:value : undefined -Exception: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context -Exception: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context +arguments.caller :propDesc undefined Exception: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context Exception: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context diff --git a/test/strict/19.function_sm.baseline b/test/strict/19.function_sm.baseline index 4ac76228683..748fa8101ba 100644 --- a/test/strict/19.function_sm.baseline +++ b/test/strict/19.function_sm.baseline @@ -3,5 +3,5 @@ Exception: function.caller set TypeError Exception: function.arguments get TypeError Exception: function.arguments set TypeError Return: true true: function.arguments and function.caller descriptors are undefined -Return: true true: arguments.caller and arguments.callee are equal/strictEqual to each other +Return: true true: arguments.caller is not defined and arguments.callee getter and setter are equal/strictEqual to each other Exception: function.caller's value is a strict mode function TypeError diff --git a/test/strict/19.function_sm.js b/test/strict/19.function_sm.js index 3d50c95c3fb..5bd92923c04 100644 --- a/test/strict/19.function_sm.js +++ b/test/strict/19.function_sm.js @@ -90,19 +90,16 @@ function exceptToString(ee) { (function Test5() { "use strict"; - var str = "arguments.caller and arguments.callee are equal/strictEqual to each other"; + var str = "arguments.caller is not defined and arguments.callee getter and setter are equal/strictEqual to each other"; // Properties on the arguments object. - var argumentsCallerGet = Object.getOwnPropertyDescriptor(arguments, 'caller').get; - var argumentsCallerSet = Object.getOwnPropertyDescriptor(arguments, 'caller').set; + var argumentsCallerDescriptor = Object.getOwnPropertyDescriptor(arguments, 'caller'); var argumentsCalleeGet = Object.getOwnPropertyDescriptor(arguments, 'callee').get; var argumentsCalleeSet = Object.getOwnPropertyDescriptor(arguments, 'callee').set; write("Return: " + - (argumentsCallerGet == argumentsCalleeGet && argumentsCallerSet == argumentsCalleeSet && - argumentsCallerGet == argumentsCallerSet).toString() + " " + - (argumentsCallerGet === argumentsCalleeGet && argumentsCallerSet === argumentsCalleeSet && - argumentsCallerGet === argumentsCallerSet).toString() + ": " + + (argumentsCallerDescriptor === undefined).toString() + " " + + (argumentsCalleeGet === argumentsCalleeSet).toString() + ": " + str); })(); diff --git a/test/strict/22.callerCalleeArguments_sm.baseline b/test/strict/22.callerCalleeArguments_sm.baseline index b780af7d19d..7f94f8e5bb5 100644 --- a/test/strict/22.callerCalleeArguments_sm.baseline +++ b/test/strict/22.callerCalleeArguments_sm.baseline @@ -1,5 +1,5 @@ (function(){"use strict";echo("hasOwnProperty(caller): ", arguments.hasOwnProperty("caller"));})(); -hasOwnProperty(caller): true +hasOwnProperty(caller): false var foo = function(){"use strict";};(function(){echo("hasOwnProperty(caller): ", foo.hasOwnProperty("caller"));})(); hasOwnProperty(caller): false @@ -17,7 +17,6 @@ var foo = function(){"use strict";};(function(){"use strict";echo("hasOwnPropert hasOwnProperty(arguments): false (function(){"use strict";arguments.caller;})(); -TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context var foo = function(){"use strict";};(function(){foo.caller;})(); TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context @@ -35,7 +34,6 @@ var foo = function(){"use strict";};(function(){"use strict";foo.arguments;})(); TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (function(){"use strict";arguments.caller = 0;})(); -TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context var foo = function(){"use strict";};(function(){foo.caller = 0;})(); TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context @@ -53,7 +51,6 @@ var foo = function(){"use strict";};(function(){"use strict";foo.arguments = 0;} TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context (function(){"use strict";Object.defineProperty(arguments, "caller", {value: 0});})(); -TypeError: Cannot redefine non-configurable property 'caller' var foo = function(){"use strict";};(function(){Object.defineProperty(foo, "caller", {value: 0});})(); @@ -67,8 +64,7 @@ var foo = function(){"use strict";};(function(){Object.defineProperty(foo, "argu var foo = function(){"use strict";};(function(){"use strict";Object.defineProperty(foo, "arguments", {value: 0});})(); (function(){"use strict";var descriptor = Object.getOwnPropertyDescriptor(arguments, "caller");if(descriptor.hasOwnProperty("get")) safeCall(descriptor.get);if(descriptor.hasOwnProperty("set")) safeCall(descriptor.set);})(); -TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context -TypeError: 'arguments', 'callee' and 'caller' are restricted function properties and cannot be accessed in this context +TypeError: Unable to get property 'hasOwnProperty' of undefined or null reference var foo = function(){"use strict";};(function(){var descriptor = Object.getOwnPropertyDescriptor(foo, "caller");if(descriptor.hasOwnProperty("get")) safeCall(descriptor.get);if(descriptor.hasOwnProperty("set")) safeCall(descriptor.set);})(); TypeError: Unable to get property 'hasOwnProperty' of undefined or null reference