js/src/jit-test/tests/debug/Object-name-02.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/Object-name-02.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,16 @@
     1.4 +// The .name of a non-function object is undefined.
     1.5 +
     1.6 +var g = newGlobal();
     1.7 +var hits = 0;
     1.8 +var dbg = new Debugger(g);
     1.9 +dbg.onDebuggerStatement = function (frame) {
    1.10 +    assertEq(frame.arguments[0].name, undefined);
    1.11 +    hits++;
    1.12 +};
    1.13 +g.eval("function f(nonfunction) { debugger; }");
    1.14 +
    1.15 +g.eval("f({});");
    1.16 +g.eval("f(/a*/);");
    1.17 +g.eval("f({name: 'bad'});");
    1.18 +g.eval("f(Proxy.createFunction({name: {value: 'bad'}}, function () {}));");
    1.19 +assertEq(hits, 4);

mercurial