summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/fields/init-order.js
blob: 6679a65e7b9aed0b0ecdb41cddd50581c5c4b42d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function g1() {
    throw 10;
}

function g2() {
    throw 20;
}

class A {
    #x = "hello" + g1();
    constructor(o = g2()) {
    }
};

var thrown;
try {
    new A;
} catch (e) {
    thrown = e;
}

assertEq(thrown, 10);

if (typeof reportCompare === "function")
    reportCompare(true, true);