mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
Remove strict arguments poison pill for "caller" property per ES2017
This commit is contained in:
parent
04e171e0a4
commit
231685e644
4 changed files with 18 additions and 18 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -46,6 +46,16 @@ skip script test262/ch09/9.3/9.3.1/S9.3.1_A2.js
|
|||
skip script test262/ch09/9.3/9.3.1/S9.3.1_A3_T2.js
|
||||
skip script test262/ch09/9.3/9.3.1/S9.3.1_A3_T1.js
|
||||
|
||||
# ES2017 removed the strict arguments poison pill for the "caller" property
|
||||
# (bug 1324208).
|
||||
skip script test262/ch13/13.2/S13.2.3_A1.js
|
||||
skip script test262/ch10/10.6/10.6-14-1-s.js
|
||||
skip script test262/ch10/10.6/10.6-13-b-3-s.js
|
||||
skip script test262/ch10/10.6/10.6-14-b-1-s.js
|
||||
skip script test262/ch10/10.6/10.6-14-b-4-s.js
|
||||
skip script test262/ch10/10.6/10.6-13-b-1-s.js
|
||||
skip script test262/ch10/10.6/10.6-13-b-2-s.js
|
||||
|
||||
#######################################################################
|
||||
# Tests disabled due to jstest limitations wrt imported test262 tests #
|
||||
#######################################################################
|
||||
|
|
|
|||
|
|
@ -676,7 +676,7 @@ UnmappedArgumentsObject::obj_resolve(JSContext* cx, HandleObject obj, HandleId i
|
|||
if (argsobj->hasOverriddenLength())
|
||||
return true;
|
||||
} else {
|
||||
if (!JSID_IS_ATOM(id, cx->names().callee) && !JSID_IS_ATOM(id, cx->names().caller))
|
||||
if (!JSID_IS_ATOM(id, cx->names().callee))
|
||||
return true;
|
||||
|
||||
attrs = JSPROP_PERMANENT | JSPROP_GETTER | JSPROP_SETTER | JSPROP_SHARED;
|
||||
|
|
@ -709,10 +709,6 @@ UnmappedArgumentsObject::obj_enumerate(JSContext* cx, HandleObject obj)
|
|||
if (!HasProperty(cx, argsobj, id, &found))
|
||||
return false;
|
||||
|
||||
id = NameToId(cx->names().caller);
|
||||
if (!HasProperty(cx, argsobj, id, &found))
|
||||
return false;
|
||||
|
||||
id = SYMBOL_TO_JSID(cx->wellKnownSymbols().iterator);
|
||||
if (!HasProperty(cx, argsobj, id, &found))
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue