class-derived-default-constructor-3.js (701B)
1 const g = newGlobal({newCompartment: true}); 2 g.eval(` 3 class Base {} 4 class Derived extends Base {} 5 this.Derived = Derived; 6 `); 7 8 const dbg = new Debugger(g); 9 const gw = dbg.addDebuggee(g); 10 11 let calleeCount = 0; 12 13 dbg.onEnterFrame = frame => { 14 // Ignore any other callees. 15 if (frame.callee !== gw.makeDebuggeeValue(g.Derived)) { 16 return; 17 } 18 19 calleeCount++; 20 21 // The implicit rest-argument has the non-identifier name ".args", therefore 22 // we have to elide from the parameter names array. 23 assertEq(frame.callee.parameterNames.length, 1); 24 assertEq(frame.callee.parameterNames[0], undefined); 25 }; 26 27 new g.Derived(); 28 29 // |Derived| should be called at most once. 30 assertEq(calleeCount, 1);