summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/class/bug1720032-1.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/class/bug1720032-1.js')
-rw-r--r--js/src/jit-test/tests/class/bug1720032-1.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/class/bug1720032-1.js b/js/src/jit-test/tests/class/bug1720032-1.js
new file mode 100644
index 0000000000..c2ab722638
--- /dev/null
+++ b/js/src/jit-test/tests/class/bug1720032-1.js
@@ -0,0 +1,29 @@
+// |jit-test| skip-if: getBuildConfiguration()['osx'] && getBuildConfiguration()['arm64']
+load(libdir + "asserts.js");
+function main() {
+ class Base {}
+
+ class Derived extends Base {
+ constructor() {
+ super();
+
+ let v = 0xffff;
+
+ try {
+ // Ensure this statement doesn't get DCE'ed.
+ v &= 0xff;
+
+ // Returning a primitive value throws.
+ return 0;
+ } catch {}
+
+ assertEq(v, 255);
+ }
+ }
+
+ for (let i = 0; i < 15; i++) {
+ assertThrowsInstanceOf(() => new Derived(), TypeError);
+ }
+}
+main();
+main();