summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Object-name-04.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/debug/Object-name-04.js')
-rw-r--r--js/src/jit-test/tests/debug/Object-name-04.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/Object-name-04.js b/js/src/jit-test/tests/debug/Object-name-04.js
new file mode 100644
index 0000000000..5e5198d19e
--- /dev/null
+++ b/js/src/jit-test/tests/debug/Object-name-04.js
@@ -0,0 +1,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");