Bug 884516 - Rename JS shell global 'arguments' variable to scriptArgs. r=luke.

This commit is contained in:
Jason Orendorff 2013-06-19 14:43:38 -05:00
parent 8f4e38414e
commit 63d93f66cc
2 changed files with 3 additions and 8 deletions

View File

@ -1,4 +1,5 @@
arguments = [];
try {
arguments.toSource = (function() {
__proto__.y = x

View File

@ -4888,13 +4888,7 @@ BindScriptArgs(JSContext *cx, JSObject *obj_, OptionParser *op)
if (!scriptArgs)
return false;
/*
* Script arguments are bound as a normal |arguments| property on the
* global object. It has no special significance, like |arguments| in
* function scope does -- this identifier is used de-facto across shell
* implementations, see bug 675269.
*/
if (!JS_DefineProperty(cx, obj, "arguments", OBJECT_TO_JSVAL(scriptArgs), NULL, NULL, 0))
if (!JS_DefineProperty(cx, obj, "scriptArgs", OBJECT_TO_JSVAL(scriptArgs), NULL, NULL, 0))
return false;
for (size_t i = 0; !msr.empty(); msr.popFront(), ++i) {
@ -5259,7 +5253,7 @@ main(int argc, char **argv, char **envp)
#endif
|| !op.addOptionalStringArg("script", "A script to execute (after all options)")
|| !op.addOptionalMultiStringArg("scriptArgs",
"String arguments to bind as |arguments| in the "
"String arguments to bind as |scriptArgs| in the "
"shell's global")
#ifdef JS_THREADSAFE
|| !op.addIntOption('\0', "thread-count", "COUNT", "Use COUNT auxiliary threads "