summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/environments
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /js/src/jit-test/tests/environments
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/jit-test/tests/environments')
-rw-r--r--js/src/jit-test/tests/environments/bug1671563-strict.js25
-rw-r--r--js/src/jit-test/tests/environments/bug1671563.js24
-rw-r--r--js/src/jit-test/tests/environments/bug1671762.js20
3 files changed, 69 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/environments/bug1671563-strict.js b/js/src/jit-test/tests/environments/bug1671563-strict.js
new file mode 100644
index 0000000000..5b9e8112ee
--- /dev/null
+++ b/js/src/jit-test/tests/environments/bug1671563-strict.js
@@ -0,0 +1,25 @@
+// A `var` is `undefined` on entering a function body in strict mode too.
+
+"use strict";
+
+load(libdir + "asserts.js");
+
+function f(a = class C{}) {
+ var x;
+ return x;
+}
+assertEq(f(), undefined);
+
+function* g1(a = class C {}) {
+ var x;
+ assertEq(x, undefined);
+}
+g1().next();
+
+function* g2(a = class C {}) {
+ x;
+ let x;
+}
+assertThrowsInstanceOf(() => g2().next(), ReferenceError);
+
+
diff --git a/js/src/jit-test/tests/environments/bug1671563.js b/js/src/jit-test/tests/environments/bug1671563.js
new file mode 100644
index 0000000000..29a24fbcd9
--- /dev/null
+++ b/js/src/jit-test/tests/environments/bug1671563.js
@@ -0,0 +1,24 @@
+// The value of a `var` on entering a function is `undefined`, even if a
+// default expression uses the same stack slot for something else.
+
+load(libdir + "asserts.js");
+
+function f(a = class C{}) {
+ var x;
+ return x;
+}
+assertEq(f(), undefined);
+
+function* g1(a = class C {}) {
+ var x;
+ assertEq(x, undefined);
+}
+g1().next();
+
+function* g2(a = class C {}) {
+ x;
+ let x;
+}
+assertThrowsInstanceOf(() => g2().next(), ReferenceError);
+
+
diff --git a/js/src/jit-test/tests/environments/bug1671762.js b/js/src/jit-test/tests/environments/bug1671762.js
new file mode 100644
index 0000000000..3d7a452474
--- /dev/null
+++ b/js/src/jit-test/tests/environments/bug1671762.js
@@ -0,0 +1,20 @@
+(function() {
+ var v00, v01, v02, v03, v04, v05, v06, v07, v08, v09, v0a, v0b, v0c, v0d, v0e, v0f;
+ var v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v1a, v1b, v1c, v1d, v1e, v1f;
+ var v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v2a, v2b, v2c, v2d, v2e, v2f;
+ var v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v3a, v3b, v3c, v3d, v3e, v3f;
+ var v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v4a, v4b, v4c, v4d, v4e, v4f;
+ var v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v5a, v5b, v5c, v5d, v5e, v5f;
+ var v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v6a, v6b, v6c, v6d, v6e, v6f;
+ var v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v7a, v7b, v7c, v7d, v7e, v7f;
+ try { a1; } catch {} finally {}
+ var v80, v81, v82, v83, v84, v85, v86, v87, v88, v89, v8a, v8b, v8c, v8d, v8e, v8f;
+ var v90, v91, v92, v93, v94, v95, v96, v97, v98, v99, v9a, v9b, v9c, v9d, v9e, v9f;
+ var va0, va1, va2, va3, va4, va5, va6, va7, va8, va9, vaa, vab, vac, vad, vae, vaf;
+ var vb0, vb1, vb2, vb3, vb4, vb5, vb6, vb7, vb8, vb9, vba, vbb, vbc, vbd, vbe, vbf;
+ var vc0, vc1, vc2, vc3, vc4, vc5, vc6, vc7, vc8, vc9, vca, vcb, vcc, vcd, vce, vcf;
+ var vd0, vd1, vd2, vd3, vd4, vd5, vd6, vd7, vd8, vd9, vda, vdb, vdc, vdd, vde, vdf;
+ var ve0, ve1, ve2, ve3, ve4, ve5, ve6, ve7, ve8, ve9, vea, veb, vec, ved, vee, vef;
+ var vf0, vf1, vf2, vf3, vf4, vf5, vf6, vf7, vf8, vf9, vfa, vfb, vfc, vfd, vfe, vff;
+ var v100;
+})();