diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/src/tests/ecma_5/extensions/builtin-function-arguments-caller.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/src/tests/ecma_5/extensions/builtin-function-arguments-caller.js')
-rw-r--r-- | js/src/tests/ecma_5/extensions/builtin-function-arguments-caller.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/js/src/tests/ecma_5/extensions/builtin-function-arguments-caller.js b/js/src/tests/ecma_5/extensions/builtin-function-arguments-caller.js new file mode 100644 index 000000000..2acf5f452 --- /dev/null +++ b/js/src/tests/ecma_5/extensions/builtin-function-arguments-caller.js @@ -0,0 +1,60 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +var gTestfile = 'builtin-function-arguments-caller.js'; +var BUGNUMBER = 929642; +var summary = + "Built-in functions defined in ECMAScript pick up arguments/caller " + + "properties from Function.prototype"; + +print(BUGNUMBER + ": " + summary); + +/************** + * BEGIN TEST * + **************/ + +function expectNoProperty(obj, prop) +{ + var desc = Object.getOwnPropertyDescriptor(obj, prop); + assertEq(desc, undefined, + "should be no '" + prop + "' property on " + obj); +} + +// Test a builtin that's native. +expectNoProperty(Object, "arguments"); +expectNoProperty(Object, "caller"); + +// Also test a builtin that's self-hosted. +expectNoProperty(Array.prototype.indexOf, "arguments"); +expectNoProperty(Array.prototype.indexOf, "caller"); + +// Test the Function construct for good measure, because it's so intricately +// invovled in bootstrapping. +expectNoProperty(Function, "arguments"); +expectNoProperty(Function, "caller"); + +var argsDesc = Object.getOwnPropertyDescriptor(Function.prototype, "arguments"); +var callerDesc = Object.getOwnPropertyDescriptor(Function.prototype, "caller"); + +var argsGet = argsDesc.get, argsSet = argsDesc.set; + +expectNoProperty(argsGet, "arguments"); +expectNoProperty(argsGet, "caller"); +expectNoProperty(argsSet, "arguments"); +expectNoProperty(argsSet, "caller"); + +var callerGet = callerDesc.get, callerSet = callerDesc.set; + +expectNoProperty(callerGet, "arguments"); +expectNoProperty(callerGet, "caller"); +expectNoProperty(callerSet, "arguments"); +expectNoProperty(callerSet, "caller"); + +/******************************************************************************/ + +if (typeof reportCompare === "function") + reportCompare(true, true); + +print("Tests complete"); |