mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Fix Frame.arguments bug noticed by luke in bug 672829 comment 69.
This commit is contained in:
parent
f3fcd7625a
commit
02efc70ce2
23
js/src/jit-test/tests/debug/Frame-arguments-07.js
Normal file
23
js/src/jit-test/tests/debug/Frame-arguments-07.js
Normal file
@ -0,0 +1,23 @@
|
||||
// When argument[x] is assigned, where x > callee.length, frame.arguments reflects the change.
|
||||
|
||||
var g = newGlobal('new-compartment');
|
||||
g.eval("function f(a, b) {\n" +
|
||||
" for (var i = 0; i < arguments.length; i++)\n" +
|
||||
" arguments[i] = i;\n" +
|
||||
" debugger;\n" +
|
||||
"}\n");
|
||||
|
||||
var dbg = Debugger(g);
|
||||
var hits = 0;
|
||||
dbg.onDebuggerStatement = function (frame) {
|
||||
var argc = frame.eval("arguments.length").return;
|
||||
var args = frame.arguments;
|
||||
assertEq(args.length, argc);
|
||||
for (var i = 0; i < argc; i++)
|
||||
assertEq(args[i], i);
|
||||
hits++;
|
||||
}
|
||||
|
||||
g.f(9);
|
||||
g.f(9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9);
|
||||
assertEq(hits, 2);
|
@ -2506,7 +2506,7 @@ DebuggerArguments_getArg(JSContext *cx, uintN argc, Value *vp)
|
||||
*/
|
||||
JS_ASSERT(i >= 0);
|
||||
if (uintN(i) < fp->numActualArgs())
|
||||
*vp = fp->actualArgs()[i];
|
||||
*vp = fp->canonicalActualArg(i);
|
||||
else
|
||||
vp->setUndefined();
|
||||
return Debugger::fromChildJSObject(thisobj)->wrapDebuggeeValue(cx, vp);
|
||||
|
Loading…
Reference in New Issue
Block a user