/js/src/jit-test/tests/debug/Object-name-02.js
http://github.com/zpao/v8monkey · JavaScript · 16 lines · 13 code · 2 blank · 1 comment · 0 complexity · bcca5e537449299adeea48a487606a48 MD5 · raw file
- // The .name of a non-function object is undefined.
- var g = newGlobal('new-compartment');
- var hits = 0;
- var dbg = new Debugger(g);
- dbg.onDebuggerStatement = function (frame) {
- assertEq(frame.arguments[0].name, undefined);
- hits++;
- };
- g.eval("function f(nonfunction) { debugger; }");
- g.eval("f({});");
- g.eval("f(/a*/);");
- g.eval("f({name: 'bad'});");
- g.eval("f(Proxy.createFunction({name: {value: 'bad'}}, function () {}));");
- assertEq(hits, 4);