summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/modules
diff options
context:
space:
mode:
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/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
13 files changed, 48 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 000000000..3e0d31e3e
--- /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 000000000..d64803a00
--- /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 000000000..e7c3cd924
--- /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 000000000..c05d5ff5a
--- /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 000000000..1c6e75d45
--- /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/isEven.js b/js/src/jit-test/modules/isEven.js
new file mode 100644
index 000000000..242cddf40
--- /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 000000000..2cada0cf9
--- /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 000000000..cc798ff50
--- /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 000000000..66d48fc1e
--- /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 000000000..6287b0f71
--- /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 000000000..df4cdade5
--- /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 000000000..456ffaafa
--- /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 000000000..681c7be91
--- /dev/null
+++ b/js/src/jit-test/modules/recursiveStarExport.js
@@ -0,0 +1 @@
+export * from 'recursiveStarExport.js';