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

/js/src/jit-test/tests/debug/Object-01.js

http://github.com/zpao/v8monkey
JavaScript | 17 lines | 14 code | 2 blank | 1 comment | 0 complexity | 4e25a7b16ffb2b211d9959c5ef7a5557 MD5 | raw file
 1// Debugger.Object basics
 2
 3var g = newGlobal('new-compartment');
 4var dbg = Debugger(g);
 5var hits = 0;
 6dbg.onDebuggerStatement = function (frame) {
 7    assertEq(frame.arguments[0], frame.callee);
 8    assertEq(Object.getPrototypeOf(frame.arguments[0]), Debugger.Object.prototype);
 9    assertEq(frame.arguments[0] instanceof Debugger.Object, true);
10    assertEq(frame.arguments[0] !== frame.arguments[1], true);
11    assertEq(Object.getPrototypeOf(frame.arguments[1]), Debugger.Object.prototype);
12    assertEq(frame.arguments[1] instanceof Debugger.Object, true);
13    hits++;
14};
15
16g.eval("var obj = {}; function f(a, b) { debugger; } f(f, obj);");
17assertEq(hits, 1);