mirror of https://github.com/tc39/test262.git
Remove tests for arguments.caller (#797)
This commit is contained in:
parent
13954ed1c4
commit
c779cba592
|
@ -19,9 +19,6 @@ function nonSimple(a = 0) {
|
|||
return arguments;
|
||||
}
|
||||
var unmappedCalleeDesc = Object.getOwnPropertyDescriptor(nonSimple(), "callee");
|
||||
var unmappedCallerDesc = Object.getOwnPropertyDescriptor(nonSimple(), "caller");
|
||||
|
||||
assert.sameValue(ThrowTypeError, unmappedCalleeDesc.get, "callee.get");
|
||||
assert.sameValue(ThrowTypeError, unmappedCalleeDesc.set, "callee.set");
|
||||
assert.sameValue(ThrowTypeError, unmappedCallerDesc.get, "caller.get");
|
||||
assert.sameValue(ThrowTypeError, unmappedCallerDesc.set, "caller.set");
|
||||
|
|
|
@ -20,9 +20,6 @@ function strictFn() {
|
|||
return arguments;
|
||||
}
|
||||
var unmappedCalleeDesc = Object.getOwnPropertyDescriptor(strictFn(), "callee");
|
||||
var unmappedCallerDesc = Object.getOwnPropertyDescriptor(strictFn(), "caller");
|
||||
|
||||
assert.sameValue(ThrowTypeError, unmappedCalleeDesc.get, "callee.get");
|
||||
assert.sameValue(ThrowTypeError, unmappedCalleeDesc.set, "callee.set");
|
||||
assert.sameValue(ThrowTypeError, unmappedCallerDesc.get, "caller.get");
|
||||
assert.sameValue(ThrowTypeError, unmappedCallerDesc.set, "caller.set");
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 10.6-13-1
|
||||
description: Accessing caller property of Arguments object is allowed
|
||||
flags: [noStrict]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
arguments.caller;
|
||||
}
|
||||
testcase();
|
|
@ -1,15 +0,0 @@
|
|||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 10.6-13-b-1-s
|
||||
description: >
|
||||
Accessing caller property of Arguments object throws TypeError in
|
||||
strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
|
||||
assert.throws(TypeError, function() {
|
||||
arguments.caller;
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 10.6-13-b-2-s
|
||||
description: arguments.caller exists in strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
||||
assert.notSameValue(desc, undefined);
|
||||
}
|
||||
testcase();
|
|
@ -1,20 +0,0 @@
|
|||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 10.6-13-b-3-s
|
||||
description: arguments.caller is non-configurable in strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
function testcase() {
|
||||
var desc = Object.getOwnPropertyDescriptor(arguments,"caller");
|
||||
|
||||
assert.sameValue(desc.configurable, false, 'desc.configurable');
|
||||
assert.sameValue(desc.enumerable, false, 'desc.enumerable');
|
||||
assert.sameValue(desc.hasOwnProperty('value'), false, 'desc.hasOwnProperty("value")');
|
||||
assert.sameValue(desc.hasOwnProperty('writable'), false, 'desc.hasOwnProperty("writable")');
|
||||
assert.sameValue(desc.hasOwnProperty('get'), true, 'desc.hasOwnProperty("get")');
|
||||
assert.sameValue(desc.hasOwnProperty('set'), true, 'desc.hasOwnProperty("set")');
|
||||
}
|
||||
testcase();
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
/*---
|
||||
es5id: 10.6-14-1-s
|
||||
description: Strict Mode - 'callee' exists and 'caller' exists under strict mode
|
||||
description: Strict Mode - 'callee' exists under strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
|
@ -12,4 +12,3 @@ flags: [onlyStrict]
|
|||
} ();
|
||||
|
||||
assert(argObj.hasOwnProperty("callee"), 'argObj.hasOwnProperty("callee") !== true');
|
||||
assert(argObj.hasOwnProperty("caller"), 'argObj.hasOwnProperty("caller") !== true');
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 10.6-14-b-1-s
|
||||
description: >
|
||||
Strict Mode - [[Enumerable]] attribute value in 'caller' is false
|
||||
under strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
var argObj = function () {
|
||||
return arguments;
|
||||
} ();
|
||||
|
||||
var verifyEnumerable = false;
|
||||
for (var _10_6_14_b_1 in argObj) {
|
||||
if (argObj.hasOwnProperty(_10_6_14_b_1) && _10_6_14_b_1 === "caller") {
|
||||
verifyEnumerable = true;
|
||||
}
|
||||
}
|
||||
|
||||
assert.sameValue(verifyEnumerable, false, 'verifyEnumerable');
|
||||
assert(argObj.hasOwnProperty("caller"), 'argObj.hasOwnProperty("caller") !== true');
|
|
@ -1,17 +0,0 @@
|
|||
// Copyright (c) 2012 Ecma International. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
es5id: 10.6-14-b-4-s
|
||||
description: >
|
||||
Strict Mode - TypeError is thrown when accessing the [[Set]]
|
||||
attribute in 'caller' under strict mode
|
||||
flags: [onlyStrict]
|
||||
---*/
|
||||
|
||||
var argObj = function () {
|
||||
return arguments;
|
||||
} ();
|
||||
assert.throws(TypeError, function() {
|
||||
argObj.caller = {};
|
||||
});
|
|
@ -0,0 +1,12 @@
|
|||
// Copyright (c) 2016 Kevin Gibbons. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-arguments-exotic-objects
|
||||
description: arguments.caller does not exist
|
||||
---*/
|
||||
|
||||
function getArguments() {
|
||||
return arguments;
|
||||
}
|
||||
assert.sameValue(Object.getOwnPropertyDescriptor(getArguments(), 'caller'), undefined, 'arguments.caller does not exist');
|
Loading…
Reference in New Issue