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