summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/expressions/dynamic-import/syntax/valid')
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/callexpression-arguments.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/callexpression-templateliteral.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/empty_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-empty-str-is-valid-assign-expr.js27
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-assertions-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-assertions-trailing-comma-second.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-attributes-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-attributes-trailing-comma-second.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-nested-imports.js27
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-script-code-valid.js31
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-empty-str-is-valid-assign-expr.js27
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-assertions-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-assertions-trailing-comma-second.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-attributes-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-attributes-trailing-comma-second.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-nested-imports.js27
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-script-code-valid.js31
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-empty-str-is-valid-assign-expr.js30
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-assertions-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-assertions-trailing-comma-second.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-attributes-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-attributes-trailing-comma-second.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-nested-imports.js30
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-empty-str-is-valid-assign-expr.js30
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-assertions-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-assertions-trailing-comma-second.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-attributes-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-attributes-trailing-comma-second.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-nested-imports.js30
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-script-code-valid.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-script-code-valid.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-empty-str-is-valid-assign-expr.js31
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-assertions-trailing-comma-first.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-assertions-trailing-comma-second.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-attributes-trailing-comma-first.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-attributes-trailing-comma-second.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-nested-imports.js31
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-script-code-valid.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-empty-str-is-valid-assign-expr.js27
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-assertions-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-assertions-trailing-comma-second.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-attributes-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-attributes-trailing-comma-second.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-nested-imports.js27
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-script-code-valid.js31
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-empty-str-is-valid-assign-expr.js31
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-assertions-trailing-comma-first.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-assertions-trailing-comma-second.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-attributes-trailing-comma-first.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-attributes-trailing-comma-second.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-nested-imports.js31
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-script-code-valid.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-empty-str-is-valid-assign-expr.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-empty-str-is-valid-assign-expr.js30
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-assertions-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-assertions-trailing-comma-second.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-attributes-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-attributes-trailing-comma-second.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-nested-imports.js30
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-script-code-valid.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-assertions-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-assertions-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-attributes-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-attributes-trailing-comma-second.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-nested-imports.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-script-code-valid.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/new-covered-expression-is-valid.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-empty-str-is-valid-assign-expr.js17
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-assertions-trailing-comma-first.js23
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-assertions-trailing-comma-second.js23
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-attributes-trailing-comma-first.js23
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-attributes-trailing-comma-second.js23
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-nested-imports.js17
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-script-code-valid.js21
153 files changed, 4882 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/browser.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/browser.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/callexpression-arguments.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/callexpression-arguments.js
new file mode 100644
index 0000000000..365c6a7db6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/callexpression-arguments.js
@@ -0,0 +1,33 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall is a CallExpression and can be used before arguments
+esid: prod-ImportCall
+info: |
+ CallExpression:
+ ImportCall
+ CallExpression TemplateLiteral
+ CallExpression Arguments
+features: [dynamic-import]
+---*/
+
+// valid syntax, but fails on runtime evaluation
+
+assert.throws(TypeError, () => {
+ import('./empty_FIXTURE.js')();
+}, 'empty arguments');
+
+assert.throws(TypeError, () => {
+ import('./empty_FIXTURE.js')(1,);
+}, 'arguments with trailing comma');
+
+assert.throws(TypeError, () => {
+ import('./empty_FIXTURE.js')(1, 2);
+}, '2 arguments');
+
+assert.throws(TypeError, () => {
+ import('./empty_FIXTURE.js')(...[]);
+}, 'spread args');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/callexpression-templateliteral.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/callexpression-templateliteral.js
new file mode 100644
index 0000000000..16a6d044ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/callexpression-templateliteral.js
@@ -0,0 +1,29 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall is a CallExpression and can be used before a template literal
+esid: prod-ImportCall
+info: |
+ CallExpression:
+ ImportCall
+ CallExpression TemplateLiteral
+ CallExpression Arguments
+features: [dynamic-import]
+---*/
+
+// valid syntax, but fails on runtime evaluation
+
+assert.throws(TypeError, () => {
+ import('./empty_FIXTURE.js')``;
+});
+
+assert.throws(TypeError, () => {
+ import('./empty_FIXTURE.js')`something`;
+});
+
+assert.throws(TypeError, () => {
+ import('./empty_FIXTURE.js')`${42}`;
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/empty_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/empty_FIXTURE.js
new file mode 100644
index 0000000000..92eb2c370f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/empty_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+// empty code
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..c650286fc0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,27 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template
+/*---
+description: Calling import('') (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+let f = () => import('');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..9f4b9da1e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-assertions-trailing-comma-first.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let f = () => import('./empty_FIXTURE.js',);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..639c6ee789
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-assertions-trailing-comma-second.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let f = () => import('./empty_FIXTURE.js', {},);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..8708975017
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-attributes-trailing-comma-first.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let f = () => import('./empty_FIXTURE.js',);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..b9e6fb5c4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-attributes-trailing-comma-second.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let f = () => import('./empty_FIXTURE.js', {},);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-nested-imports.js
new file mode 100644
index 0000000000..169b868865
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-nested-imports.js
@@ -0,0 +1,27 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+let f = () => import(import(import('./empty_FIXTURE.js')));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-script-code-valid.js
new file mode 100644
index 0000000000..401ff2f1cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-script-code-valid.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template
+/*---
+description: import() can be used in script code (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+let f = () => import('./empty_FIXTURE.js');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..190bd0ab8c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-arrow.template
+/*---
+description: Calling import('') (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+let f = () => {
+ import('');
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..c29e891b2a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-arrow.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let f = () => {
+ import('./empty_FIXTURE.js',);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..b8dfde0a51
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-arrow.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let f = () => {
+ import('./empty_FIXTURE.js', {},);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..58c47da25d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-arrow.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let f = () => {
+ import('./empty_FIXTURE.js',);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..38fe73eeea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-arrow.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let f = () => {
+ import('./empty_FIXTURE.js', {},);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-nested-imports.js
new file mode 100644
index 0000000000..25fcab91d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-arrow.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+let f = () => {
+ import(import(import('./empty_FIXTURE.js')));
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-script-code-valid.js
new file mode 100644
index 0000000000..1ea0f9cdc0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-arrow.template
+/*---
+description: import() can be used in script code (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+let f = () => {
+ import('./empty_FIXTURE.js');
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..29ef2dac58
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template
+/*---
+description: Calling import('') (nested in async arrow function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+(async () => {
+ await import('')
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..0ef3ea1a17
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested in async arrow function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+(async () => {
+ await import('./empty_FIXTURE.js',)
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..33d631a25a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested in async arrow function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+(async () => {
+ await import('./empty_FIXTURE.js', {},)
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..bcf8cbc91a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested in async arrow function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+(async () => {
+ await import('./empty_FIXTURE.js',)
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..3016f4c7c8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested in async arrow function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+(async () => {
+ await import('./empty_FIXTURE.js', {},)
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-nested-imports.js
new file mode 100644
index 0000000000..f41acd5ced
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested in async arrow function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+(async () => {
+ await import(import(import('./empty_FIXTURE.js')))
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-script-code-valid.js
new file mode 100644
index 0000000000..313a43a174
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template
+/*---
+description: import() can be used in script code (nested in async arrow function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+(async () => {
+ await import('./empty_FIXTURE.js')
+});
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..307a929f46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,27 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template
+/*---
+description: Calling import('') (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+(async () => await import(''));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..3ddac112e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-assertions-trailing-comma-first.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+(async () => await import('./empty_FIXTURE.js',));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..a75425cdf4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-assertions-trailing-comma-second.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+(async () => await import('./empty_FIXTURE.js', {},));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..a486d0bd14
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-attributes-trailing-comma-first.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+(async () => await import('./empty_FIXTURE.js',));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..37ea1e4456
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-attributes-trailing-comma-second.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+(async () => await import('./empty_FIXTURE.js', {},));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-nested-imports.js
new file mode 100644
index 0000000000..00b4d723a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-nested-imports.js
@@ -0,0 +1,27 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+(async () => await import(import(import('./empty_FIXTURE.js'))));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-script-code-valid.js
new file mode 100644
index 0000000000..b32347f0de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-script-code-valid.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template
+/*---
+description: import() can be used in script code (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+(async () => await import('./empty_FIXTURE.js'));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..1f328bd435
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-async-function-await.template
+/*---
+description: Calling import('') (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+async function f() {
+ await import('');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..bc6d853695
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-function-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ await import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..da2e80ef0c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-function-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ await import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..dc7701bb1b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-function-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ await import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..1a97e8b145
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-function-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ await import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-nested-imports.js
new file mode 100644
index 0000000000..8402882b1e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-async-function-await.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+async function f() {
+ await import(import(import('./empty_FIXTURE.js')));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-script-code-valid.js
new file mode 100644
index 0000000000..d31afbed8a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-async-function-await.template
+/*---
+description: import() can be used in script code (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+async function f() {
+ await import('./empty_FIXTURE.js');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..de56a1fd38
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,30 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-async-function.template
+/*---
+description: Calling import('') (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+async function f() {
+ import('');
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..ebeb2cb744
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-assertions-trailing-comma-first.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-function.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ import('./empty_FIXTURE.js',);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..18ad6993bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-assertions-trailing-comma-second.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-function.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ import('./empty_FIXTURE.js', {},);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..a3f41de5c5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-attributes-trailing-comma-first.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-function.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ import('./empty_FIXTURE.js',);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..016147183c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-attributes-trailing-comma-second.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-function.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ import('./empty_FIXTURE.js', {},);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-nested-imports.js
new file mode 100644
index 0000000000..899288c4a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-nested-imports.js
@@ -0,0 +1,30 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-async-function.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+async function f() {
+ import(import(import('./empty_FIXTURE.js')));
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..d2682ffd3c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,30 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template
+/*---
+description: Calling import('') (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+async function f() {
+ return await import('');
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..e1a6c11203
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-assertions-trailing-comma-first.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ return await import('./empty_FIXTURE.js',);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..9f42ad9a23
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-assertions-trailing-comma-second.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ return await import('./empty_FIXTURE.js', {},);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..e69f744dad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-attributes-trailing-comma-first.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ return await import('./empty_FIXTURE.js',);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..971c5f1647
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-attributes-trailing-comma-second.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function f() {
+ return await import('./empty_FIXTURE.js', {},);
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-nested-imports.js
new file mode 100644
index 0000000000..46c01feaf0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-nested-imports.js
@@ -0,0 +1,30 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+async function f() {
+ return await import(import(import('./empty_FIXTURE.js')));
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-script-code-valid.js
new file mode 100644
index 0000000000..3ffff8c906
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-script-code-valid.js
@@ -0,0 +1,34 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template
+/*---
+description: import() can be used in script code (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+async function f() {
+ return await import('./empty_FIXTURE.js');
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-script-code-valid.js
new file mode 100644
index 0000000000..73a79f768e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-script-code-valid.js
@@ -0,0 +1,34 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-async-function.template
+/*---
+description: import() can be used in script code (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+async function f() {
+ import('./empty_FIXTURE.js');
+}
+
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..19c05edf72
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-async-generator-await.template
+/*---
+description: Calling import('') (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+async function * f() {
+ await import('')
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..1a1de33d8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-generator-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import, async-iteration]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function * f() {
+ await import('./empty_FIXTURE.js',)
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..9f977bff90
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-generator-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import, async-iteration]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function * f() {
+ await import('./empty_FIXTURE.js', {},)
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..8a216af856
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-async-generator-await.template
+/*---
+description: ImportCall trailing comma following first parameter (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import, async-iteration]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function * f() {
+ await import('./empty_FIXTURE.js',)
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..c46b4e1198
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-async-generator-await.template
+/*---
+description: ImportCall trailing comma following second parameter (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import, async-iteration]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+async function * f() {
+ await import('./empty_FIXTURE.js', {},)
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-nested-imports.js
new file mode 100644
index 0000000000..0989cc413a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-async-generator-await.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+async function * f() {
+ await import(import(import('./empty_FIXTURE.js')))
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-script-code-valid.js
new file mode 100644
index 0000000000..287f15f1d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-async-generator-await.template
+/*---
+description: import() can be used in script code (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+async function * f() {
+ await import('./empty_FIXTURE.js')
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..5a35d2f60b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-block.template
+/*---
+description: Calling import('') (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+{
+ import('');
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..28fa4544a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-block.template
+/*---
+description: ImportCall trailing comma following first parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+{
+ import('./empty_FIXTURE.js',);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..e097031cf1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-block.template
+/*---
+description: ImportCall trailing comma following second parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+{
+ import('./empty_FIXTURE.js', {},);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..fdfba7eb9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-block.template
+/*---
+description: ImportCall trailing comma following first parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+{
+ import('./empty_FIXTURE.js',);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..005f16974b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-block.template
+/*---
+description: ImportCall trailing comma following second parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+{
+ import('./empty_FIXTURE.js', {},);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..ee883d4d4b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-block-labeled.template
+/*---
+description: Calling import('') (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+label: {
+ import('');
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..a0be4f8f45
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-block-labeled.template
+/*---
+description: ImportCall trailing comma following first parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+label: {
+ import('./empty_FIXTURE.js',);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..38e1ed8cde
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-block-labeled.template
+/*---
+description: ImportCall trailing comma following second parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+label: {
+ import('./empty_FIXTURE.js', {},);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..44f850dbf1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-block-labeled.template
+/*---
+description: ImportCall trailing comma following first parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+label: {
+ import('./empty_FIXTURE.js',);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..d610caf1d0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-block-labeled.template
+/*---
+description: ImportCall trailing comma following second parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+label: {
+ import('./empty_FIXTURE.js', {},);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-nested-imports.js
new file mode 100644
index 0000000000..daa1739922
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-block-labeled.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+label: {
+ import(import(import('./empty_FIXTURE.js')));
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-script-code-valid.js
new file mode 100644
index 0000000000..9f03faff96
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-block-labeled.template
+/*---
+description: import() can be used in script code (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+label: {
+ import('./empty_FIXTURE.js');
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-nested-imports.js
new file mode 100644
index 0000000000..527feea701
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-block.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+{
+ import(import(import('./empty_FIXTURE.js')));
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-script-code-valid.js
new file mode 100644
index 0000000000..3e66d21eaf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-block.template
+/*---
+description: import() can be used in script code (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+{
+ import('./empty_FIXTURE.js');
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..d287067c52
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-do-while.template
+/*---
+description: Calling import('') (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+do {
+ import('');
+} while (false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..da97f1aff1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-do-while.template
+/*---
+description: ImportCall trailing comma following first parameter (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+do {
+ import('./empty_FIXTURE.js',);
+} while (false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..5affd6218e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-do-while.template
+/*---
+description: ImportCall trailing comma following second parameter (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+do {
+ import('./empty_FIXTURE.js', {},);
+} while (false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..293395c9da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-do-while.template
+/*---
+description: ImportCall trailing comma following first parameter (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+do {
+ import('./empty_FIXTURE.js',);
+} while (false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..d370e9105c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-do-while.template
+/*---
+description: ImportCall trailing comma following second parameter (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+do {
+ import('./empty_FIXTURE.js', {},);
+} while (false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-nested-imports.js
new file mode 100644
index 0000000000..72abae9eae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-do-while.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+do {
+ import(import(import('./empty_FIXTURE.js')));
+} while (false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-script-code-valid.js
new file mode 100644
index 0000000000..895c31876c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-do-while.template
+/*---
+description: import() can be used in script code (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+do {
+ import('./empty_FIXTURE.js');
+} while (false);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..98c720413f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-else-braceless.template
+/*---
+description: Calling import('') (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+if (false) {
+
+} else import('');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..4fcd241943
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-else-braceless.template
+/*---
+description: ImportCall trailing comma following first parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (false) {
+
+} else import('./empty_FIXTURE.js',);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..9bdea8900d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-else-braceless.template
+/*---
+description: ImportCall trailing comma following second parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (false) {
+
+} else import('./empty_FIXTURE.js', {},);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..7959b78b3c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-else-braceless.template
+/*---
+description: ImportCall trailing comma following first parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (false) {
+
+} else import('./empty_FIXTURE.js',);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..7346fb646b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-else-braceless.template
+/*---
+description: ImportCall trailing comma following second parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (false) {
+
+} else import('./empty_FIXTURE.js', {},);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-nested-imports.js
new file mode 100644
index 0000000000..96cff127d3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-else-braceless.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+if (false) {
+
+} else import(import(import('./empty_FIXTURE.js')));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-script-code-valid.js
new file mode 100644
index 0000000000..490ddb8376
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-else-braceless.template
+/*---
+description: import() can be used in script code (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+if (false) {
+
+} else import('./empty_FIXTURE.js');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..aa6b70d4c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-else.template
+/*---
+description: Calling import('') (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+if (false) {
+
+} else {
+ import('');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..aa0e2e085c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-assertions-trailing-comma-first.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-else.template
+/*---
+description: ImportCall trailing comma following first parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (false) {
+
+} else {
+ import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..0e341f4d79
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-assertions-trailing-comma-second.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-else.template
+/*---
+description: ImportCall trailing comma following second parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (false) {
+
+} else {
+ import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..e8afb50437
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-attributes-trailing-comma-first.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-else.template
+/*---
+description: ImportCall trailing comma following first parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (false) {
+
+} else {
+ import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..11eff64e25
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-import-attributes-trailing-comma-second.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-else.template
+/*---
+description: ImportCall trailing comma following second parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (false) {
+
+} else {
+ import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-nested-imports.js
new file mode 100644
index 0000000000..7f4b901353
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-nested-imports.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-else.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+if (false) {
+
+} else {
+ import(import(import('./empty_FIXTURE.js')));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-script-code-valid.js
new file mode 100644
index 0000000000..0f06d08854
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-script-code-valid.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-else.template
+/*---
+description: import() can be used in script code (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+if (false) {
+
+} else {
+ import('./empty_FIXTURE.js');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..18c1356099
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-function.template
+/*---
+description: Calling import('') (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+function fn() {
+ import('');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..71d1cf4ef7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-function.template
+/*---
+description: ImportCall trailing comma following first parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+function fn() {
+ import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..c2a6af71cc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-function.template
+/*---
+description: ImportCall trailing comma following second parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+function fn() {
+ import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..0a30f53005
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-function.template
+/*---
+description: ImportCall trailing comma following first parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+function fn() {
+ import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..e15198a3d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-function.template
+/*---
+description: ImportCall trailing comma following second parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+function fn() {
+ import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-nested-imports.js
new file mode 100644
index 0000000000..1bc3735c70
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-function.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+function fn() {
+ import(import(import('./empty_FIXTURE.js')));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..8fe6a994f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-function-return.template
+/*---
+description: Calling import('') (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+function fn() {
+ return import('');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..d397d7ac6f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-function-return.template
+/*---
+description: ImportCall trailing comma following first parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+function fn() {
+ return import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..858a2248be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-function-return.template
+/*---
+description: ImportCall trailing comma following second parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+function fn() {
+ return import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..78f032870d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-function-return.template
+/*---
+description: ImportCall trailing comma following first parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+function fn() {
+ return import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..ae352f15e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-function-return.template
+/*---
+description: ImportCall trailing comma following second parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+function fn() {
+ return import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-nested-imports.js
new file mode 100644
index 0000000000..bc945e953d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-function-return.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+function fn() {
+ return import(import(import('./empty_FIXTURE.js')));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-script-code-valid.js
new file mode 100644
index 0000000000..ccf53416d4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-function-return.template
+/*---
+description: import() can be used in script code (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+function fn() {
+ return import('./empty_FIXTURE.js');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-script-code-valid.js
new file mode 100644
index 0000000000..fcbddb51a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-function.template
+/*---
+description: import() can be used in script code (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+function fn() {
+ import('./empty_FIXTURE.js');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..ba443c0e7d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,27 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-if-braceless.template
+/*---
+description: Calling import('') (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+if (true) import('');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..91848a7183
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-assertions-trailing-comma-first.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-if-braceless.template
+/*---
+description: ImportCall trailing comma following first parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (true) import('./empty_FIXTURE.js',);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..b53c5c9db7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-assertions-trailing-comma-second.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-if-braceless.template
+/*---
+description: ImportCall trailing comma following second parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (true) import('./empty_FIXTURE.js', {},);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..16b4a6a3c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-attributes-trailing-comma-first.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-if-braceless.template
+/*---
+description: ImportCall trailing comma following first parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (true) import('./empty_FIXTURE.js',);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..59f6b64cc3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-attributes-trailing-comma-second.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-if-braceless.template
+/*---
+description: ImportCall trailing comma following second parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (true) import('./empty_FIXTURE.js', {},);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-nested-imports.js
new file mode 100644
index 0000000000..f3a595c7a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-nested-imports.js
@@ -0,0 +1,27 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-if-braceless.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+if (true) import(import(import('./empty_FIXTURE.js')));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-script-code-valid.js
new file mode 100644
index 0000000000..ff1be2a13b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-script-code-valid.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-if-braceless.template
+/*---
+description: import() can be used in script code (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+if (true) import('./empty_FIXTURE.js');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..0ea110f2cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-if.template
+/*---
+description: Calling import('') (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+if (true) {
+ import('');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..7c7a8c50c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-if.template
+/*---
+description: ImportCall trailing comma following first parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (true) {
+ import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..bd20bc4994
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-if.template
+/*---
+description: ImportCall trailing comma following second parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (true) {
+ import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..d3b066be74
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-if.template
+/*---
+description: ImportCall trailing comma following first parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (true) {
+ import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..b7c56ae236
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-if.template
+/*---
+description: ImportCall trailing comma following second parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+if (true) {
+ import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-nested-imports.js
new file mode 100644
index 0000000000..ed17aaaab9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-if.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+if (true) {
+ import(import(import('./empty_FIXTURE.js')));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-script-code-valid.js
new file mode 100644
index 0000000000..2edbfa5a45
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-if.template
+/*---
+description: import() can be used in script code (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+if (true) {
+ import('./empty_FIXTURE.js');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..1a723acfce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-while.template
+/*---
+description: Calling import('') (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('');
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..d9fd806fdb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-assertions-trailing-comma-first.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-while.template
+/*---
+description: ImportCall trailing comma following first parameter (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./empty_FIXTURE.js',);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..2ff4072e36
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-assertions-trailing-comma-second.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-while.template
+/*---
+description: ImportCall trailing comma following second parameter (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./empty_FIXTURE.js', {},);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..b85e27f011
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-attributes-trailing-comma-first.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-while.template
+/*---
+description: ImportCall trailing comma following first parameter (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./empty_FIXTURE.js',);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..c61da3ff69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-import-attributes-trailing-comma-second.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-while.template
+/*---
+description: ImportCall trailing comma following second parameter (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./empty_FIXTURE.js', {},);
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-nested-imports.js
new file mode 100644
index 0000000000..f8678b2781
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-nested-imports.js
@@ -0,0 +1,31 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-while.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import(import(import('./empty_FIXTURE.js')));
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-script-code-valid.js
new file mode 100644
index 0000000000..df6ab305b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-script-code-valid.js
@@ -0,0 +1,35 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-while.template
+/*---
+description: import() can be used in script code (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./empty_FIXTURE.js');
+};
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..b2e183f89b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-with.template
+/*---
+description: Calling import('') (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+with ({}) {
+ import('');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..b56964f75f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,30 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/nested-with-expression.template
+/*---
+description: Calling import('') (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+with (import('')) {
+ assert.sameValue(then, Promise.prototype.then);
+ assert.sameValue(constructor, Promise);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..fb6c4fbb78
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-assertions-trailing-comma-first.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-with-expression.template
+/*---
+description: ImportCall trailing comma following first parameter (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+with (import('./empty_FIXTURE.js',)) {
+ assert.sameValue(then, Promise.prototype.then);
+ assert.sameValue(constructor, Promise);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..7845851a93
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-assertions-trailing-comma-second.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-with-expression.template
+/*---
+description: ImportCall trailing comma following second parameter (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+with (import('./empty_FIXTURE.js', {},)) {
+ assert.sameValue(then, Promise.prototype.then);
+ assert.sameValue(constructor, Promise);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..bb5b350f46
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-attributes-trailing-comma-first.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-with-expression.template
+/*---
+description: ImportCall trailing comma following first parameter (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+with (import('./empty_FIXTURE.js',)) {
+ assert.sameValue(then, Promise.prototype.then);
+ assert.sameValue(constructor, Promise);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..d2599830e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-attributes-trailing-comma-second.js
@@ -0,0 +1,36 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-with-expression.template
+/*---
+description: ImportCall trailing comma following second parameter (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+with (import('./empty_FIXTURE.js', {},)) {
+ assert.sameValue(then, Promise.prototype.then);
+ assert.sameValue(constructor, Promise);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-nested-imports.js
new file mode 100644
index 0000000000..df51415c42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-nested-imports.js
@@ -0,0 +1,30 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-with-expression.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+with (import(import(import('./empty_FIXTURE.js')))) {
+ assert.sameValue(then, Promise.prototype.then);
+ assert.sameValue(constructor, Promise);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-script-code-valid.js
new file mode 100644
index 0000000000..62feb5dcbb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-script-code-valid.js
@@ -0,0 +1,34 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-with-expression.template
+/*---
+description: import() can be used in script code (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+with (import('./empty_FIXTURE.js')) {
+ assert.sameValue(then, Promise.prototype.then);
+ assert.sameValue(constructor, Promise);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..a4e4af9ec9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-assertions-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-with.template
+/*---
+description: ImportCall trailing comma following first parameter (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+with ({}) {
+ import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..72e86d4b4d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-assertions-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-with.template
+/*---
+description: ImportCall trailing comma following second parameter (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+with ({}) {
+ import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..c55329ae40
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-attributes-trailing-comma-first.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/nested-with.template
+/*---
+description: ImportCall trailing comma following first parameter (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+with ({}) {
+ import('./empty_FIXTURE.js',);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..b255d41d65
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-import-attributes-trailing-comma-second.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/nested-with.template
+/*---
+description: ImportCall trailing comma following second parameter (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+with ({}) {
+ import('./empty_FIXTURE.js', {},);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-nested-imports.js
new file mode 100644
index 0000000000..059f0242bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-nested-imports.js
@@ -0,0 +1,29 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/nested-with.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+
+with ({}) {
+ import(import(import('./empty_FIXTURE.js')));
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-script-code-valid.js
new file mode 100644
index 0000000000..bfd0c6886f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-script-code-valid.js
@@ -0,0 +1,33 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/nested-with.template
+/*---
+description: import() can be used in script code (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null).
+ 3. Let argRef be the result of evaluating AssignmentExpression.
+ 4. Let specifier be ? GetValue(argRef).
+ 5. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 6. Let specifierString be ToString(specifier).
+ 7. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 9. Return promiseCapability.[[Promise]].
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+with ({}) {
+ import('./empty_FIXTURE.js');
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/new-covered-expression-is-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/new-covered-expression-is-valid.js
new file mode 100644
index 0000000000..a91af559b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/new-covered-expression-is-valid.js
@@ -0,0 +1,41 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall is a CallExpression and Expression, so it can be wrapped
+ for new expressions, while the same production is not possible without
+ the parentheses wrapping.
+esid: prod-ImportCall
+info: |
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+
+ NewExpression :
+ MemberExpression
+ new NewExpression
+
+ MemberExpression :
+ PrimaryExpression
+
+ PrimaryExpression :
+ CoverParenthesizedExpressionAndArrowParameterList
+features: [dynamic-import]
+---*/
+
+assert.throws(TypeError, () => {
+ new (import(''))
+});
+
+assert.throws(TypeError, () => {
+ new (function() {}, import(''))
+});
+
+assert.sameValue(
+ typeof new (import(''), function() {}),
+ 'object',
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/shell.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/shell.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-empty-str-is-valid-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-empty-str-is-valid-assign-expr.js
new file mode 100644
index 0000000000..c23fe700a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-empty-str-is-valid-assign-expr.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/empty-str-is-valid-assign-expr.case
+// - src/dynamic-import/syntax/valid/top-level.template
+/*---
+description: Calling import('') (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+---*/
+
+import('');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-assertions-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-assertions-trailing-comma-first.js
new file mode 100644
index 0000000000..2e4e518d53
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-assertions-trailing-comma-first.js
@@ -0,0 +1,23 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/top-level.template
+/*---
+description: ImportCall trailing comma following first parameter (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+import('./empty_FIXTURE.js',);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-assertions-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-assertions-trailing-comma-second.js
new file mode 100644
index 0000000000..eb2b17c6b7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-assertions-trailing-comma-second.js
@@ -0,0 +1,23 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-assertions-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/top-level.template
+/*---
+description: ImportCall trailing comma following second parameter (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-assertions, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+import('./empty_FIXTURE.js', {},);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-attributes-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-attributes-trailing-comma-first.js
new file mode 100644
index 0000000000..191256c2ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-attributes-trailing-comma-first.js
@@ -0,0 +1,23 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-first.case
+// - src/dynamic-import/syntax/valid/top-level.template
+/*---
+description: ImportCall trailing comma following first parameter (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+import('./empty_FIXTURE.js',);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-attributes-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-attributes-trailing-comma-second.js
new file mode 100644
index 0000000000..bbb4a36f30
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-import-attributes-trailing-comma-second.js
@@ -0,0 +1,23 @@
+// |reftest| shell-option(--enable-import-attributes) skip-if(!xulRuntime.shell) -- requires shell-options
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/import-attributes-trailing-comma-second.case
+// - src/dynamic-import/syntax/valid/top-level.template
+/*---
+description: ImportCall trailing comma following second parameter (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [import-attributes, dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+---*/
+
+import('./empty_FIXTURE.js', {},);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-nested-imports.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-nested-imports.js
new file mode 100644
index 0000000000..04a080241d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-nested-imports.js
@@ -0,0 +1,17 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/nested-imports.case
+// - src/dynamic-import/syntax/valid/top-level.template
+/*---
+description: ImportCall is a CallExpression can be nested in other import calls (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+---*/
+
+import(import(import('./empty_FIXTURE.js')));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-script-code-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-script-code-valid.js
new file mode 100644
index 0000000000..749506f019
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-script-code-valid.js
@@ -0,0 +1,21 @@
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/script-code-valid.case
+// - src/dynamic-import/syntax/valid/top-level.template
+/*---
+description: import() can be used in script code (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+---*/
+// This is still valid in script code, and should not be valid for module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
+
+
+import('./empty_FIXTURE.js');
+
+reportCompare(0, 0);