summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-displayName-02.js
blob: 3e5cfe3df959e449dee2844d3de7b8b3b8f59b12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var g = newGlobal({newCompartment: true});
var dbg = new Debugger;
var gDO = dbg.addDebuggee(g);

function check(expr, expected) {
  let completion = gDO.executeInGlobal(expr);
  assertEq(!completion.throw, true);

  let func = completion.return;
  assertEq(func.displayName, expected);
}

check("(function foo(){})", "foo");
check("Map.prototype.set", "set");
check("Object.getOwnPropertyDescriptor(Map.prototype, 'size').get", "get size");
check("Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get", "get flags");