summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/modules
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/modules
parentInitial commit. (diff)
downloadfirefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz
firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.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/modules')
-rw-r--r--js/src/jit-test/modules/ambiguous.js2
-rw-r--r--js/src/jit-test/modules/cyclicImport1.js4
-rw-r--r--js/src/jit-test/modules/cyclicImport2.js4
-rw-r--r--js/src/jit-test/modules/defaultClass.js5
-rw-r--r--js/src/jit-test/modules/defaultFunction.js3
-rw-r--r--js/src/jit-test/modules/empty.js1
-rw-r--r--js/src/jit-test/modules/export-circular-nonexisting-binding-1.js4
-rw-r--r--js/src/jit-test/modules/export-circular-nonexisting-binding-2.js1
-rw-r--r--js/src/jit-test/modules/export-default-async-asi.js2
-rw-r--r--js/src/jit-test/modules/export-default-async-regexpy.js6
-rw-r--r--js/src/jit-test/modules/export-ns.js1
-rw-r--r--js/src/jit-test/modules/export-star-circular-1.js1
-rw-r--r--js/src/jit-test/modules/export-star-circular-2.js3
-rw-r--r--js/src/jit-test/modules/exportImportMeta.js3
-rw-r--r--js/src/jit-test/modules/isEven.js12
-rw-r--r--js/src/jit-test/modules/isOdd.js12
-rw-r--r--js/src/jit-test/modules/module1.js1
-rw-r--r--js/src/jit-test/modules/module1a.js1
-rw-r--r--js/src/jit-test/modules/module2.js1
-rw-r--r--js/src/jit-test/modules/module3.js1
-rw-r--r--js/src/jit-test/modules/module4.js1
-rw-r--r--js/src/jit-test/modules/recursiveStarExport.js1
22 files changed, 70 insertions, 0 deletions
diff --git a/js/src/jit-test/modules/ambiguous.js b/js/src/jit-test/modules/ambiguous.js
new file mode 100644
index 0000000000..3e0d31e3ed
--- /dev/null
+++ b/js/src/jit-test/modules/ambiguous.js
@@ -0,0 +1,2 @@
+export * from 'module1.js';
+export * from 'module1a.js';
diff --git a/js/src/jit-test/modules/cyclicImport1.js b/js/src/jit-test/modules/cyclicImport1.js
new file mode 100644
index 0000000000..d64803a005
--- /dev/null
+++ b/js/src/jit-test/modules/cyclicImport1.js
@@ -0,0 +1,4 @@
+import { b } from "cyclicImport2.js";
+
+export let a = 1;
+assertEq(b, 2);
diff --git a/js/src/jit-test/modules/cyclicImport2.js b/js/src/jit-test/modules/cyclicImport2.js
new file mode 100644
index 0000000000..e7c3cd924e
--- /dev/null
+++ b/js/src/jit-test/modules/cyclicImport2.js
@@ -0,0 +1,4 @@
+import { a } from "cyclicImport1.js";
+
+export let b = 2;
+assertEq(a, 1);
diff --git a/js/src/jit-test/modules/defaultClass.js b/js/src/jit-test/modules/defaultClass.js
new file mode 100644
index 0000000000..c05d5ff5a0
--- /dev/null
+++ b/js/src/jit-test/modules/defaultClass.js
@@ -0,0 +1,5 @@
+export default class {
+ triple(x) {
+ return x * 3;
+ }
+}
diff --git a/js/src/jit-test/modules/defaultFunction.js b/js/src/jit-test/modules/defaultFunction.js
new file mode 100644
index 0000000000..1c6e75d453
--- /dev/null
+++ b/js/src/jit-test/modules/defaultFunction.js
@@ -0,0 +1,3 @@
+export default function(x) {
+ return x * 2;
+}
diff --git a/js/src/jit-test/modules/empty.js b/js/src/jit-test/modules/empty.js
new file mode 100644
index 0000000000..bd9ec079d8
--- /dev/null
+++ b/js/src/jit-test/modules/empty.js
@@ -0,0 +1 @@
+// Intentionally empty.
diff --git a/js/src/jit-test/modules/export-circular-nonexisting-binding-1.js b/js/src/jit-test/modules/export-circular-nonexisting-binding-1.js
new file mode 100644
index 0000000000..2b91b6a284
--- /dev/null
+++ b/js/src/jit-test/modules/export-circular-nonexisting-binding-1.js
@@ -0,0 +1,4 @@
+import "export-circular-nonexisting-binding-2.js";
+
+export* from "empty.js";
+export {x} from "empty.js";
diff --git a/js/src/jit-test/modules/export-circular-nonexisting-binding-2.js b/js/src/jit-test/modules/export-circular-nonexisting-binding-2.js
new file mode 100644
index 0000000000..ba7dcc1b48
--- /dev/null
+++ b/js/src/jit-test/modules/export-circular-nonexisting-binding-2.js
@@ -0,0 +1 @@
+export {x} from "export-circular-nonexisting-binding-1.js";
diff --git a/js/src/jit-test/modules/export-default-async-asi.js b/js/src/jit-test/modules/export-default-async-asi.js
new file mode 100644
index 0000000000..a69a7aa3dc
--- /dev/null
+++ b/js/src/jit-test/modules/export-default-async-asi.js
@@ -0,0 +1,2 @@
+export default async // ASI occurs here due to the [no LineTerminator here] restriction on default-exporting an async function
+function async() { return 17; }
diff --git a/js/src/jit-test/modules/export-default-async-regexpy.js b/js/src/jit-test/modules/export-default-async-regexpy.js
new file mode 100644
index 0000000000..3a33ecbc85
--- /dev/null
+++ b/js/src/jit-test/modules/export-default-async-regexpy.js
@@ -0,0 +1,6 @@
+var async = 42;
+var x = 3;
+var g = 2;
+
+export default async
+/x/g;
diff --git a/js/src/jit-test/modules/export-ns.js b/js/src/jit-test/modules/export-ns.js
new file mode 100644
index 0000000000..0d2e499088
--- /dev/null
+++ b/js/src/jit-test/modules/export-ns.js
@@ -0,0 +1 @@
+export * as ns from "module1.js";
diff --git a/js/src/jit-test/modules/export-star-circular-1.js b/js/src/jit-test/modules/export-star-circular-1.js
new file mode 100644
index 0000000000..9a0771b024
--- /dev/null
+++ b/js/src/jit-test/modules/export-star-circular-1.js
@@ -0,0 +1 @@
+export* from "export-star-circular-2.js";
diff --git a/js/src/jit-test/modules/export-star-circular-2.js b/js/src/jit-test/modules/export-star-circular-2.js
new file mode 100644
index 0000000000..b273d9cefa
--- /dev/null
+++ b/js/src/jit-test/modules/export-star-circular-2.js
@@ -0,0 +1,3 @@
+export {y as x} from "export-star-circular-1.js";
+
+export var y = "pass";
diff --git a/js/src/jit-test/modules/exportImportMeta.js b/js/src/jit-test/modules/exportImportMeta.js
new file mode 100644
index 0000000000..28937ade4e
--- /dev/null
+++ b/js/src/jit-test/modules/exportImportMeta.js
@@ -0,0 +1,3 @@
+export default function() {
+ return import.meta;
+}
diff --git a/js/src/jit-test/modules/isEven.js b/js/src/jit-test/modules/isEven.js
new file mode 100644
index 0000000000..242cddf402
--- /dev/null
+++ b/js/src/jit-test/modules/isEven.js
@@ -0,0 +1,12 @@
+import { isOdd } from "isOdd.js"
+
+export function isEven(x) {
+ if (x < 0)
+ throw "negative";
+ if (x == 0)
+ return true;
+ return isOdd(x - 1);
+}
+
+assertEq(isEven(4), true);
+assertEq(isOdd(5), true);
diff --git a/js/src/jit-test/modules/isOdd.js b/js/src/jit-test/modules/isOdd.js
new file mode 100644
index 0000000000..2cada0cf93
--- /dev/null
+++ b/js/src/jit-test/modules/isOdd.js
@@ -0,0 +1,12 @@
+import { isEven } from "isEven.js"
+
+export function isOdd(x) {
+ if (x < 0)
+ throw "negative";
+ if (x == 0)
+ return false;
+ return isEven(x - 1);
+}
+
+assertEq(isEven(4), true);
+assertEq(isOdd(5), true);
diff --git a/js/src/jit-test/modules/module1.js b/js/src/jit-test/modules/module1.js
new file mode 100644
index 0000000000..cc798ff50d
--- /dev/null
+++ b/js/src/jit-test/modules/module1.js
@@ -0,0 +1 @@
+export const a = 1;
diff --git a/js/src/jit-test/modules/module1a.js b/js/src/jit-test/modules/module1a.js
new file mode 100644
index 0000000000..66d48fc1e6
--- /dev/null
+++ b/js/src/jit-test/modules/module1a.js
@@ -0,0 +1 @@
+export const a = 2;
diff --git a/js/src/jit-test/modules/module2.js b/js/src/jit-test/modules/module2.js
new file mode 100644
index 0000000000..6287b0f71c
--- /dev/null
+++ b/js/src/jit-test/modules/module2.js
@@ -0,0 +1 @@
+export let b = 2;
diff --git a/js/src/jit-test/modules/module3.js b/js/src/jit-test/modules/module3.js
new file mode 100644
index 0000000000..df4cdade58
--- /dev/null
+++ b/js/src/jit-test/modules/module3.js
@@ -0,0 +1 @@
+export var c = 3;
diff --git a/js/src/jit-test/modules/module4.js b/js/src/jit-test/modules/module4.js
new file mode 100644
index 0000000000..456ffaafac
--- /dev/null
+++ b/js/src/jit-test/modules/module4.js
@@ -0,0 +1 @@
+export default 4;
diff --git a/js/src/jit-test/modules/recursiveStarExport.js b/js/src/jit-test/modules/recursiveStarExport.js
new file mode 100644
index 0000000000..681c7be91b
--- /dev/null
+++ b/js/src/jit-test/modules/recursiveStarExport.js
@@ -0,0 +1 @@
+export * from 'recursiveStarExport.js';