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

/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
 1// The .name of a non-function object is undefined.
 2
 3var g = newGlobal('new-compartment');
 4var hits = 0;
 5var dbg = new Debugger(g);
 6dbg.onDebuggerStatement = function (frame) {
 7    assertEq(frame.arguments[0].name, undefined);
 8    hits++;
 9};
10g.eval("function f(nonfunction) { debugger; }");
11
12g.eval("f({});");
13g.eval("f(/a*/);");
14g.eval("f({name: 'bad'});");
15g.eval("f(Proxy.createFunction({name: {value: 'bad'}}, function () {}));");
16assertEq(hits, 4);