checkreturn-source-location.js (418B)
1 // Test source location for missing-super-call check at the end of a derived class constructor. 2 class A {}; 3 class B extends A { 4 constructor(x) { 5 if (x === null) { 6 throw "fail"; 7 } 8 } 9 }; 10 let ex; 11 try { 12 new B(); 13 } catch (e) { 14 ex = e; 15 } 16 assertEq(ex instanceof ReferenceError, true); 17 // The closing '}' of B's constructor. 18 assertEq(ex.lineNumber, 8); 19 assertEq(ex.columnNumber, 5);