summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/modules/bug1586599.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/modules/bug1586599.js')
-rw-r--r--js/src/jit-test/tests/modules/bug1586599.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/modules/bug1586599.js b/js/src/jit-test/tests/modules/bug1586599.js
new file mode 100644
index 0000000000..a38f53037f
--- /dev/null
+++ b/js/src/jit-test/tests/modules/bug1586599.js
@@ -0,0 +1,30 @@
+let m1 = parseModule(`
+function x() {
+ return 1;
+}
+function y() {
+ x = function() { return 2; };
+}
+export { x, y };
+`);
+m1.declarationInstantiation();
+m1.evaluation();
+
+registerModule('m1', m1);
+
+let m2 = parseModule(`
+import {x, y} from "m1";
+
+function test(expected) {
+ for (var i = 0; i < 2000; i++) {
+ if (i > 1900) {
+ assertEq(x(), expected);
+ }
+ }
+}
+test(1);
+y();
+test(2);
+`);
+m2.declarationInstantiation();
+m2.evaluation();