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 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 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 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