Jacek Caban (@jacek) commented about dlls/jscript/tests/lang.js:
ok(get_a() === 2, "function(a, a, b, c) get_a() = " + get_a());
ok(a === 2, "function(a, a, b, c) a = " + a);
ok(b === 3, "function(a, a, b, c) b = " + b);
ok(c === 4, "function(a, a, b, c) c = " + c);
a = 42;
ok(arguments[0] === 1, "function(a, a, b, c) arguments[0] = " + arguments[0]);
ok(arguments[1] === 42, "function(a, a, b, c) arguments[1] = " + arguments[1]);
ok(get_a() === 42, "function(a, a, b, c) get_a() = " + get_a() + " expected 42");
args = arguments;
- })(1, 2, 3, 4);
- ok(get_a() === 42, "function(a, a, b, c) get_a() after detach = " + get_a());
- set_a(100);
- ok(get_a() === 100, "function(a, a, b, c) get_a() = " + get_a() + " expected 100");
- ok(args[0] === 1, "function(a, a, b, c) detached args[0] = " + args[0]);
- ok(args[1] === 42, "function(a, a, b, c) detached args[1] = " + args[1]);
This test does not work in MSHTML and, as expected, uses 100 here. This looks more like a bug in jscript.dll than anything intended, so maybe we could just implement the MSHTML behavior.
I was surprised that you still need a separated buffer in arguments object and it won't work for the proper implementation.