blob: 0a1fca49943c5a602e3355d95830376dfd054501 [file] [log] [blame]
Test caller and arguments properties in function in non strict mode
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS Object.getOwnPropertyNames(function () {}).length is 5
PASS Object.getOwnPropertyNames(function () {}).includes("caller") is true
PASS Object.getOwnPropertyNames(function () {}).includes("arguments") is true
PASS (function(){}).hasOwnProperty("caller") is true
PASS (function(){}).__proto__.hasOwnProperty("caller") is true
PASS (function(){}).hasOwnProperty("arguments") is true
PASS (function(){}).__proto__.hasOwnProperty("arguments") is true
PASS typeof Object.getOwnPropertyDescriptor(foo, "arguments") is "object"
PASS typeof Object.getOwnPropertyDescriptor(foo, "caller") is "object"
PASS foo.caller is null
PASS foo.arguments is null
PASS foo.caller is null
PASS foo.arguments is null
PASS boo("abc")[0] is "abc"
PASS boo("expected-value")[0] is "expected-value"
PASS g(f) is g
PASS doSetCaller(value, false) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context..
PASS doSetCaller(value, true).__proto__.caller is value
PASS doSetArguments(value, false) threw exception TypeError: 'arguments', 'callee', and 'caller' cannot be accessed in this context..
PASS doSetArguments(value, true).__proto__.arguments is value
PASS successfullyParsed is true
TEST COMPLETE