summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-name-04.js
blob: 5e5198d19e42099d8019e7f29f20fc6b8d5c149c (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.name, 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");