Here is my case:
function x(a) {
console.log(a + '=' + arguments[1]);
}
x('arg0', 'arg1');
In Firefox 4 and not so long ago in Chrome, this was the content of 'arguments':
arguments[0]开发者_运维百科 = 'arg0';
arguments[1] = 'arg1';
In Chrome, now only the named arguments are in the arguments
array. So it's only 1 long, instead of 2.
So my questions:
- When and how did this change?
- How can I make this work again?
function x(a) {
console.log(a + '=' + arguments[1]);
}
x('arg0', 'arg1');
Result:
arg0=arg1
It works just fine on Chrome, you just have to name the function, otherwise it's not callable.
精彩评论