summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/fields/init-order.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/fields/init-order.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/js/src/tests/non262/fields/init-order.js b/js/src/tests/non262/fields/init-order.js
new file mode 100644
index 0000000000..6679a65e7b
--- /dev/null
+++ b/js/src/tests/non262/fields/init-order.js
@@ -0,0 +1,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);