summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/import-in-lazy-function.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/modules/import-in-lazy-function.js')
-rw-r--r--js/src/jit-test/tests/modules/import-in-lazy-function.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/modules/import-in-lazy-function.js b/js/src/jit-test/tests/modules/import-in-lazy-function.js
new file mode 100644
index 000000000..cddacb142
--- /dev/null
+++ b/js/src/jit-test/tests/modules/import-in-lazy-function.js
@@ -0,0 +1,11 @@
+// |jit-test| module
+
+// Test that accessing imports in lazily parsed functions works.
+
+import { a } from "module1.js";
+
+function add1(x) {
+ return x + a;
+}
+
+assertEq(add1(2), 3);