diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/debug/class-derived-default-constructor-3.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/debug/class-derived-default-constructor-3.js b/js/src/jit-test/tests/debug/class-derived-default-constructor-3.js new file mode 100644 index 0000000000..69a49b718d --- /dev/null +++ b/js/src/jit-test/tests/debug/class-derived-default-constructor-3.js @@ -0,0 +1,30 @@ +const g = newGlobal({newCompartment: true}); +g.eval(` + class Base {} + class Derived extends Base {} + this.Derived = Derived; +`); + +const dbg = new Debugger(g); +const gw = dbg.addDebuggee(g); + +let calleeCount = 0; + +dbg.onEnterFrame = frame => { + // Ignore any other callees. + if (frame.callee !== gw.makeDebuggeeValue(g.Derived)) { + return; + } + + calleeCount++; + + // The implicit rest-argument has the non-identifier name ".args", therefore + // we have to elide from the parameter names array. + assertEq(frame.callee.parameterNames.length, 1); + assertEq(frame.callee.parameterNames[0], undefined); +}; + +new g.Derived(); + +// |Derived| should be called at most once. +assertEq(calleeCount, 1); |