summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-name-02.js
blob: b9ae25ca882f7c3b61eb244d8c47e9bddf79b34f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// The .name of a non-function object is undefined.

var g = newGlobal({newCompartment: true});
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(new Proxy({}, {}));");
assertEq(hits, 4);