summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklinDM <mrmineshafter17@gmail.com>2023-05-07 00:58:34 +0800
committerFranklinDM <mrmineshafter17@gmail.com>2023-05-07 01:01:23 +0800
commitca10d0ad23d8c66f7b1b225515e3f4ff1de8da23 (patch)
tree1927ca65f3808f0cb497eca86895bfb3086ea141
parente381dd84c21964c74e53adeed45322fe3fddfd85 (diff)
downloaduxp-ca10d0ad23d8c66f7b1b225515e3f4ff1de8da23.tar.gz
Issue #2234 - Part 3: Update tests
Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1402649 and https://bugzilla.mozilla.org/show_bug.cgi?id=1382306
-rw-r--r--js/src/jit-test/tests/modules/bug-1402649.js15
-rw-r--r--js/src/tests/ecma_2017/AsyncFunctions/async-function-declaration-in-modules.js13
-rw-r--r--js/src/tests/ecma_2018/AsyncGenerators/async-generator-declaration-in-modules.js13
-rw-r--r--js/src/tests/ecma_2018/AsyncGenerators/browser.js0
-rw-r--r--js/src/tests/ecma_2018/AsyncGenerators/shell.js0
-rw-r--r--js/src/tests/ecma_2018/browser.js0
-rw-r--r--js/src/tests/ecma_2018/shell.js0
7 files changed, 41 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/modules/bug-1402649.js b/js/src/jit-test/tests/modules/bug-1402649.js
new file mode 100644
index 0000000000..2e5487210b
--- /dev/null
+++ b/js/src/jit-test/tests/modules/bug-1402649.js
@@ -0,0 +1,15 @@
+if (!('oomTest' in this))
+ quit();
+
+loadFile(`
+function parseAndEvaluate(source) {
+ let m = parseModule(source);
+ m.declarationInstantiation();
+}
+parseAndEvaluate("async function a() { await 2 + 3; }")
+`);
+function loadFile(lfVarx) {
+ oomTest(function() {
+ eval(lfVarx);
+ });
+}
diff --git a/js/src/tests/ecma_2017/AsyncFunctions/async-function-declaration-in-modules.js b/js/src/tests/ecma_2017/AsyncFunctions/async-function-declaration-in-modules.js
new file mode 100644
index 0000000000..41cc37bf33
--- /dev/null
+++ b/js/src/tests/ecma_2017/AsyncFunctions/async-function-declaration-in-modules.js
@@ -0,0 +1,13 @@
+// |reftest| module
+
+async function f() {
+ return "success";
+}
+
+var AsyncFunction = (async function(){}).constructor;
+
+assertEq(f instanceof AsyncFunction, true);
+
+f().then(v => {
+ reportCompare("success", v);
+});
diff --git a/js/src/tests/ecma_2018/AsyncGenerators/async-generator-declaration-in-modules.js b/js/src/tests/ecma_2018/AsyncGenerators/async-generator-declaration-in-modules.js
new file mode 100644
index 0000000000..6cac859579
--- /dev/null
+++ b/js/src/tests/ecma_2018/AsyncGenerators/async-generator-declaration-in-modules.js
@@ -0,0 +1,13 @@
+// |reftest| module skip-if(release_or_beta)
+
+async function* f() {
+ return "success";
+}
+
+var AsyncGenerator = (async function*(){}).constructor;
+
+assertEq(f instanceof AsyncGenerator, true);
+
+f().next().then(v => {
+ reportCompare("success", v.value);
+});
diff --git a/js/src/tests/ecma_2018/AsyncGenerators/browser.js b/js/src/tests/ecma_2018/AsyncGenerators/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/ecma_2018/AsyncGenerators/browser.js
diff --git a/js/src/tests/ecma_2018/AsyncGenerators/shell.js b/js/src/tests/ecma_2018/AsyncGenerators/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/ecma_2018/AsyncGenerators/shell.js
diff --git a/js/src/tests/ecma_2018/browser.js b/js/src/tests/ecma_2018/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/ecma_2018/browser.js
diff --git a/js/src/tests/ecma_2018/shell.js b/js/src/tests/ecma_2018/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/ecma_2018/shell.js