PageRenderTime 12ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/debug/Frame-evalWithBindings-03.js

http://github.com/zpao/v8monkey
JavaScript | 16 lines | 15 code | 0 blank | 1 comment | 1 complexity | 354cb26518d7fd21888831bad32c2d93 MD5 | raw file
 1// arguments works in evalWithBindings (it does not interpose a function scope)
 2var g = newGlobal('new-compartment');
 3var dbg = new Debugger;
 4var global = dbg.addDebuggee(g);
 5var hits = 0;
 6dbg.onDebuggerStatement = function (frame) {
 7    var argc = frame.arguments.length;
 8    assertEq(argc, 7);
 9    assertEq(frame.evalWithBindings("arguments[prop]", {prop: "length"}).return, argc);
10    for (var i = 0; i < argc; i++)
11        assertEq(frame.evalWithBindings("arguments[i]", {i: i}).return, frame.arguments[i]);
12    hits++;
13};
14g.eval("function f() { debugger; }");
15g.eval("f(undefined, -0, NaN, '\uffff', Array.prototype, Math, f);");
16assertEq(hits, 1);