summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_5
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-03-18 19:59:51 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-03-18 20:00:50 +0100
commitb2af10d6cf38b23fd0697b1835943df32301c785 (patch)
treee0e3d292f97727050af4bfa6a4cd82e5fb83ce65 /js/src/tests/ecma_5
parentb2331d76221b67bffb5cb5a2344c8b150a305dc7 (diff)
parent726d2c3093d1a386edbff106070456cf866c0a6a (diff)
downloadUXP-b2af10d6cf38b23fd0697b1835943df32301c785.tar
UXP-b2af10d6cf38b23fd0697b1835943df32301c785.tar.gz
UXP-b2af10d6cf38b23fd0697b1835943df32301c785.tar.lz
UXP-b2af10d6cf38b23fd0697b1835943df32301c785.tar.xz
UXP-b2af10d6cf38b23fd0697b1835943df32301c785.zip
Remove strict arguments poison pill for "caller" property per ES2017
This resolves #79. Merged remote-tracking branch 'janek/js_strict_arguments_caller_removed_1'
Diffstat (limited to 'js/src/tests/ecma_5')
-rw-r--r--js/src/tests/ecma_5/Function/arguments-caller-callee.js12
-rw-r--r--js/src/tests/ecma_5/Function/arguments-property-attributes.js8
2 files changed, 7 insertions, 13 deletions
diff --git a/js/src/tests/ecma_5/Function/arguments-caller-callee.js b/js/src/tests/ecma_5/Function/arguments-caller-callee.js
index 3eda27b49..57efd9eb9 100644
--- a/js/src/tests/ecma_5/Function/arguments-caller-callee.js
+++ b/js/src/tests/ecma_5/Function/arguments-caller-callee.js
@@ -5,7 +5,8 @@
var gTestfile = 'arguments-caller-callee.js';
var BUGNUMBER = 514563;
-var summary = "arguments.caller and arguments.callee are poison pills in ES5";
+var summary = "arguments.caller and arguments.callee are poison pills in ES5, " +
+ "later changed in ES2017 to only poison pill arguments.callee.";
print(BUGNUMBER + ": " + summary);
@@ -31,7 +32,7 @@ function expectTypeError(fun)
}
function bar() { "use strict"; return arguments; }
-expectTypeError(function barCaller() { bar().caller; });
+assertEq(bar().caller, undefined); // No error when accessing arguments.caller in ES2017+
expectTypeError(function barCallee() { bar().callee; });
function baz() { return arguments; }
@@ -41,15 +42,12 @@ assertEq(baz().callee, baz);
// accessor identity
function strictMode() { "use strict"; return arguments; }
-var canonicalTTE = Object.getOwnPropertyDescriptor(strictMode(), "caller").get;
+var canonicalTTE = Object.getOwnPropertyDescriptor(strictMode(), "callee").get;
var args = strictMode();
var argsCaller = Object.getOwnPropertyDescriptor(args, "caller");
-assertEq("get" in argsCaller, true);
-assertEq("set" in argsCaller, true);
-assertEq(argsCaller.get, canonicalTTE);
-assertEq(argsCaller.set, canonicalTTE);
+assertEq(argsCaller, undefined);
var argsCallee = Object.getOwnPropertyDescriptor(args, "callee");
assertEq("get" in argsCallee, true);
diff --git a/js/src/tests/ecma_5/Function/arguments-property-attributes.js b/js/src/tests/ecma_5/Function/arguments-property-attributes.js
index 994b97ca4..f50c1e6da 100644
--- a/js/src/tests/ecma_5/Function/arguments-property-attributes.js
+++ b/js/src/tests/ecma_5/Function/arguments-property-attributes.js
@@ -56,7 +56,7 @@ var sa = strictArgs(0, 1);
var strictArgProps = Object.getOwnPropertyNames(sa).sort();
assertEq(strictArgProps.indexOf("callee") >= 0, true);
-assertEq(strictArgProps.indexOf("caller") >= 0, true);
+assertEq(strictArgProps.indexOf("caller") >= 0, false);
assertEq(strictArgProps.indexOf("0") >= 0, true);
assertEq(strictArgProps.indexOf("1") >= 0, true);
assertEq(strictArgProps.indexOf("length") >= 0, true);
@@ -69,11 +69,7 @@ assertEq(strictCalleeDesc.enumerable, false);
assertEq(strictCalleeDesc.configurable, false);
var strictCallerDesc = Object.getOwnPropertyDescriptor(sa, "caller");
-assertEq(typeof strictCallerDesc.get, "function");
-assertEq(typeof strictCallerDesc.set, "function");
-assertEq(strictCallerDesc.get, strictCallerDesc.set);
-assertEq(strictCallerDesc.enumerable, false);
-assertEq(strictCallerDesc.configurable, false);
+assertEq(strictCallerDesc, undefined);
var strictZeroDesc = Object.getOwnPropertyDescriptor(sa, "0");
assertEq(strictZeroDesc.value, 0);