summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/expressions/dynamic-import
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/tests/test262/language/expressions/dynamic-import
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/language/expressions/dynamic-import')
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-enumeration-abrupt.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-enumeration.js69
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-non-object.js48
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-undefined.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-value-abrupt.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-value-non-string.js48
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-await-expr.js22
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-await-ident.js22
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-abrupt-return.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-abrupt-throw.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-sequence.js28
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-get-assert-error.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-in.js23
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-non-object.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-trailing-comma-fulfill.js21
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-trailing-comma-reject.js25
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-expr.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-ident-invalid-strict.js21
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-ident-valid.js22
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/2nd-param_FIXTURE.js4
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/always-create-new-promise.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assign-expr-get-value-abrupt-throws.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/additive-expr.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/array-literal.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/arrow-function.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/await-expr.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/await-identifier.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-arguments.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-expr.js46
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-identifier.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-call-expr.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-parenthesized-expr.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/identifier.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/import-meta.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-assign-operator-assign-expr.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr-nostrict.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/logical-and-expr.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/logical-or-expr.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/member-expr.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/module-code-other_FIXTURE.js11
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/module-code_FIXTURE.js11
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/new-target.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/object-literal.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/tagged-function-call.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/ternary.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/this.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/unary-expr.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-assign-expr.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-expr.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-identifier.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-star.js26
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/await-import-evaluation.js25
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/await-import-evaluation_FIXTURE.js15
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/eval-rqstd-abrupt-err-type_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/eval-rqstd-abrupt-err-uri_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-1_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-2_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-export_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous_FIXTURE.js6
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-circular-1_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-circular-2_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-script-code-target.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-file-does-not-exist.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-ambiguous-import.js62
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-circular.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-specifier-tostring-abrupt-rejects.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-rqstd-abrupt-typeerror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-rqstd-abrupt-urierror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-script-code-target.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-file-does-not-exist.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-ambiguous-import.js62
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-circular.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-specifier-tostring-abrupt-rejects.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-rqstd-abrupt-typeerror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-rqstd-abrupt-urierror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-script-code-target.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-file-does-not-exist.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-ambiguous-import.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-circular.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-specifier-tostring-abrupt-rejects.js54
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-rqstd-abrupt-typeerror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-rqstd-abrupt-urierror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-script-code-target.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-file-does-not-exist.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-instn-iee-err-ambiguous-import.js62
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-instn-iee-err-circular.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-specifier-tostring-abrupt-rejects.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-rqstd-abrupt-typeerror.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-rqstd-abrupt-urierror.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-script-code-target.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-file-does-not-exist.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-instn-iee-err-ambiguous-import.js63
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-instn-iee-err-circular.js52
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-rqstd-abrupt-urierror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-script-code-target.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-file-does-not-exist.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-instn-iee-err-ambiguous-import.js62
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-instn-iee-err-circular.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-specifier-tostring-abrupt-rejects.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-specifier-tostring-abrupt-rejects.js57
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-rqstd-abrupt-typeerror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-rqstd-abrupt-urierror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-script-code-target.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-file-does-not-exist.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-instn-iee-err-ambiguous-import.js62
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-instn-iee-err-circular.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-specifier-tostring-abrupt-rejects.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-rqstd-abrupt-typeerror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-rqstd-abrupt-urierror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-script-code-target.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-file-does-not-exist.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-instn-iee-err-ambiguous-import.js62
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-instn-iee-err-circular.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-specifier-tostring-abrupt-rejects.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-rqstd-abrupt-typeerror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-rqstd-abrupt-urierror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-script-code-target.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-file-does-not-exist.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-instn-iee-err-ambiguous-import.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-instn-iee-err-circular.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-specifier-tostring-abrupt-rejects.js54
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-rqstd-abrupt-typeerror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-rqstd-abrupt-urierror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-script-code-target.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-file-does-not-exist.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-instn-iee-err-ambiguous-import.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-instn-iee-err-circular.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-specifier-tostring-abrupt-rejects.js54
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-rqstd-abrupt-typeerror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-rqstd-abrupt-urierror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-script-code-target.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-file-does-not-exist.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-instn-iee-err-ambiguous-import.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-instn-iee-err-circular.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-specifier-tostring-abrupt-rejects.js54
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-rqstd-abrupt-typeerror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-rqstd-abrupt-urierror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-script-code-target.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-file-does-not-exist.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-instn-iee-err-ambiguous-import.js62
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-instn-iee-err-circular.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-specifier-tostring-abrupt-rejects.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-rqstd-abrupt-typeerror.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-rqstd-abrupt-urierror.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-script-code-target.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-file-does-not-exist.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-instn-iee-err-ambiguous-import.js61
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-instn-iee-err-circular.js50
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-specifier-tostring-abrupt-rejects.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-rqstd-abrupt-typeerror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-rqstd-abrupt-urierror.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-script-code-target.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-file-does-not-exist.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-instn-iee-err-ambiguous-import.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-instn-iee-err-circular.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-specifier-tostring-abrupt-rejects.js54
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-rqstd-abrupt-typeerror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-rqstd-abrupt-urierror.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-script-code-target.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-file-does-not-exist.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-instn-iee-err-ambiguous-import.js62
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-instn-iee-err-circular.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-specifier-tostring-abrupt-rejects.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/script-code_FIXTURE.js8
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-rqstd-abrupt-typeerror.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-rqstd-abrupt-urierror.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-script-code-target.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-file-does-not-exist.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-instn-iee-err-ambiguous-import.js58
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-instn-iee-err-circular.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-specifier-tostring-abrupt-rejects.js52
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/custom-primitive.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/custom-tostring_FIXTURE.js7
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/custom-valueof_FIXTURE.js7
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/dynamic-import-module_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/empty_FIXTURE.js3
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/escape-sequence-import.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-anon.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-name-meth.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-named.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-anon.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-name-meth.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-named.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-fn-anon.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-fn-named.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-gen-anon.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-gen-named.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-in.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-rqstd-once.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-rqstd-once_FIXTURE.js16
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-self-once-module.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/eval-self-once-script.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-a_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen-yield.js71
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen.js53
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-b_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-poisoned_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/imported-self-update.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-1_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-2_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/module-code_FIXTURE.js11
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-Symbol-toStringTag.js99
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-define-own-property.js178
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-exported-init-no-strict.js113
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-exported-init-strict-strict.js122
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-non-exported-no-strict.js105
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-non-exported-strict-strict.js106
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-extensible.js81
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-dflt-direct.js127
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-dflt-indirect.js127
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-props-nrml.js124
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-str-found-init.js125
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-str-not-found.js118
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-sym.js96
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-str-found.js89
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-str-not-found.js91
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-sym-found.js86
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-sym-not-found.js86
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-str-found-init.js96
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-str-not-found.js103
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-sym-found.js85
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-sym-not-found.js87
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-no-iterator.js81
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-own-property-keys-sort.js131
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prevent-extensions-object.js84
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prevent-extensions-reflect.js81
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prop-descs.js111
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prototype.js82
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-no-strict.js109
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-prototype-of-null.js82
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-prototype-of.js87
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-same-values-no-strict.js101
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-same-values-strict-strict.js112
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-strict-strict.js124
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/default-property-not-set-own.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/define-own-property_FIXTURE.js8
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/empty_FIXTURE.js3
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-named-end_FIXTURE.js7
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-named_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-prod-end_FIXTURE.js6
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-prod_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-1_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-2_FIXTURE.js24
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-3_FIXTURE.js6
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/module-code_FIXTURE.js11
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/own-keys-sort_FIXTURE.js21
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-Symbol-toStringTag.js97
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-define-own-property.js176
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-exported-init-no-strict.js111
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-exported-init-strict-strict.js120
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-non-exported-no-strict.js103
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-non-exported-strict-strict.js104
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-extensible.js79
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-dflt-direct.js125
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-dflt-indirect.js125
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-props-nrml.js122
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-str-found-init.js123
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-str-not-found.js116
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-sym.js94
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-str-found.js87
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-str-not-found.js89
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-sym-found.js84
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-sym-not-found.js84
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-str-found-init.js94
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-str-not-found.js101
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-sym-found.js83
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-sym-not-found.js85
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-no-iterator.js79
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-own-property-keys-sort.js129
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prevent-extensions-object.js82
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prevent-extensions-reflect.js79
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prop-descs.js109
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prototype.js80
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-no-strict.js107
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-prototype-of-null.js80
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-prototype-of.js85
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-same-values-no-strict.js99
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-same-values-strict-strict.js110
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-strict-strict.js122
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/namespace/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/returns-promise.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object-from-import.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object-from-script.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/shell.js127
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-1-update-expression.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-10-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-11-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-12-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-13-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-14-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-15-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-16-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-17-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-2-update-expression.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-3-update-expression.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-4-update-expression.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-5-lhs-equals-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-6-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-7-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-8-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-9-lhs-assignment-operator-assignment-expression.js49
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-assignment-expr-not-optional.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-new-call-expression.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-rest-param.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-not-extensible-args.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-assignment-expr-not-optional.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-new-call-expression.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-rest-param.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-not-extensible-args.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-assignment-expr-not-optional.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-new-call-expression.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-rest-param.js45
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-not-extensible-args.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-assignment-expr-not-optional.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-new-call-expression.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-rest-param.js45
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-not-extensible-args.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-assignment-expr-not-optional.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-no-new-call-expression.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-no-rest-param.js46
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-not-extensible-args.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-assignment-expr-not-optional.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-new-call-expression.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-rest-param.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-not-extensible-args.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-assignment-expr-not-optional.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-no-new-call-expression.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-no-rest-param.js46
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-not-extensible-args.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-assignment-expr-not-optional.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-assignment-expr-not-optional.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-new-call-expression.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-rest-param.js42
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-not-extensible-args.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-no-new-call-expression.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-no-rest-param.js44
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-not-extensible-args.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-assignment-expr-not-optional.js26
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-no-new-call-expression.js27
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-no-rest-param.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-not-extensible-args.js29
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/shell.js0
-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-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-assignment-expression-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-trailing-comma-second.js33
-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-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-arrow-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-trailing-comma-second.js35
-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-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-await-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-trailing-comma-second.js35
-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-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-arrow-function-return-await-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-trailing-comma-second.js33
-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-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-await-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-trailing-comma-second.js35
-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-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-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-return-await-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-trailing-comma-second.js36
-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-function-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-trailing-comma-second.js36
-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-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-async-gen-await-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-trailing-comma-second.js35
-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-labeled-empty-str-is-valid-assign-expr.js29
-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-labeled-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-trailing-comma-second.js35
-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-block-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-trailing-comma-second.js35
-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-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-do-while-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-trailing-comma-second.js35
-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-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-braceless-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-trailing-comma-second.js35
-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-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-else-trailing-comma-first.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-trailing-comma-second.js37
-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-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-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-return-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-trailing-comma-second.js35
-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-function-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-trailing-comma-second.js35
-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-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-braceless-trailing-comma-first.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-trailing-comma-second.js33
-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-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-if-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-trailing-comma-second.js35
-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-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-while-trailing-comma-first.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-trailing-comma-second.js37
-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-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-expression-trailing-comma-first.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-trailing-comma-second.js36
-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/nested-with-trailing-comma-first.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-trailing-comma-second.js35
-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-nested-imports.js17
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-script-code-valid.js21
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-trailing-comma-first.js23
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-trailing-comma-second.js23
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/trailing-comma-fulfill.js21
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/trailing-comma-reject.js25
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import-other_FIXTURE.js9
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import_FIXTURE.js11
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage-from-eval.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/browser.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/dynamic-import-module_FIXTURE.js5
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/eval-gtbndng-indirect-update-dflt_FIXTURE.js8
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/eval-gtbndng-indirect-update_FIXTURE.js10
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/module-code_FIXTURE.js9
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-gtbndng-indirect-update-dflt.js46
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-gtbndng-indirect-update.js54
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-script-code-host-resolves-module-code.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-is-call-expression-square-brackets.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-returns-thenable.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-specifier-tostring.js59
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-gtbndng-indirect-update-dflt.js48
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-gtbndng-indirect-update.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-script-code-host-resolves-module-code.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-is-call-expression-square-brackets.js37
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-returns-thenable.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-specifier-tostring.js61
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-gtbndng-indirect-update-dflt.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-gtbndng-indirect-update.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-script-code-host-resolves-module-code.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-is-call-expression-square-brackets.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-returns-thenable.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-specifier-tostring.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-gtbndng-indirect-update-dflt.js45
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-gtbndng-indirect-update.js53
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-script-code-host-resolves-module-code.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-is-call-expression-square-brackets.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-returns-thenable.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-specifier-tostring.js58
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-gtbndng-indirect-update-dflt.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-gtbndng-indirect-update.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-script-code-host-resolves-module-code.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-is-call-expression-square-brackets.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-returns-thenable.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-specifier-tostring.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-gtbndng-indirect-update-dflt.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-gtbndng-indirect-update.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-script-code-host-resolves-module-code.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-is-call-expression-square-brackets.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-gtbndng-indirect-update-dflt.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-gtbndng-indirect-update.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-script-code-host-resolves-module-code.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-is-call-expression-square-brackets.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-returns-thenable.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-specifier-tostring.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-returns-thenable.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-specifier-tostring.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-gtbndng-indirect-update-dflt.js52
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-gtbndng-indirect-update.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-script-code-host-resolves-module-code.js45
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-is-call-expression-square-brackets.js41
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-returns-thenable.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-specifier-tostring.js65
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-gtbndng-indirect-update-dflt.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-gtbndng-indirect-update.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-script-code-host-resolves-module-code.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-is-call-expression-square-brackets.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-returns-thenable.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-specifier-tostring.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-gtbndng-indirect-update-dflt.js45
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-gtbndng-indirect-update.js53
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-script-code-host-resolves-module-code.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-is-call-expression-square-brackets.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-returns-thenable.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-specifier-tostring.js58
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-gtbndng-indirect-update-dflt.js45
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-gtbndng-indirect-update.js53
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-script-code-host-resolves-module-code.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-is-call-expression-square-brackets.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-returns-thenable.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-specifier-tostring.js58
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-gtbndng-indirect-update-dflt.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-gtbndng-indirect-update.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-script-code-host-resolves-module-code.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-is-call-expression-square-brackets.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-returns-thenable.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-specifier-tostring.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-gtbndng-indirect-update-dflt.js46
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-gtbndng-indirect-update.js54
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-script-code-host-resolves-module-code.js39
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-is-call-expression-square-brackets.js35
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-returns-thenable.js33
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-specifier-tostring.js59
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-gtbndng-indirect-update-dflt.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-gtbndng-indirect-update.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-script-code-host-resolves-module-code.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-is-call-expression-square-brackets.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-returns-thenable.js30
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-specifier-tostring.js56
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-gtbndng-indirect-update-dflt.js45
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-gtbndng-indirect-update.js53
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-script-code-host-resolves-module-code.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-is-call-expression-square-brackets.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-returns-thenable.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-specifier-tostring.js58
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-gtbndng-indirect-update-dflt.js47
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-gtbndng-indirect-update.js55
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-script-code-host-resolves-module-code.js40
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-is-call-expression-square-brackets.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-returns-thenable.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-specifier-tostring.js60
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/shell.js0
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-gtbndng-indirect-update-dflt.js45
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-gtbndng-indirect-update.js53
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-script-code-host-resolves-module-code.js38
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-is-call-expression-square-brackets.js34
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-returns-thenable.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-specifier-tostring.js58
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-gtbndng-indirect-update-dflt.js43
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-gtbndng-indirect-update.js51
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-script-code-host-resolves-module-code.js36
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-is-call-expression-square-brackets.js32
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-returns-thenable.js30
-rw-r--r--js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-specifier-tostring.js56
633 files changed, 27836 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-enumeration-abrupt.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-enumeration-abrupt.js
new file mode 100644
index 0000000000..6112fd3d59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-enumeration-abrupt.js
@@ -0,0 +1,44 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Reports abrupt completions produced by assertion enumeration
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ [...]
+ 6. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 7. Let specifierString be ToString(specifier).
+ 8. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 9. Let assertions be a new empty List.
+ 10. If options is not undefined, then
+ a. If Type(options) is not Object,
+ [...]
+ b. Let assertionsObj be Get(options, "assert").
+ c. IfAbruptRejectPromise(assertionsObj, promiseCapability).
+ d. If assertionsObj is not undefined,
+ i. If Type(assertionsObj) is not Object,
+ [...]
+ ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key).
+ iii. IfAbruptRejectPromise(keys, promiseCapability).
+ [...]
+features: [dynamic-import, import-assertions, Proxy]
+flags: [async]
+---*/
+
+var thrown = new Test262Error();
+var options = {
+ assert: new Proxy({}, {
+ ownKeys: function() {
+ throw thrown;
+ },
+ })
+};
+
+import('./2nd-param_FIXTURE.js', options)
+ .then(function() {
+ throw new Test262Error('Expected promise to be rejected, but promise was fulfilled.');
+ }, function(error) {
+ assert.sameValue(error, thrown);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-enumeration.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-enumeration.js
new file mode 100644
index 0000000000..4f2c08a542
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-enumeration.js
@@ -0,0 +1,69 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Follows the semantics of the EnumerableOwnPropertyNames abstract operation
+ during assertion enumeration
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ [...]
+ 6. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 7. Let specifierString be ToString(specifier).
+ 8. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 9. Let assertions be a new empty List.
+ 10. If options is not undefined, then
+ a. If Type(options) is not Object,
+ [...]
+ b. Let assertionsObj be Get(options, "assert").
+ c. IfAbruptRejectPromise(assertionsObj, promiseCapability).
+ d. If assertionsObj is not undefined,
+ i. If Type(assertionsObj) is not Object,
+ [...]
+ ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key).
+ [...]
+features: [dynamic-import, import-assertions, Symbol, Proxy]
+flags: [async]
+---*/
+
+var symbol = Symbol('');
+var target = {
+ enumerable1: '',
+ enumerable2: '',
+ [symbol]: '',
+ unreported: '',
+ nonEnumerable: ''
+};
+var descriptors = {
+ enumerable1: {configurable: true, enumerable: true},
+ enumerable2: {configurable: true, enumerable: true},
+ [symbol]: {configurable: true, enumerable: true},
+ nonEnumerable: {configurable: true, enumerable: false}
+};
+var log = [];
+
+var options = {
+ assert: new Proxy({}, {
+ ownKeys: function() {
+ return ['enumerable1', symbol, 'nonEnumerable', 'absent', 'enumerable2'];
+ },
+ get(_, name) {
+ log.push(name);
+ return target[name];
+ },
+ getOwnPropertyDescriptor(target, name) {
+ return descriptors[name];
+ }
+ })
+};
+
+import('./2nd-param_FIXTURE.js', options)
+ .then(function(module) {
+ assert.sameValue(module.default, 262);
+ })
+ .then($DONE, $DONE);
+
+assert.sameValue(log.length, 2);
+assert.sameValue(log[0], 'enumerable1');
+assert.sameValue(log[1], 'enumerable2');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-non-object.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-non-object.js
new file mode 100644
index 0000000000..da7235879e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-non-object.js
@@ -0,0 +1,48 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Rejects promise when the `assert` property of the second argument is neither
+ undefined nor an object
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ [...]
+ 6. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 7. Let specifierString be ToString(specifier).
+ 8. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 9. Let assertions be a new empty List.
+ 10. If options is not undefined, then
+ a. If Type(options) is not Object,
+ [...]
+ b. Let assertionsObj be Get(options, "assert").
+ c. IfAbruptRejectPromise(assertionsObj, promiseCapability).
+ d. If assertionsObj is not undefined,
+ i. If Type(assertionsObj) is not Object,
+ 1. Perform ! Call(promiseCapability.[[Reject]], undefined, « a
+ newly created TypeError object »).
+ 2. Return promiseCapability.[[Promise]].
+ [...]
+features: [dynamic-import, import-assertions, Symbol, BigInt]
+flags: [async]
+---*/
+
+function test(promise, valueType) {
+ return promise.then(function() {
+ throw new Test262Error('Promise for ' + valueType + ' was not rejected.');
+ }, function(error) {
+ assert.sameValue(error.constructor, TypeError, valueType);
+ });
+}
+
+Promise.all([
+ test(import('./2nd-param_FIXTURE.js', {assert:null}), 'null'),
+ test(import('./2nd-param_FIXTURE.js', {assert:false}), 'boolean'),
+ test(import('./2nd-param_FIXTURE.js', {assert:23}), 'number'),
+ test(import('./2nd-param_FIXTURE.js', {assert:''}), 'string'),
+ test(import('./2nd-param_FIXTURE.js', {assert:Symbol('')}), 'symbol'),
+ test(import('./2nd-param_FIXTURE.js', {assert:23n}), 'bigint')
+ ])
+ .then(function() {})
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-undefined.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-undefined.js
new file mode 100644
index 0000000000..1173b460a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-undefined.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Accepts undefined for the `assert` property of the second argument
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ [...]
+ 6. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 7. Let specifierString be ToString(specifier).
+ 8. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 9. Let assertions be a new empty List.
+ 10. If options is not undefined, then
+ a. If Type(options) is not Object,
+ [...]
+ b. Let assertionsObj be Get(options, "assert").
+ c. IfAbruptRejectPromise(assertionsObj, promiseCapability).
+ d. If assertionsObj is not undefined,
+ i. If Type(assertionsObj) is not Object,
+ 1. Perform ! Call(promiseCapability.[[Reject]], undefined, « a
+ newly created TypeError object »).
+ 2. Return promiseCapability.[[Promise]].
+ [...]
+features: [dynamic-import, import-assertions, Symbol, BigInt]
+flags: [async]
+---*/
+
+Promise.all([
+ import('./2nd-param_FIXTURE.js', {}),
+ import('./2nd-param_FIXTURE.js', {assert:undefined}),
+ ])
+ .then(function(values) {
+ assert.sameValue(values[0].default, 262);
+ assert.sameValue(values[1].default, 262);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-value-abrupt.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-value-abrupt.js
new file mode 100644
index 0000000000..770cd15f29
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-value-abrupt.js
@@ -0,0 +1,35 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Rejects promise when retrieving a value of the `assert` object produces an
+ abrupt completion
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ [...]
+ 10. If options is not undefined, then
+ [...]
+ d. If assertionsObj is not undefined,
+ [...]
+ ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key).
+ iii. IfAbruptRejectPromise(keys, promiseCapability).
+ iv. Let supportedAssertions be ! HostGetSupportedImportAssertions().
+ v. For each String key of keys,
+ 1. Let value be Get(assertionsObj, key).
+ 2. IfAbruptRejectPromise(value, promiseCapability).
+ [...]
+features: [dynamic-import, import-assertions]
+flags: [async]
+---*/
+
+var thrown = new Test262Error();
+
+import('./2nd-param_FIXTURE.js', {assert:{get ''() { throw thrown; }}})
+ .then(function() {
+ throw new Test262Error('Expected promise to be rejected, but it was fulfilled');
+ }, function(error) {
+ assert.sameValue(error, thrown);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-value-non-string.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-value-non-string.js
new file mode 100644
index 0000000000..ab8c3a93de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-assert-value-non-string.js
@@ -0,0 +1,48 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Rejects promise when any property of the `assert` object is not a string
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ [...]
+ 10. If options is not undefined, then
+ [...]
+ d. If assertionsObj is not undefined,
+ [...]
+ ii. Let keys be EnumerableOwnPropertyNames(assertionsObj, key).
+ iii. IfAbruptRejectPromise(keys, promiseCapability).
+ iv. Let supportedAssertions be ! HostGetSupportedImportAssertions().
+ v. For each String key of keys,
+ 1. Let value be Get(assertionsObj, key).
+ 2. IfAbruptRejectPromise(value, promiseCapability).
+ 3. If Type(value) is not String, then
+ a. Perform ! Call(promiseCapability.[[Reject]], undefined, « a
+ newly created TypeError object »).
+ b. Return promiseCapability.[[Promise]].
+ [...]
+features: [dynamic-import, import-assertions, Symbol, BigInt]
+flags: [async]
+---*/
+
+function test(promise, valueType) {
+ return promise.then(function() {
+ throw new Test262Error('Promise for ' + valueType + ' was not rejected.');
+ }, function(error) {
+ assert.sameValue(error.constructor, TypeError, valueType);
+ });
+}
+
+Promise.all([
+ test(import('./2nd-param_FIXTURE.js', {assert:{'': undefined}}), 'undefined'),
+ test(import('./2nd-param_FIXTURE.js', {assert:{'': null}}), 'null'),
+ test(import('./2nd-param_FIXTURE.js', {assert:{'': false}}), 'boolean'),
+ test(import('./2nd-param_FIXTURE.js', {assert:{'': 23}}), 'number'),
+ test(import('./2nd-param_FIXTURE.js', {assert:{'': Symbol('')}}), 'symbol'),
+ test(import('./2nd-param_FIXTURE.js', {assert:{'': 23n}}), 'bigint'),
+ test(import('./2nd-param_FIXTURE.js', {assert:{'': {}}}), 'object')
+ ])
+ .then(function() {})
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-await-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-await-expr.js
new file mode 100644
index 0000000000..1a0a3ba58f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-await-expr.js
@@ -0,0 +1,22 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list forwards the Await production parameter - AwaitExpression
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions, async-functions]
+flags: [async]
+---*/
+
+(async function () {
+ return import('./2nd-param_FIXTURE.js', await undefined);
+}())
+ .then(function(module) {
+ assert.sameValue(module.default, 262);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-await-ident.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-await-ident.js
new file mode 100644
index 0000000000..8d1ecfc86e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-await-ident.js
@@ -0,0 +1,22 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list forwards the Await production parameter - IdentifierReference
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions, async-functions]
+flags: [async]
+---*/
+
+function await() {}
+
+import('./2nd-param_FIXTURE.js', await(undefined))
+ .then(function(module) {
+ assert.sameValue(module.default, 262);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-abrupt-return.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-abrupt-return.js
new file mode 100644
index 0000000000..e396f7cb3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-abrupt-return.js
@@ -0,0 +1,33 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Forwards "return" completion when evaluating second parameter
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let specifierRef be the result of evaluating specifierExpression.
+ 3. Let specifier be ? GetValue(specifierRef).
+ 4. If optionsExpression is present, then
+ a. Let optionsRef be the result of evaluating optionsExpression.
+ b. Let options be ? GetValue(optionsRef).
+ [...]
+features: [dynamic-import, import-assertions]
+---*/
+
+var beforeCount = 0;
+var afterCount = 0;
+var iter = function*() {
+ beforeCount += 1, import('', yield), afterCount += 1;
+}();
+
+iter.next();
+var result = iter.return(595);
+
+assert.sameValue(result.done, true);
+assert.sameValue(result.value, 595);
+assert.sameValue(beforeCount, 1);
+assert.sameValue(afterCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-abrupt-throw.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-abrupt-throw.js
new file mode 100644
index 0000000000..bd504dfa43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-abrupt-throw.js
@@ -0,0 +1,32 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Forwards "throw" completion when evaluating second parameter
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let specifierRef be the result of evaluating specifierExpression.
+ 3. Let specifier be ? GetValue(specifierRef).
+ 4. If optionsExpression is present, then
+ a. Let optionsRef be the result of evaluating optionsExpression.
+ b. Let options be ? GetValue(optionsRef).
+ [...]
+features: [dynamic-import, import-assertions]
+---*/
+
+var beforeCount = 0;
+var afterCount = 0;
+function throwError() {
+ throw new Test262Error();
+}
+
+assert.throws(Test262Error, function() {
+ beforeCount += 1, import('', throwError()), afterCount += 1;
+});
+
+assert.sameValue(beforeCount, 1);
+assert.sameValue(afterCount, 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-sequence.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-sequence.js
new file mode 100644
index 0000000000..e6d4f4a33d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-evaluation-sequence.js
@@ -0,0 +1,28 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Evaluates parameters in correct sequence
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let specifierRef be the result of evaluating specifierExpression.
+ 3. Let specifier be ? GetValue(specifierRef).
+ 4. If optionsExpression is present, then
+ a. Let optionsRef be the result of evaluating optionsExpression.
+ b. Let options be ? GetValue(optionsRef).
+ [...]
+features: [dynamic-import, import-assertions]
+---*/
+
+var log = [];
+
+import(log.push('first'), (log.push('second'), undefined))
+ .then(null, function() {});
+
+assert.sameValue(log.length, 2);
+assert.sameValue(log[0], 'first');
+assert.sameValue(log[1], 'second');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-get-assert-error.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-get-assert-error.js
new file mode 100644
index 0000000000..9d3ed7e852
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-get-assert-error.js
@@ -0,0 +1,37 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Rejects promise when accessing "assert" property throws an error
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ [...]
+ 6. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 7. Let specifierString be ToString(specifier).
+ 8. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 9. Let assertions be a new empty List.
+ 10. If options is not undefined, then
+ a. If Type(options) is not Object,
+ [...]
+ b. Let assertionsObj be Get(options, "assert").
+ c. IfAbruptRejectPromise(assertionsObj, promiseCapability).
+ [...]
+features: [dynamic-import, import-assertions]
+flags: [async]
+---*/
+
+var thrown = new Test262Error();
+var options = {
+ get assert() {
+ throw thrown;
+ }
+};
+
+import('./2nd-param_FIXTURE.js', options)
+ .then(function() {
+ throw new Test262Error('Expected an error, but observed no error');
+ }, function(caught) {
+ assert.sameValue(thrown, caught);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-in.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-in.js
new file mode 100644
index 0000000000..1538f2dab5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-in.js
@@ -0,0 +1,23 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: ImportCall parameter list enables the Yield production parameter
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions]
+flags: [async]
+---*/
+
+var promise;
+
+for (promise = import('./2nd-param_FIXTURE.js', 'test262' in {} || undefined); false; ) ;
+
+promise
+ .then(function(module) {
+ assert.sameValue(module.default, 262);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-non-object.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-non-object.js
new file mode 100644
index 0000000000..0dae07a409
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-non-object.js
@@ -0,0 +1,41 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Rejects promise when the second argument is neither undefined nor an object
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ 2.1.1.1 EvaluateImportCall ( specifierExpression [ , optionsExpression ] )
+ [...]
+ 6. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 7. Let specifierString be ToString(specifier).
+ 8. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 9. Let assertions be a new empty List.
+ 10. If options is not undefined, then
+ a. If Type(options) is not Object,
+ i. Perform ! Call(promiseCapability.[[Reject]], undefined, « a newly created TypeError object »).
+ ii. Return promiseCapability.[[Promise]].
+ [...]
+features: [dynamic-import, import-assertions, Symbol, BigInt]
+flags: [async]
+---*/
+
+function test(promise, valueType) {
+ return promise.then(function() {
+ throw new Test262Error('Promise for ' + valueType + ' was not rejected.');
+ }, function(error) {
+ assert.sameValue(error.constructor, TypeError, valueType);
+ });
+}
+
+Promise.all([
+ test(import('./2nd-param_FIXTURE.js', null), 'null'),
+ test(import('./2nd-param_FIXTURE.js', false), 'boolean'),
+ test(import('./2nd-param_FIXTURE.js', 23), 'number'),
+ test(import('./2nd-param_FIXTURE.js', ''), 'string'),
+ test(import('./2nd-param_FIXTURE.js', Symbol('')), 'symbol'),
+ test(import('./2nd-param_FIXTURE.js', 23n), 'bigint')
+ ])
+ .then(function() {})
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-trailing-comma-fulfill.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-trailing-comma-fulfill.js
new file mode 100644
index 0000000000..f1d7256ef9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-trailing-comma-fulfill.js
@@ -0,0 +1,21 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list supports an optional trailing comma (fulfillment
+ semantics)
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions]
+flags: [async]
+---*/
+
+import('./2nd-param_FIXTURE.js', {},)
+ .then(function(module) {
+ assert.sameValue(module.default, 262);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-trailing-comma-reject.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-trailing-comma-reject.js
new file mode 100644
index 0000000000..d4443c9002
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-trailing-comma-reject.js
@@ -0,0 +1,25 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list supports an optional trailing comma (rejection
+ semantics)
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions]
+flags: [async]
+---*/
+
+var thrown = new Test262Error();
+
+import({toString: function() { throw thrown; } }, {},)
+ .then(function() {
+ throw new Test262Error('Expected promise to be rejected, but it was fulfilled.');
+ }, function(caught) {
+ assert.sameValue(thrown, caught);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-expr.js
new file mode 100644
index 0000000000..808a369721
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-expr.js
@@ -0,0 +1,32 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list forwards the Yield production parameter - YieldExpression
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions]
+flags: [async]
+---*/
+
+var promise;
+
+var iter = (function * () {
+ promise = import('./2nd-param_FIXTURE.js', yield);
+}());
+
+iter.next();
+
+assert.sameValue(promise, undefined);
+
+iter.next();
+
+promise
+ .then(function(module) {
+ assert.sameValue(module.default, 262);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-ident-invalid-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-ident-invalid-strict.js
new file mode 100644
index 0000000000..6ddd9c5691
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-ident-invalid-strict.js
@@ -0,0 +1,21 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) error:SyntaxError -- requires shell-options
+'use strict';
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list forwards the Yield production parameter - invalid IdentifierReference
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions]
+flags: [onlyStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+---*/
+$DONOTEVALUATE();
+
+import('./empty_FIXTURE.js', yield);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-ident-valid.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-ident-valid.js
new file mode 100644
index 0000000000..a8a359be03
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param-yield-ident-valid.js
@@ -0,0 +1,22 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list forwards the Yield production parameter - valid IdentifierReference
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions]
+flags: [async, noStrict]
+---*/
+
+var yield;
+
+import('./2nd-param_FIXTURE.js', yield)
+ .then(function(module) {
+ assert.sameValue(module.default, 262);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/2nd-param_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param_FIXTURE.js
new file mode 100644
index 0000000000..9e8a871054
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/2nd-param_FIXTURE.js
@@ -0,0 +1,4 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+export default 262;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/always-create-new-promise.js b/js/src/tests/test262/language/expressions/dynamic-import/always-create-new-promise.js
new file mode 100644
index 0000000000..cb21cda819
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/always-create-new-promise.js
@@ -0,0 +1,36 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall returns a new instance of Promise
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ Import Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+features: [dynamic-import]
+---*/
+
+const p1 = import('./dynamic-import-module_FIXTURE.js');
+const p2 = import('./dynamic-import-module_FIXTURE.js');
+
+assert.notSameValue(p1, p2, 'the returned promises are not the same, regardless the reference and specifier pair');
+
+assert.sameValue(p1.constructor, Promise, 'p1 constructor is %Promise%');
+assert.sameValue(Object.getPrototypeOf(p1), Promise.prototype, 'p1 prototype is %PromisePrototype%');
+
+assert.sameValue(p2.constructor, Promise, 'p2 constructor is %Promise%');
+assert.sameValue(Object.getPrototypeOf(p2), Promise.prototype, 'p2 prototype is %PromisePrototype%');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assign-expr-get-value-abrupt-throws.js b/js/src/tests/test262/language/expressions/dynamic-import/assign-expr-get-value-abrupt-throws.js
new file mode 100644
index 0000000000..905ae09099
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assign-expr-get-value-abrupt-throws.js
@@ -0,0 +1,39 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Return Abrupt from the GetValue evaluation on the given AssignmentExpression
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ Import Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+features: [dynamic-import]
+---*/
+
+const obj = {
+ get err() {
+ throw new Test262Error('catpure this on evaluation')
+ }
+}
+
+assert.throws(Test262Error, function() {
+ import(obj.err);
+}, 'Custom Error getting property value');
+
+assert.throws(ReferenceError, function() {
+ import(refErr);
+}, 'bad reference');
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/additive-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/additive-expr.js
new file mode 100644
index 0000000000..ecc3941d33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/additive-expr.js
@@ -0,0 +1,42 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (Additive Expression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+let x = './module-code';
+let y = './module-code';
+
+const a = '_FIXTURE.js';
+const b = '-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(x + a); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(y + b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/array-literal.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/array-literal.js
new file mode 100644
index 0000000000..27021f2c20
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/array-literal.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (Array Literal)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import([a]); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ Array.prototype.toString = () => b;
+ const ns2 = await import([]); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/arrow-function.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/arrow-function.js
new file mode 100644
index 0000000000..21257df6be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/arrow-function.js
@@ -0,0 +1,33 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (ArrowFunction)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+Function.prototype.toString = () => './module-code_FIXTURE.js';
+
+async function fn() {
+ const ns = await import(() => {}); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns.local1, 'Test262');
+ assert.sameValue(ns.default, 42);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/await-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/await-expr.js
new file mode 100644
index 0000000000..8bb7275fc6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/await-expr.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (AwaitExpression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(await a); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(await b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/await-identifier.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/await-identifier.js
new file mode 100644
index 0000000000..48217172a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/await-identifier.js
@@ -0,0 +1,35 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (IdentifierReference: await)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const await = './module-code_FIXTURE.js';
+
+const getpromise = () => import(await); // import('./module-code_FIXTURE.js')
+
+async function fn() {
+ const ns1 = await getpromise();
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/browser.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/browser.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-arguments.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-arguments.js
new file mode 100644
index 0000000000..480f06a4ae
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-arguments.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (CallExpression Arguments)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = () => () => './module-code_FIXTURE.js';
+const b = () => () => './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(a()()); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(b()()); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-expr.js
new file mode 100644
index 0000000000..95f78fa1bf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-expr.js
@@ -0,0 +1,46 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (CallExpression [ Expression ])
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = () => ['./module-code_FIXTURE.js', './module-code-other_FIXTURE.js'];
+
+async function fn() {
+ const ns1 = await import(a()[0]); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(a()[0, 1]); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-identifier.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-identifier.js
new file mode 100644
index 0000000000..f099a06f36
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/call-expr-identifier.js
@@ -0,0 +1,49 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (CallExpression . IdentifierName)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = () => ({
+ x: './module-code_FIXTURE.js',
+ y: './module-code-other_FIXTURE.js'
+});
+
+async function fn() {
+ const ns1 = await import(a().x); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(a().y); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-call-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-call-expr.js
new file mode 100644
index 0000000000..9b38fb1fe2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-call-expr.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (CoverCallExpressionAndAsyncArrowHeadn)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+
+ CallExpression[Yield, Await]:
+ CoverCallExpressionAndAsyncArrowHead[?Yield, ?Await]
+ SuperCall[?Yield, ?Await]
+ CallExpression[?Yield, ?Await]Arguments[?Yield, ?Await]
+ CallExpression[?Yield, ?Await][Expression[+In, ?Yield, ?Await]]
+ CallExpression[?Yield, ?Await].IdentifierName
+ CallExpression[?Yield, ?Await]TemplateLiteral[?Yield, ?Await, +Tagged]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = () => './module-code_FIXTURE.js';
+const b = () => './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(a()); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(b()); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-parenthesized-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-parenthesized-expr.js
new file mode 100644
index 0000000000..d2c07d2173
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/cover-parenthesized-expr.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (CoverParenthesizedExpressionAndArrowParameterList)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+
+ CoverParenthesizedExpressionAndArrowParameterList[Yield, Await]:
+ (Expression[+In, ?Yield, ?Await])
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+async function fn() {
+ const ns1 = await import((((((('./module-code_FIXTURE.js'))))))); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import((1, 0, './module-code-other_FIXTURE.js')); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/identifier.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/identifier.js
new file mode 100644
index 0000000000..18e738b197
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/identifier.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (Identifier)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(a); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/import-meta.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/import-meta.js
new file mode 100644
index 0000000000..ab8463fc69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/import-meta.js
@@ -0,0 +1,37 @@
+// |reftest| module async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (ImportMeta)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import ( AssignmentExpression )
+
+ ...
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+features: [dynamic-import, import.meta]
+flags: [module, async]
+---*/
+
+const p = import(import.meta);
+
+// We can at least assert p is a promise.
+assert.sameValue(Promise.resolve(p), p, 'Assert that p is a promise');
+
+// The keys of import.meta are implementation defined, but we know its
+// [[Prototype]] is null. In this case, import() should reject the
+// promise it returns, unless a toPrimitive related method is set.
+if (!Object.prototype.hasOwnProperty.call(import.meta, 'toString') &&
+ !Object.prototype.hasOwnProperty.call(import.meta, 'valueOf') &&
+ !Object.prototype.hasOwnProperty.call(import.meta, Symbol.toPrimitive)) {
+ p.catch(error => assert.sameValue(error.constructor, TypeError, 'import() cannot resolve import.meta')).then($DONE, $DONE);
+} else {
+ $DONE();
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-assign-operator-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-assign-operator-assign-expr.js
new file mode 100644
index 0000000000..b6713b5da0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-assign-operator-assign-expr.js
@@ -0,0 +1,42 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (LHS Expr AssignmentOperator AssignmentExpression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+let x = './module-code';
+let y = './module-code';
+
+const a = '_FIXTURE.js';
+const b = '-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(x += a); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(y += b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr-nostrict.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr-nostrict.js
new file mode 100644
index 0000000000..66dd1e3061
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr-nostrict.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (LHS Expr = AssignmentExpression)
+ Using a frozen object property
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async, noStrict]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const y = {
+ z: 0
+};
+Object.freeze(y);
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns2 = await import(y.z = b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr.js
new file mode 100644
index 0000000000..7a961379e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/lhs-eq-assign-expr.js
@@ -0,0 +1,43 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (LHS Expr = AssignmentExpression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+let x = 'foo';
+const y = {
+ z: 0
+};
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(x = a); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(y.z = b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/logical-and-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/logical-and-expr.js
new file mode 100644
index 0000000000..30a3b3babc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/logical-and-expr.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (LogicalANDExpression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(b && a); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ // mix it in with Unary Expressions
+ const ns2 = await import(delete void typeof +-~! 0 && b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/logical-or-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/logical-or-expr.js
new file mode 100644
index 0000000000..c31b41905d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/logical-or-expr.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (LogicalORExpression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(a || b); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(false || b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/member-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/member-expr.js
new file mode 100644
index 0000000000..564c859f97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/member-expr.js
@@ -0,0 +1,43 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (Object properties from MemberExpressions)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const obj = {
+ a: './module-code_FIXTURE.js',
+ b: './module-code-other_FIXTURE.js'
+}
+
+async function fn() {
+ // MemberExpression [ Expression ]
+ const ns1 = await import(obj['a']); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ // MemberExpression . IdentifierName
+ const ns2 = await import(obj.b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/module-code-other_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/module-code-other_FIXTURE.js
new file mode 100644
index 0000000000..81c39fd6e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/module-code-other_FIXTURE.js
@@ -0,0 +1,11 @@
+// |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.
+
+// exports: default === 1612, local1 === 'one six one two', renamed === 'star', indirect === 'one six one two'
+
+export var local1 = 'one six one two';
+var local2 = 'star';
+export { local2 as renamed };
+export { local1 as indirect } from './module-code-other_FIXTURE.js';
+export default 1612;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/module-code_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/module-code_FIXTURE.js
new file mode 100644
index 0000000000..bfe3fbce80
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/module-code_FIXTURE.js
@@ -0,0 +1,11 @@
+// |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.
+
+// exports: default === 42, local1 === 'Test262', renamed === 'TC39', indirect === 'Test262'
+
+export var local1 = 'Test262';
+var local2 = 'TC39';
+export { local2 as renamed };
+export { local1 as indirect } from './module-code_FIXTURE.js';
+export default 42;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/new-target.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/new-target.js
new file mode 100644
index 0000000000..b8464ac074
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/new-target.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (NewTarget)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import, new.target]
+includes: [asyncHelpers.js]
+---*/
+
+function ctor() {
+ return import(new.target); // import('./module-code_FIXTURE.js')
+}
+
+ctor.toString = () => './module-code_FIXTURE.js';
+
+async function fn() {
+ const ns = await new ctor();
+
+ assert.sameValue(ns.local1, 'Test262');
+ assert.sameValue(ns.default, 42);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/object-literal.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/object-literal.js
new file mode 100644
index 0000000000..a51850f9a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/object-literal.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (Object Literal)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import({ toString() { return a; } }); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ Object.prototype.toString = () => b;
+ const ns2 = await import({}); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/shell.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/shell.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/tagged-function-call.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/tagged-function-call.js
new file mode 100644
index 0000000000..f3692389f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/tagged-function-call.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (MemberExpression TemplateLiteral)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+function tag(arg) {
+ return arg[0];
+}
+
+async function fn() {
+ // MemberExpression TemplateLiteral
+ const ns = await import(tag`./module-code-other_FIXTURE.js`); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns.local1, 'one six one two');
+ assert.sameValue(ns.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/ternary.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/ternary.js
new file mode 100644
index 0000000000..e290379d5e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/ternary.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (Ternary)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(true ? a : b); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ const ns2 = await import(false ? a : b); // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/this.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/this.js
new file mode 100644
index 0000000000..2839a9858c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/this.js
@@ -0,0 +1,33 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (this)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+
+ PrimaryExpression[Yield, Await]:
+ this
+flags: [async]
+features: [dynamic-import]
+---*/
+
+async function fn() {
+ const ns1 = await import(this); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+}
+
+fn.call('./module-code_FIXTURE.js').then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/unary-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/unary-expr.js
new file mode 100644
index 0000000000..88aa3dbcb5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/unary-expr.js
@@ -0,0 +1,34 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (UnaryExpressions)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+features: [dynamic-import]
+---*/
+
+const obj = {
+ prop: 42
+};
+
+import(delete obj.prop);
+import(void 0);
+import(typeof {});
+import(+void 0);
+import(-void 0);
+import(!void 0);
+import(~void 0);
+import(delete void typeof +-~! 0);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-assign-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-assign-expr.js
new file mode 100644
index 0000000000..b691719701
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-assign-expr.js
@@ -0,0 +1,49 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (yield [no LineTerminator here] AssignmentExpression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+function *g() {
+ return import(yield 42);
+}
+
+async function fn() {
+ let iter = g();
+ assert.sameValue(iter.next().value, 42);
+
+ const ns1 = await iter.next(a).value; // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ iter = g();
+ assert.sameValue(iter.next().value, 42);
+
+ const ns2 = await iter.next(b).value; // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-expr.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-expr.js
new file mode 100644
index 0000000000..913ff22807
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-expr.js
@@ -0,0 +1,49 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (YieldExpression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const a = './module-code_FIXTURE.js';
+const b = './module-code-other_FIXTURE.js';
+
+function *g() {
+ return import(yield);
+}
+
+async function fn() {
+ let iter = g();
+ iter.next();
+
+ const ns1 = await iter.next(a).value; // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+
+ iter = g();
+ iter.next();
+
+ const ns2 = await iter.next(b).value; // import('./module-code-other_FIXTURE.js')
+
+ assert.sameValue(ns2.local1, 'one six one two');
+ assert.sameValue(ns2.default, 1612);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-identifier.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-identifier.js
new file mode 100644
index 0000000000..e917bd1705
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-identifier.js
@@ -0,0 +1,33 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (IdentifierReference: yield)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+flags: [async, noStrict]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+const yield = './module-code_FIXTURE.js';
+
+async function fn() {
+ const ns1 = await import(yield); // import('./module-code_FIXTURE.js')
+
+ assert.sameValue(ns1.local1, 'Test262');
+ assert.sameValue(ns1.default, 42);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-star.js b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-star.js
new file mode 100644
index 0000000000..8fba54b388
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/assignment-expression/yield-star.js
@@ -0,0 +1,26 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import receives an AssignmentExpression (yield [no LineTerminator here] AssignmentExpression)
+esid: prod-ImportCall
+info: |
+ ImportCall [Yield]:
+ import ( AssignmentExpression[+In, ?Yield] )
+
+ AssignmentExpression[In, Yield, Await]:
+ ConditionalExpression[?In, ?Yield, ?Await]
+ [+Yield]YieldExpression[?In, ?Await]
+ ArrowFunction[?In, ?Yield, ?Await]
+ AsyncArrowFunction[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] = AssignmentExpression[?In, ?Yield, ?Await]
+ LeftHandSideExpression[?Yield, ?Await] AssignmentOperator AssignmentExpression[?In, ?Yield, ?Await]
+features: [dynamic-import]
+---*/
+
+// Asserts valid syntax, return is not asserted for the undefined value of yield *
+function *g() {
+ import(yield * ['Roberta Flack', 'Donny Hathaway', 'Frank Sinatra']);
+}
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/await-import-evaluation.js b/js/src/tests/test262/language/expressions/dynamic-import/await-import-evaluation.js
new file mode 100644
index 0000000000..9507b313e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/await-import-evaluation.js
@@ -0,0 +1,25 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import should await for evaluation
+esid: sec-finishdynamicimport
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 2. Otherwise,
+ a. Assert: completion is a normal completion and completion.[[Value]] is undefined.
+ b. Let moduleRecord be ! HostResolveImportedModule(referencingScriptOrModule, specifier).
+ c. Assert: Evaluate has already been invoked on moduleRecord and successfully completed.
+flags: [async]
+features: [dynamic-import]
+---*/
+
+var startTime = Date.now();
+
+import('./await-import-evaluation_FIXTURE.js').then(imported => {
+ var endTime = Date.now() - startTime;
+ assert(imported.time > 100, `${String(imported.time)} > 100`);
+ assert(imported.time <= endTime, `${String(imported.time)} > ${String(endTime)}`);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/await-import-evaluation_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/await-import-evaluation_FIXTURE.js
new file mode 100644
index 0000000000..32c76261d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/await-import-evaluation_FIXTURE.js
@@ -0,0 +1,15 @@
+// |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.
+
+var startTime = Date.now();
+var endTime;
+
+export { endTime as time }
+
+while (true) {
+ endTime = Date.now() - startTime;
+ if (endTime > 100) {
+ break;
+ }
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/browser.js b/js/src/tests/test262/language/expressions/dynamic-import/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/browser.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/browser.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/browser.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/eval-rqstd-abrupt-err-type_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/eval-rqstd-abrupt-err-type_FIXTURE.js
new file mode 100644
index 0000000000..ed8e35d49b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/eval-rqstd-abrupt-err-type_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+throw new TypeError();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/eval-rqstd-abrupt-err-uri_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/eval-rqstd-abrupt-err-uri_FIXTURE.js
new file mode 100644
index 0000000000..56f5cc162b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/eval-rqstd-abrupt-err-uri_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+throw new URIError();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-1_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-1_FIXTURE.js
new file mode 100644
index 0000000000..6a4a7279cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-1_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export var x;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-2_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-2_FIXTURE.js
new file mode 100644
index 0000000000..6a4a7279cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-2_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export var x;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-export_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-export_FIXTURE.js
new file mode 100644
index 0000000000..db2aa324e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous-export_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export { x } from './instn-iee-err-ambiguous_FIXTURE.js';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous_FIXTURE.js
new file mode 100644
index 0000000000..4b3b26c4af
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-ambiguous_FIXTURE.js
@@ -0,0 +1,6 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export * from './instn-iee-err-ambiguous-1_FIXTURE.js';
+export * from './instn-iee-err-ambiguous-2_FIXTURE.js';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-circular-1_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-circular-1_FIXTURE.js
new file mode 100644
index 0000000000..a0c1522359
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-circular-1_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export { x } from './instn-iee-err-circular-2_FIXTURE.js';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-circular-2_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-circular-2_FIXTURE.js
new file mode 100644
index 0000000000..984fd64bcb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/instn-iee-err-circular-2_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export { x } from './instn-iee-err-circular-1_FIXTURE.js';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..b0f6177951
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-arrow.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+let f = () => {
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+};
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..3234fceb45
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-arrow.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+let f = () => {
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+};
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-script-code-target.js
new file mode 100644
index 0000000000..0451ba56c1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-eval-script-code-target.js
@@ -0,0 +1,43 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-arrow.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+let f = () => {
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-file-does-not-exist.js
new file mode 100644
index 0000000000..d4c322bf71
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-file-does-not-exist.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-arrow.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+let f = () => {
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+};
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..4f579cbc9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-arrow.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+let f = () => {
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-circular.js
new file mode 100644
index 0000000000..fe92fa68dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-instn-iee-err-circular.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-arrow.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+let f = () => {
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..a96320514f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-arrow-import-catch-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-arrow.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+let f = () => {
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+};
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..0e848bb81d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+const f = async () => {
+ await import('./eval-rqstd-abrupt-err-type_FIXTURE.js');
+}
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..ed6a5e15e4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+const f = async () => {
+ await import('./eval-rqstd-abrupt-err-uri_FIXTURE.js');
+}
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-script-code-target.js
new file mode 100644
index 0000000000..82bc91c42b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-eval-script-code-target.js
@@ -0,0 +1,43 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-await.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+const f = async () => {
+ await import('./script-code_FIXTURE.js');
+}
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-file-does-not-exist.js
new file mode 100644
index 0000000000..ce2ed961e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-file-does-not-exist.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-await.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+const f = async () => {
+ await import('./THIS_FILE_DOES_NOT_EXIST.js');
+}
+
+f().catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..07243b7223
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-await.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+const f = async () => {
+ await import('./instn-iee-err-ambiguous-export_FIXTURE.js');
+}
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-circular.js
new file mode 100644
index 0000000000..3b9cc2e39d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-instn-iee-err-circular.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-await.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+const f = async () => {
+ await import('./instn-iee-err-circular-1_FIXTURE.js');
+}
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..378de8edc2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-await.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+const f = async () => {
+ await import(obj);
+}
+
+f().catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..d0aafad8cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-return-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+const f = async () => await import('./eval-rqstd-abrupt-err-type_FIXTURE.js');
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..ad5ecfe175
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-return-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+const f = async () => await import('./eval-rqstd-abrupt-err-uri_FIXTURE.js');
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-script-code-target.js
new file mode 100644
index 0000000000..8ad97b66a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-eval-script-code-target.js
@@ -0,0 +1,41 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-return-await.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+const f = async () => await import('./script-code_FIXTURE.js');
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-file-does-not-exist.js
new file mode 100644
index 0000000000..7219ab9846
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-file-does-not-exist.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-return-await.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+const f = async () => await import('./THIS_FILE_DOES_NOT_EXIST.js');
+
+f().catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..249b4f22a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-return-await.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+const f = async () => await import('./instn-iee-err-ambiguous-export_FIXTURE.js');
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-circular.js
new file mode 100644
index 0000000000..a4f2124c39
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-instn-iee-err-circular.js
@@ -0,0 +1,49 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-return-await.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+const f = async () => await import('./instn-iee-err-circular-1_FIXTURE.js');
+
+f().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..1d197ee9ce
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-async-arrow-fn-return-await.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+const f = async () => await import(obj);
+
+f().catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..e2d753e26f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-async-function-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function f() {
+ await import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..3c71efd02d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-async-function-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function f() {
+ await import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-script-code-target.js
new file mode 100644
index 0000000000..52c8b083dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-eval-script-code-target.js
@@ -0,0 +1,43 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-async-function-await.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+async function f() {
+ await import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-file-does-not-exist.js
new file mode 100644
index 0000000000..4dd1dfa128
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-file-does-not-exist.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-async-function-await.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+async function f() {
+ await import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..34f41a7145
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-async-function-await.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+async function f() {
+ await import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-instn-iee-err-circular.js
new file mode 100644
index 0000000000..b052a1b151
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-instn-iee-err-circular.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-async-function-await.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+async function f() {
+ await import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..25bee5f54d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-await-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-async-function-await.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+async function f() {
+ await import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..772ed642ad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,42 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-async-function.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function f() {
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..a6fc8ba9c0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,42 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-async-function.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function f() {
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-script-code-target.js
new file mode 100644
index 0000000000..19108654b5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-eval-script-code-target.js
@@ -0,0 +1,44 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-async-function.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+async function f() {
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-file-does-not-exist.js
new file mode 100644
index 0000000000..807fbb1bd4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-file-does-not-exist.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-async-function.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+async function f() {
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+}
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..1546e84bac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,63 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-async-function.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+async function f() {
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-instn-iee-err-circular.js
new file mode 100644
index 0000000000..332d182703
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-instn-iee-err-circular.js
@@ -0,0 +1,52 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-async-function.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+async function f() {
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..0fc9a06e02
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-async-function-return-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function f() {
+ return await import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..d06b257cec
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-async-function-return-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function f() {
+ return await import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-script-code-target.js
new file mode 100644
index 0000000000..b525c8f46f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-eval-script-code-target.js
@@ -0,0 +1,43 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-async-function-return-await.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+async function f() {
+ return await import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-file-does-not-exist.js
new file mode 100644
index 0000000000..bbb84657a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-file-does-not-exist.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-async-function-return-await.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+async function f() {
+ return await import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..c3dde0e636
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-async-function-return-await.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+async function f() {
+ return await import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-instn-iee-err-circular.js
new file mode 100644
index 0000000000..78092b90ea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-instn-iee-err-circular.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-async-function-return-await.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+async function f() {
+ return await import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..d0d178de56
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-return-await-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-async-function-return-await.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+async function f() {
+ return await import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..b483e9b870
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-function-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,57 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-async-function.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+async function f() {
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+}
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..6356057cbf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-async-generator-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function * f() {
+ await import('./eval-rqstd-abrupt-err-type_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..6eb4f99317
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-async-generator-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function * f() {
+ await import('./eval-rqstd-abrupt-err-uri_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-script-code-target.js
new file mode 100644
index 0000000000..f915824639
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-eval-script-code-target.js
@@ -0,0 +1,43 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-async-generator-await.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+async function * f() {
+ await import('./script-code_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-file-does-not-exist.js
new file mode 100644
index 0000000000..615b9c9dde
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-file-does-not-exist.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-async-generator-await.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+async function * f() {
+ await import('./THIS_FILE_DOES_NOT_EXIST.js');
+}
+
+f().next().catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..40ef9d67b0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-async-generator-await.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+async function * f() {
+ await import('./instn-iee-err-ambiguous-export_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-instn-iee-err-circular.js
new file mode 100644
index 0000000000..6ef0121e9b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-instn-iee-err-circular.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-async-generator-await.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+async function * f() {
+ await import('./instn-iee-err-circular-1_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..e375828ab0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-await-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-async-generator-await.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+async function * f() {
+ await import(obj);
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..cb69156522
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-async-generator-return-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function * f() {
+ return await import('./eval-rqstd-abrupt-err-type_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..c0357f7fd6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-async-generator-return-await.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+async function * f() {
+ return await import('./eval-rqstd-abrupt-err-uri_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-script-code-target.js
new file mode 100644
index 0000000000..e06101ffc1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-eval-script-code-target.js
@@ -0,0 +1,43 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-async-generator-return-await.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+async function * f() {
+ return await import('./script-code_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-file-does-not-exist.js
new file mode 100644
index 0000000000..a94d18c02d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-file-does-not-exist.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-async-generator-return-await.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+async function * f() {
+ return await import('./THIS_FILE_DOES_NOT_EXIST.js');
+}
+
+f().next().catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..3e28f5556a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-async-generator-return-await.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+async function * f() {
+ return await import('./instn-iee-err-ambiguous-export_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-instn-iee-err-circular.js
new file mode 100644
index 0000000000..2aac8ada71
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-instn-iee-err-circular.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-async-generator-return-await.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+async function * f() {
+ return await import('./instn-iee-err-circular-1_FIXTURE.js');
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..0a4160e729
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-async-gen-return-await-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-async-generator-return-await.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+async function * f() {
+ return await import(obj);
+}
+
+f().next().catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..ebed848018
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-block.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+{
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..1e60bdc385
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-block.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+{
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-script-code-target.js
new file mode 100644
index 0000000000..c97ad71414
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-eval-script-code-target.js
@@ -0,0 +1,41 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-block.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+{
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-file-does-not-exist.js
new file mode 100644
index 0000000000..ce3bb80386
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-file-does-not-exist.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-block.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+{
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..dafbbf979e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-block.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+{
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-instn-iee-err-circular.js
new file mode 100644
index 0000000000..4c73ba1327
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-instn-iee-err-circular.js
@@ -0,0 +1,49 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-block.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+{
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..4932a6e510
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-import-catch-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-block.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+{
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..62070c7c50
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-block-labeled.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+label: {
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..d99ea40d60
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-block-labeled.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+label: {
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-script-code-target.js
new file mode 100644
index 0000000000..666ad40630
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-eval-script-code-target.js
@@ -0,0 +1,41 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-block-labeled.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+label: {
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-file-does-not-exist.js
new file mode 100644
index 0000000000..e870fd8641
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-file-does-not-exist.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-block-labeled.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+label: {
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..5de4d7527f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-block-labeled.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+label: {
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-instn-iee-err-circular.js
new file mode 100644
index 0000000000..a76501b2ac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-instn-iee-err-circular.js
@@ -0,0 +1,49 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-block-labeled.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+label: {
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..ad5f8ef163
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-block-labeled-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-block-labeled.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+label: {
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..5edafcabf0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-do-while.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+do {
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..e6f597abfd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-do-while.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+do {
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-script-code-target.js
new file mode 100644
index 0000000000..f57015fa52
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-eval-script-code-target.js
@@ -0,0 +1,41 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-do-while.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+do {
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-file-does-not-exist.js
new file mode 100644
index 0000000000..296dd49280
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-file-does-not-exist.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-do-while.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+do {
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..8f3ba9df14
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-do-while.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+do {
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-instn-iee-err-circular.js
new file mode 100644
index 0000000000..cc7e7c0f03
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-instn-iee-err-circular.js
@@ -0,0 +1,49 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-do-while.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+do {
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..7313d3e107
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-do-while-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-do-while.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+do {
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..e38c896c26
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-else.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+if (false) {
+
+} else {
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..d38be82e7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-else.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+if (false) {
+
+} else {
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-script-code-target.js
new file mode 100644
index 0000000000..05788278f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-eval-script-code-target.js
@@ -0,0 +1,43 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-else.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+if (false) {
+
+} else {
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-file-does-not-exist.js
new file mode 100644
index 0000000000..99f4582851
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-file-does-not-exist.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-else.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+if (false) {
+
+} else {
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..45b867507e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-else.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+if (false) {
+
+} else {
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-instn-iee-err-circular.js
new file mode 100644
index 0000000000..64340639f8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-instn-iee-err-circular.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-else.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+if (false) {
+
+} else {
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..406fb4d763
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-else-import-catch-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-else.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+if (false) {
+
+} else {
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..6587cf5b0e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-function.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+function f() {
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..58e75bdbe4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-function.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+function f() {
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-script-code-target.js
new file mode 100644
index 0000000000..f9e58e6991
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-eval-script-code-target.js
@@ -0,0 +1,42 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-function.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+function f() {
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-file-does-not-exist.js
new file mode 100644
index 0000000000..c04bd34a90
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-file-does-not-exist.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-function.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+function f() {
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..8adaac6bea
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,61 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-function.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+function f() {
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-instn-iee-err-circular.js
new file mode 100644
index 0000000000..f91d576cbf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-instn-iee-err-circular.js
@@ -0,0 +1,50 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-function.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+function f() {
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..2ce2fe3e9f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-function-import-catch-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-function.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+function f() {
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..70d5a15208
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-if.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+if (true) {
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..27a1d8571a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-if.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+if (true) {
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-script-code-target.js
new file mode 100644
index 0000000000..fdd51266f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-eval-script-code-target.js
@@ -0,0 +1,41 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-if.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+if (true) {
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-file-does-not-exist.js
new file mode 100644
index 0000000000..a1e79038a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-file-does-not-exist.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-if.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+if (true) {
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..56eb24bd8c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-if.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+if (true) {
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-instn-iee-err-circular.js
new file mode 100644
index 0000000000..ae24b1cd67
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-instn-iee-err-circular.js
@@ -0,0 +1,49 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-if.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+if (true) {
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..15218afc1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-if-import-catch-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-if.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+if (true) {
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..d46eca3903
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/nested-while.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..455b8cfafd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/nested-while.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-script-code-target.js
new file mode 100644
index 0000000000..3c116c4202
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-eval-script-code-target.js
@@ -0,0 +1,43 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/nested-while.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-file-does-not-exist.js
new file mode 100644
index 0000000000..d5ec851522
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-file-does-not-exist.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/nested-while.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..bf64ab4f8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,62 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/nested-while.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-instn-iee-err-circular.js
new file mode 100644
index 0000000000..83dc5da77a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-instn-iee-err-circular.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/nested-while.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..e0355edb92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/nested-while-import-catch-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/nested-while.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+let x = 0;
+while (!x) {
+ x++;
+ import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+ }).then($DONE, $DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/script-code_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/script-code_FIXTURE.js
new file mode 100644
index 0000000000..bc7ce2680e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/script-code_FIXTURE.js
@@ -0,0 +1,8 @@
+// |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.
+
+// This is still valid in script code and strict and non strict modes
+// This is invalid as module code
+// https://tc39.github.io/ecma262/#sec-scripts-static-semantics-lexicallydeclarednames
+var smoosh; function smoosh() {}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/shell.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/shell.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-rqstd-abrupt-typeerror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-rqstd-abrupt-typeerror.js
new file mode 100644
index 0000000000..3686644674
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-rqstd-abrupt-typeerror.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case
+// - src/dynamic-import/catch/top-level.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'TypeError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-rqstd-abrupt-urierror.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-rqstd-abrupt-urierror.js
new file mode 100644
index 0000000000..e755d45539
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-rqstd-abrupt-urierror.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-rqstd-abrupt-urierror.case
+// - src/dynamic-import/catch/top-level.template
+/*---
+description: Abrupt completion during module evaluation precludes further evaluation (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 6. For each String required that is an element of
+ module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+
+---*/
+
+import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'URIError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-script-code-target.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-script-code-target.js
new file mode 100644
index 0000000000..20ecc5b859
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-eval-script-code-target.js
@@ -0,0 +1,39 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-target.case
+// - src/dynamic-import/catch/top-level.template
+/*---
+description: import() from a module code can load a file with script code, but the target is resolved into a Module Record (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, module, async]
+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]].
+
+
+ Modules
+
+ Static Semantics: Early Errors
+
+ ModuleBody : ModuleItemList
+ - It is a Syntax Error if the LexicallyDeclaredNames of ModuleItemList containsany duplicate entries.
+ - It is a Syntax Error if any element of the LexicallyDeclaredNames of ModuleItemList also occurs in the VarDeclaredNames of ModuleItemList.
+
+---*/
+
+import('./script-code_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-file-does-not-exist.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-file-does-not-exist.js
new file mode 100644
index 0000000000..d0f89294d8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-file-does-not-exist.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/file-does-not-exist.case
+// - src/dynamic-import/catch/top-level.template
+/*---
+description: Non existent file can't resolve to a Script or Module Record (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 a Module Record corresponding to the pair referencingModulereferencingScriptOrModule,
+ specifier does not exist or cannot be created, an exception must be thrown.
+
+---*/
+
+import('./THIS_FILE_DOES_NOT_EXIST.js').catch(error => {
+
+ assert.notSameValue(typeof error, 'undefined');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-instn-iee-err-ambiguous-import.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-instn-iee-err-ambiguous-import.js
new file mode 100644
index 0000000000..ae26f2534e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-instn-iee-err-ambiguous-import.js
@@ -0,0 +1,58 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-ambiguous-import.case
+// - src/dynamic-import/catch/top-level.template
+/*---
+description: IndirectExportEntries validation - ambiguous imported bindings (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 9. Let starResolution be null.
+ 10. For each ExportEntry Record e in module.[[StarExportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ e.[[ModuleRequest]]).
+ b. Let resolution be ? importedModule.ResolveExport(exportName,
+ resolveSet, exportStarSet).
+ c. If resolution is "ambiguous", return "ambiguous".
+ d. If resolution is not null, then
+ i. If starResolution is null, let starResolution be resolution.
+ ii. Else,
+ 1. Assert: there is more than one * import that includes the
+ requested name.
+ 2. If resolution.[[Module]] and starResolution.[[Module]] are
+ not the same Module Record or
+ SameValue(resolution.[[BindingName]],
+ starResolution.[[BindingName]]) is false, return "ambiguous".
+
+---*/
+
+import('./instn-iee-err-ambiguous-export_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-instn-iee-err-circular.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-instn-iee-err-circular.js
new file mode 100644
index 0000000000..9e57a9a87e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-instn-iee-err-circular.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/instn-iee-err-circular.case
+// - src/dynamic-import/catch/top-level.template
+/*---
+description: IndirectExportEntries validation - circular imported bindings (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ [...]
+ 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do
+ a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »).
+ b. If resolution is null or resolution is "ambiguous", throw a
+ SyntaxError exception.
+ [...]
+
+ 15.2.1.16.3 ResolveExport
+
+ [...]
+ 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do:
+ a. If module and r.[[Module]] are the same Module Record and
+ SameValue(exportName, r.[[ExportName]]) is true, then
+ i. Assert: this is a circular import request.
+ ii. Return null.
+
+---*/
+
+import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => {
+
+ assert.sameValue(error.name, 'SyntaxError');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-specifier-tostring-abrupt-rejects.js b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-specifier-tostring-abrupt-rejects.js
new file mode 100644
index 0000000000..2d32b6fa09
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/catch/top-level-import-catch-specifier-tostring-abrupt-rejects.js
@@ -0,0 +1,52 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring-abrupt-rejects.case
+// - src/dynamic-import/catch/top-level.template
+/*---
+description: Abrupt from ToString(specifier) rejects the promise (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+const obj = {
+ toString() {
+ throw 'custom error';
+ }
+};
+
+
+import(obj).catch(error => {
+
+ assert.sameValue(error, 'custom error');
+
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/custom-primitive.js b/js/src/tests/test262/language/expressions/dynamic-import/custom-primitive.js
new file mode 100644
index 0000000000..50a2f6adf9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/custom-primitive.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Import a custom toString and valueOf bindings
+esid: sec-finishdynamicimport
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 2. Otherwise,
+ a. Assert: completion is a normal completion and completion.[[Value]] is undefined.
+ b. Let moduleRecord be ! HostResolveImportedModule(referencingScriptOrModule, specifier).
+ c. Assert: Evaluate has already been invoked on moduleRecord and successfully completed.
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ ...
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+async function fn() {
+ const str = await import('./custom-tostring_FIXTURE.js');
+ const value = await import('./custom-valueof_FIXTURE.js');
+
+ assert.sameValue(String(str), '1612', 'namespace uses the imported toString');
+ assert.sameValue(Number(str), 1612, 'namespace fallsback to toString as its prototype is null');
+
+ assert.sameValue(Number(value), 42, 'namespace uses the imported valueOf');
+ assert.sameValue(String(value), '42', 'namespace fallsback to valueOf as its prototype is null');
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/custom-tostring_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/custom-tostring_FIXTURE.js
new file mode 100644
index 0000000000..52b880b6d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/custom-tostring_FIXTURE.js
@@ -0,0 +1,7 @@
+// |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.
+
+export function toString() {
+ return '1612';
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/custom-valueof_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/custom-valueof_FIXTURE.js
new file mode 100644
index 0000000000..cb4b8689a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/custom-valueof_FIXTURE.js
@@ -0,0 +1,7 @@
+// |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.
+
+export function valueOf() {
+ return 42;
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/dynamic-import-module_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/dynamic-import-module_FIXTURE.js
new file mode 100644
index 0000000000..fe34b3bfee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/dynamic-import-module_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export var x = 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/empty_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/empty_FIXTURE.js
new file mode 100644
index 0000000000..9200e13455
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/empty_FIXTURE.js
@@ -0,0 +1,3 @@
+// |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.
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/escape-sequence-import.js b/js/src/tests/test262/language/expressions/dynamic-import/escape-sequence-import.js
new file mode 100644
index 0000000000..8ea95c112c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/escape-sequence-import.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// Copyright (C) 2018 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-left-hand-side-expressions
+description: >
+ "import" must not contain escape sequences.
+info: |
+ 5.1.5 Grammar Notation
+
+ Terminal symbols are shown in fixed width
+ font, both in the productions of the grammars and throughout this specification whenever the
+ text directly refers to such a terminal symbol. These are to appear in a script exactly as
+ written. All terminal symbol code points specified in this way are to be understood as the
+ appropriate Unicode code points from the Basic Latin range, as opposed to any similar-looking
+ code points from other Unicode ranges.
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ ImportCall :
+ import( AssignmentExpression )
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+im\u0070ort('./empty_FIXTURE.js');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-anon.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-anon.js
new file mode 100644
index 0000000000..13775daf88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-anon.js
@@ -0,0 +1,37 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default "anonymous" class declaration is correctly initialized upon
+ evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default ClassDeclaration
+
+ [...]
+ 3. Let className be the sole element of BoundNames of ClassDeclaration.
+ 4. If className is "*default*", then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ c. Let env be the running execution context's LexicalEnvironment.
+ d. Perform ? InitializeBoundName("*default*", value, env).
+ 5. Return NormalCompletion(empty).
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+export default class { valueOf() { return 45; } }
+import('./eval-export-dflt-cls-anon.js').then(imported => {
+ assert.sameValue(new imported.default().valueOf(), 45, 'binding initialized');
+ assert.sameValue(imported.default.name, 'default', 'correct name is assigned');
+}).then($DONE, $DONE).catch($DONE);
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-name-meth.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-name-meth.js
new file mode 100644
index 0000000000..00d19d983f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-name-meth.js
@@ -0,0 +1,35 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default "anonymous" class declaration containing a static `name` method is
+ correctly initialized upon evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default ClassDeclaration
+
+ [...]
+ 3. Let className be the sole element of BoundNames of ClassDeclaration.
+ 4. If className is "*default*", then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ c. Let env be the running execution context's LexicalEnvironment.
+ d. Perform ? InitializeBoundName("*default*", value, env).
+ 5. Return NormalCompletion(empty).
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+export default class { static name() { return 'name method'; } }
+import('./eval-export-dflt-cls-name-meth.js').then(imported => {
+ assert.sameValue(imported.default.name(), 'name method', '`name` property is not over-written');
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-named.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-named.js
new file mode 100644
index 0000000000..28d4a15710
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-cls-named.js
@@ -0,0 +1,37 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default "named" class declaration is correctly initialized upon
+ evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default ClassDeclaration
+
+ [...]
+ 3. Let className be the sole element of BoundNames of ClassDeclaration.
+ 4. If className is "*default*", then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ c. Let env be the running execution context's LexicalEnvironment.
+ d. Perform ? InitializeBoundName("*default*", value, env).
+ 5. Return NormalCompletion(empty).
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+export default class cName { valueOf() { return 45; } }
+import('./eval-export-dflt-cls-named.js').then(imported => {
+ assert.sameValue(new imported.default().valueOf(), 45, 'binding initialized');
+ assert.sameValue(imported.default.name, 'cName', 'correct name is assigned');
+}).then($DONE, $DONE).catch($DONE);
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-anon.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-anon.js
new file mode 100644
index 0000000000..708b9ebf8d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-anon.js
@@ -0,0 +1,35 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default AssignmentExpression (which can be recognized as an "anonymous"
+ class declaration) is correctly initialized upon evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default AssignmentExpression;
+
+ [...]
+ 3. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ 4. Let env be the running execution context's LexicalEnvironment.
+ 5. Perform ? InitializeBoundName("*default*", value, env).
+ [...]
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+export default (class { valueOf() { return 45; } });
+import('./eval-export-dflt-expr-cls-anon.js').then(imported => {
+ assert.sameValue(new imported.default().valueOf(), 45, 'binding initialized');
+ assert.sameValue(imported.default.name, 'default', 'correct name is assigned');
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-name-meth.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-name-meth.js
new file mode 100644
index 0000000000..9f767d1406
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-name-meth.js
@@ -0,0 +1,36 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default AssignmentExpression (which can be recognized as an "anonymous"
+ class declaration with a static `name` method) is correctly initialized
+ upon evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default ClassDeclaration
+
+ [...]
+ 3. Let className be the sole element of BoundNames of ClassDeclaration.
+ 4. If className is "*default*", then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ c. Let env be the running execution context's LexicalEnvironment.
+ d. Perform ? InitializeBoundName("*default*", value, env).
+ 5. Return NormalCompletion(empty).
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+export default (class { static name() { return 'name method'; } });
+import('./eval-export-dflt-expr-cls-name-meth.js').then(imported => {
+ assert.sameValue(imported.default.name(), 'name method', '`name` property is not over-written');
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-named.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-named.js
new file mode 100644
index 0000000000..c846aa18f3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-cls-named.js
@@ -0,0 +1,35 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default AssignmentExpression (which can be recognized as a "named" class
+ declaration) is correctly initialized upon evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default AssignmentExpression;
+
+ [...]
+ 3. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ 4. Let env be the running execution context's LexicalEnvironment.
+ 5. Perform ? InitializeBoundName("*default*", value, env).
+ [...]
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+export default (class cName { valueOf() { return 45; } });
+import('./eval-export-dflt-expr-cls-named.js').then(imported => {
+ assert.sameValue(new imported.default().valueOf(), 45, 'binding initialized');
+ assert.sameValue(imported.default.name, 'cName', 'correct name is assigned');
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-fn-anon.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-fn-anon.js
new file mode 100644
index 0000000000..160b99365a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-fn-anon.js
@@ -0,0 +1,35 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default AssignmentExpression (which can be recognized as an "anonymous"
+ function declaration) is correctly initialized upon evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default AssignmentExpression;
+
+ [...]
+ 3. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ 4. Let env be the running execution context's LexicalEnvironment.
+ 5. Perform ? InitializeBoundName("*default*", value, env).
+ [...]
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+export default (function() { return 99; });
+import('./eval-export-dflt-expr-fn-anon.js').then(imported => {
+ assert.sameValue(imported.default(), 99, 'binding initialized');
+ assert.sameValue(imported.default.name, 'default', 'correct name is assigned');
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-fn-named.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-fn-named.js
new file mode 100644
index 0000000000..e1849193e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-fn-named.js
@@ -0,0 +1,35 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default AssignmentExpression (which can be recognized as a "named" function
+ declaration) is correctly initialized upon evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default AssignmentExpression;
+
+ [...]
+ 3. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ 4. Let env be the running execution context's LexicalEnvironment.
+ 5. Perform ? InitializeBoundName("*default*", value, env).
+ [...]
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+export default (function fName() { return 7; });
+import('./eval-export-dflt-expr-fn-named.js').then(imported => {
+ assert.sameValue(imported.default(), 7, 'binding initialized');
+ assert.sameValue(imported.default.name, 'fName', 'correct name is assigned');
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-gen-anon.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-gen-anon.js
new file mode 100644
index 0000000000..eb6fe1de61
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-gen-anon.js
@@ -0,0 +1,36 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default AssignmentExpression (which can be recognized as an "anonymous"
+ generator function declaration) is correctly initialized upon evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default AssignmentExpression;
+
+ [...]
+ 3. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ 4. Let env be the running execution context's LexicalEnvironment.
+ 5. Perform ? InitializeBoundName("*default*", value, env).
+ [...]
+flags: [async, module]
+features: [dynamic-import, generators]
+---*/
+
+export default (function* () { return 24601; });
+import('./eval-export-dflt-expr-gen-anon.js').then(imported => {
+ assert.sameValue(imported.default().next().value, 24601, 'binding initialized');
+ assert.sameValue(imported.default.name, 'default', 'correct name is assigned');
+}).then($DONE, $DONE).catch($DONE);
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-gen-named.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-gen-named.js
new file mode 100644
index 0000000000..52789a0e59
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-gen-named.js
@@ -0,0 +1,35 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Default AssignmentExpression (which can be recognized as a "named"
+ generator function declaration) is correctly initialized upon evaluation
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3.11 Runtime Semantics: Evaluation
+
+ ExportDeclaration : export default AssignmentExpression;
+
+ [...]
+ 3. If IsAnonymousFunctionDefinition(AssignmentExpression) is true, then
+ a. Let hasNameProperty be ? HasOwnProperty(value, "name").
+ b. If hasNameProperty is false, perform SetFunctionName(value,
+ "default").
+ 4. Let env be the running execution context's LexicalEnvironment.
+ 5. Perform ? InitializeBoundName("*default*", value, env).
+ [...]
+flags: [async, module]
+features: [dynamic-import, generators]
+---*/
+
+export default (function* gName() { return 42; });
+import('./eval-export-dflt-expr-gen-named.js').then(imported => {
+ assert.sameValue(imported.default().next().value, 42, 'binding initialized');
+ assert.sameValue(imported.default.name, 'gName', 'correct name is assigned');
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-in.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-in.js
new file mode 100644
index 0000000000..27c559f0fa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-export-dflt-expr-in.js
@@ -0,0 +1,29 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ The `in` operator may occur within an exported AssignmentExpression
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 16. Let result be the result of evaluating module.[[ECMAScriptCode]].
+ [...]
+
+ 15.2.3 Exports
+
+ Syntax
+
+ ExportDeclaration :
+
+ export default [lookahead ∉ { function, class }] AssignmentExpression[In];
+flags: [async, module]
+features: [dynamic-import]
+---*/
+var x = { x: true };
+
+export default 'x' in x;
+import('./eval-export-dflt-expr-in.js').then(imported => {
+ assert.sameValue(imported.default, true);
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-rqstd-once.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-rqstd-once.js
new file mode 100644
index 0000000000..a2893b1f11
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-rqstd-once.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Requested modules are evaluated exactly once
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 4. If module.[[Evaluated]] is true, return undefined.
+ 5. Set module.[[Evaluated]] to true.
+ 6. For each String required that is an element of module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+ [...]
+includes: [fnGlobalObject.js]
+flags: [async]
+features: [dynamic-import]
+---*/
+
+var global = fnGlobalObject();
+
+Promise.all([
+ import('./eval-rqstd-once_FIXTURE.js'),
+ import('./eval-rqstd-once_FIXTURE.js'),
+]).then(async () => {
+ // Use await to serialize imports
+ await import('./eval-rqstd-once_FIXTURE.js');
+ await import('./eval-rqstd-once_FIXTURE.js');
+
+ assert.sameValue(global.test262, 262, 'global property was defined');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-rqstd-once_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-rqstd-once_FIXTURE.js
new file mode 100644
index 0000000000..7a26638e77
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-rqstd-once_FIXTURE.js
@@ -0,0 +1,16 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export default null;
+var global = Function('return this;')();
+
+if (global.test262) {
+ throw new Error('Module was evaluated more than once.');
+}
+
+global.test262 = 262;
+
+if (global.test262 !== 262) {
+ throw new Error('Module was unable to signal evaluation.');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-self-once-module.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-self-once-module.js
new file mode 100644
index 0000000000..b835d36cf7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-self-once-module.js
@@ -0,0 +1,40 @@
+// |reftest| module async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Module is evaluated exactly once
+esid: sec-moduleevaluation
+info: |
+ [...]
+ 4. If module.[[Evaluated]] is true, return undefined.
+ 5. Set module.[[Evaluated]] to true.
+ 6. For each String required that is an element of module.[[RequestedModules]] do,
+ a. Let requiredModule be ? HostResolveImportedModule(module, required).
+ b. Perform ? requiredModule.ModuleEvaluation().
+ [...]
+
+ This test is meant to be flagged as module code, it should not initially
+ run as script code or the result will not be the same.
+includes: [fnGlobalObject.js]
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+var global = fnGlobalObject();
+
+if (typeof global.evaluated === 'undefined') {
+ global.evaluated = 0;
+}
+
+global.evaluated++;
+
+Promise.all([
+ import('./eval-self-once-module.js'),
+ import('./eval-self-once-module.js'),
+]).then(async () => {
+ // Use await to serialize imports
+ await import('./eval-self-once-module.js');
+ await import('./eval-self-once-module.js');
+
+ assert.sameValue(global.evaluated, 1, 'global property was defined and incremented only once');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/eval-self-once-script.js b/js/src/tests/test262/language/expressions/dynamic-import/eval-self-once-script.js
new file mode 100644
index 0000000000..a95c6b6976
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/eval-self-once-script.js
@@ -0,0 +1,44 @@
+// |reftest| async
+// Copyright (C) 2018 Rick Waldron. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Script is evaluated exactly once after loaded by import
+esid: sec-hostimportmoduledynamically
+info: |
+ Success path
+
+ The completion value of any subsequent call to HostResolveImportedModule after
+ FinishDynamicImport has completed, given the arguments referencingScriptOrModule
+ and specifier, must be a module which has already been evaluated, i.e. whose
+ Evaluate concrete method has already been called and returned a normal completion.
+
+ This test is meant to __not__ be flagged as module code, it should not initially
+ run as module code or the result will not be the same.
+includes: [fnGlobalObject.js]
+flags: [async]
+features: [dynamic-import]
+---*/
+
+var global = fnGlobalObject();
+
+var isFirstScript = typeof global.evaluated === 'undefined';
+if (isFirstScript) {
+ global.evaluated = 0;
+}
+
+global.evaluated++;
+
+var p = Promise.all([
+ import('./eval-self-once-script.js'),
+ import('./eval-self-once-script.js'),
+]).then(async () => {
+ // Use await to serialize imports
+ await import('./eval-self-once-script.js');
+ await import('./eval-self-once-script.js');
+
+ assert.sameValue(global.evaluated, 2, 'global property was defined once and incremented twice');
+});
+
+if (isFirstScript) {
+ p.then($DONE, $DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-a_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-a_FIXTURE.js
new file mode 100644
index 0000000000..fd08cf9a4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-a_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.
+
+export var x = 42;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen-yield.js b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen-yield.js
new file mode 100644
index 0000000000..edbb72e683
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen-yield.js
@@ -0,0 +1,71 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Resolve multiple imports through a for await loop in an async generator yielding imports
+esid: sec-finishdynamicimport
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 2. Otherwise,
+ a. Assert: completion is a normal completion and completion.[[Value]] is undefined.
+ b. Let moduleRecord be ! HostResolveImportedModule(referencingScriptOrModule, specifier).
+ c. Assert: Evaluate has already been invoked on moduleRecord and successfully completed.
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ ...
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+flags: [async]
+features: [dynamic-import, async-iteration]
+includes: [asyncHelpers.js]
+---*/
+
+async function * agen1() {
+ yield import('./for-await-resolution-and-error-a_FIXTURE.js');
+ yield import('./for-await-resolution-and-error-b_FIXTURE.js');
+ yield import('./for-await-resolution-and-error-poisoned_FIXTURE.js');
+}
+
+async function * agen2() {
+ yield await import('./for-await-resolution-and-error-a_FIXTURE.js');
+ yield await import('./for-await-resolution-and-error-b_FIXTURE.js');
+ yield await import('./for-await-resolution-and-error-poisoned_FIXTURE.js');
+}
+
+var aiter1 = agen1();
+var aiter2 = agen2();
+
+async function fn() {
+ var a = aiter1.next();
+ var b = aiter1.next();
+ var c = aiter1.next();
+ var d = aiter2.next();
+ var e = aiter2.next();
+ var f = aiter2.next();
+
+ assert.sameValue((await a).value.x, 42, 'a');
+ assert.sameValue((await b).value.x, 39, 'b');
+
+ var error;
+ try {
+ await c;
+ } catch (err) {
+ error = err;
+ }
+
+ assert.sameValue(error, 'foo', 'c');
+
+ assert.sameValue((await d).value.x, 42, 'd');
+ assert.sameValue((await e).value.x, 39, 'e');
+
+ error = null;
+ try {
+ await f;
+ } catch (err) {
+ error = err;
+ }
+
+ assert.sameValue(error, 'foo', 'f');
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen.js b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen.js
new file mode 100644
index 0000000000..7b7c4062a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-agen.js
@@ -0,0 +1,53 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Resolve multiple imports through a for await loop in an async generator
+esid: sec-finishdynamicimport
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 2. Otherwise,
+ a. Assert: completion is a normal completion and completion.[[Value]] is undefined.
+ b. Let moduleRecord be ! HostResolveImportedModule(referencingScriptOrModule, specifier).
+ c. Assert: Evaluate has already been invoked on moduleRecord and successfully completed.
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ ...
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+flags: [async]
+features: [dynamic-import, async-iteration]
+includes: [asyncHelpers.js]
+---*/
+
+async function * agen() {
+ for await (let imported of [
+ import('./for-await-resolution-and-error-a_FIXTURE.js'),
+ import('./for-await-resolution-and-error-b_FIXTURE.js'),
+ import('./for-await-resolution-and-error-poisoned_FIXTURE.js'),
+ ]) {
+ yield imported.x;
+ }
+}
+
+var aiter = agen();
+
+async function fn() {
+ var a = aiter.next();
+ var b = aiter.next();
+ var c = aiter.next();
+
+ assert.sameValue((await a).value, 42);
+ assert.sameValue((await b).value, 39);
+
+ var error;
+ try {
+ await c;
+ } catch (e) {
+ error = e;
+ }
+
+ assert.sameValue(error, 'foo');
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-b_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-b_FIXTURE.js
new file mode 100644
index 0000000000..82afd1390a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-b_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.
+
+export var x = 39;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-poisoned_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-poisoned_FIXTURE.js
new file mode 100644
index 0000000000..df8930c102
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error-poisoned_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.
+
+throw 'foo';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error.js b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error.js
new file mode 100644
index 0000000000..b80bee8ceb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/for-await-resolution-and-error.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Resolve multiple imports through a for await loop
+esid: sec-finishdynamicimport
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 2. Otherwise,
+ a. Assert: completion is a normal completion and completion.[[Value]] is undefined.
+ b. Let moduleRecord be ! HostResolveImportedModule(referencingScriptOrModule, specifier).
+ c. Assert: Evaluate has already been invoked on moduleRecord and successfully completed.
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ ...
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+flags: [async]
+features: [dynamic-import]
+includes: [compareArray.js]
+---*/
+
+let r = [];
+async function aiter() {
+ for await (let imported of [
+ import('./for-await-resolution-and-error-a_FIXTURE.js'),
+ import('./for-await-resolution-and-error-b_FIXTURE.js'),
+ import('./for-await-resolution-and-error-poisoned_FIXTURE.js'),
+ import('./for-await-resolution-and-error-a_FIXTURE.js'), // this should be ignored
+ ]) {
+ r.push(imported.x);
+ }
+}
+
+aiter().then(() => { throw 'The async function should not resolve' }, error => {
+ assert.compareArray(r, [42, 39]);
+ assert.sameValue(error, 'foo');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/imported-self-update.js b/js/src/tests/test262/language/expressions/dynamic-import/imported-self-update.js
new file mode 100644
index 0000000000..3908428dac
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/imported-self-update.js
@@ -0,0 +1,34 @@
+// |reftest| module async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Imported self bindings should update the references
+esid: sec-finishdynamicimport
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 2. Otherwise,
+ a. Assert: completion is a normal completion and completion.[[Value]] is undefined.
+ b. Let moduleRecord be ! HostResolveImportedModule(referencingScriptOrModule, specifier).
+ c. Assert: Evaluate has already been invoked on moduleRecord and successfully completed.
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ ...
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+flags: [async, module]
+features: [dynamic-import]
+---*/
+
+let x = 0;
+export { x, x as y };
+async function fn() {
+ var imported = await import('./imported-self-update.js');
+ assert.sameValue(imported.x, 0, 'original value, direct binding');
+ assert.sameValue(imported.y, 0, 'original value, indirect binding');
+ x = 1;
+ assert.sameValue(imported.x, 1, 'updated value, direct binding');
+ assert.sameValue(imported.y, 1, 'updated value, indirect binding');
+}
+
+// Do not use asyncTest: when self imported, $DONE is not defined, asyncTest will throw
+fn().then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-1_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-1_FIXTURE.js
new file mode 100644
index 0000000000..d444979caa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-1_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.
+
+export default import('./indirect-resolution-2_FIXTURE.js');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-2_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-2_FIXTURE.js
new file mode 100644
index 0000000000..6438084e34
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution-2_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.
+
+export default 42;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution.js b/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution.js
new file mode 100644
index 0000000000..7479c5ab0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/indirect-resolution.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Dynamic Import should resolve another import call
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ Runtime Semantics: Evaluation
+
+ ImportCall : import ( AssignmentExpression )
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+flags: [async]
+features: [dynamic-import]
+---*/
+
+import('./indirect-resolution-1_FIXTURE.js').then(async imported => {
+ assert.sameValue(Promise.resolve(imported.default), imported.default, 'default is Promise instance');
+ assert.sameValue(Object.getPrototypeOf(imported.default), Promise.prototype, 'default proto is Promise.prototype');
+ assert.sameValue(imported.default.constructor, Promise, 'default.constructor is Promise');
+
+ var indirect = await imported.default;
+ assert.sameValue(indirect.default, 42);
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/module-code_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/module-code_FIXTURE.js
new file mode 100644
index 0000000000..bfe3fbce80
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/module-code_FIXTURE.js
@@ -0,0 +1,11 @@
+// |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.
+
+// exports: default === 42, local1 === 'Test262', renamed === 'TC39', indirect === 'Test262'
+
+export var local1 = 'Test262';
+var local2 = 'TC39';
+export { local2 as renamed };
+export { local1 as indirect } from './module-code_FIXTURE.js';
+export default 42;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-Symbol-toStringTag.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-Symbol-toStringTag.js
new file mode 100644
index 0000000000..aae5b44618
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-Symbol-toStringTag.js
@@ -0,0 +1,99 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-Symbol-toStringTag.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Module namespace objects have a Symbol.toStringTag (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+ [[Configurable]]: false }.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(ns[Symbol.toStringTag], 'Module');
+
+ // propertyHelper.js is not appropriate for this test because it assumes that
+ // the object exposes the ordinary object's implementation of [[Get]], [[Set]],
+// [[Delete]], and [[OwnPropertyKeys]], which the module namespace exotic
+// object does not.
+var desc = Object.getOwnPropertyDescriptor(ns, Symbol.toStringTag);
+
+assert.sameValue(desc.enumerable, false, 'reports as non-enumerable');
+assert.sameValue(desc.writable, false, 'reports as non-writable');
+assert.sameValue(desc.configurable, false, 'reports as non-configurable');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-define-own-property.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-define-own-property.js
new file mode 100644
index 0000000000..932af290d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-define-own-property.js
@@ -0,0 +1,178 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-define-own-property.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[DefineOwnProperty]] internal method returns `true` if no change is requested, and `false` otherwise. (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol.iterator, Reflect, Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+var sym = Symbol('test262');
+
+const exported = ['local1', 'renamed', 'indirect'];
+
+
+async function fn() {
+ const ns = await import('./define-own-property_FIXTURE.js');
+
+ // Non-existant properties.
+
+ for (const key of ['local2', 0, sym, Symbol.iterator]) {
+ assert.sameValue(
+ Reflect.defineProperty(ns, key, {}),
+ false,
+ 'Reflect.defineProperty: ' + key.toString()
+ );
+ assert.throws(TypeError, function() {
+ Object.defineProperty(ns, key, {});
+ }, 'Object.defineProperty: ' + key.toString());
+ }
+
+ // Own properties. No change requested.
+
+ for (const key of ([...exported, Symbol.toStringTag])) {
+ assert.sameValue(
+ Reflect.defineProperty(ns, key, {}),
+ true,
+ `No change requested, Reflect.defineProperty: ${key.toString()}`
+ );
+ assert.sameValue(
+ Object.defineProperty(ns, key, {}),
+ ns,
+ `No change requested, Object.defineProperty: ${key.toString()}`
+ );
+
+ }
+
+ assert.sameValue(
+ Reflect.defineProperty(ns, 'indirect',
+ {writable: true, enumerable: true, configurable: false}),
+ true,
+ 'Reflect.defineProperty: indirect'
+ );
+ assert.sameValue(
+ Object.defineProperty(ns, 'indirect',
+ {writable: true, enumerable: true, configurable: false}),
+ ns,
+ 'Object.defineProperty: indirect'
+ );
+
+ assert.sameValue(
+ Reflect.defineProperty(ns, Symbol.toStringTag,
+ {value: "Module", writable: false, enumerable: false,
+ configurable: false}),
+ true,
+ 'Reflect.defineProperty: Symbol.toStringTag'
+ );
+ assert.sameValue(
+ Object.defineProperty(ns, Symbol.toStringTag,
+ {value: "Module", writable: false, enumerable: false,
+ configurable: false}),
+ ns,
+ 'Object.defineProperty: Symbol.toStringTag'
+ );
+
+
+ // Own properties. Change requested.
+
+ for (const key of ([...exported, Symbol.toStringTag])) {
+ assert.sameValue(
+ Reflect.defineProperty(ns, key, {value: 123}),
+ false,
+ `Change requested, Reflect.defineProperty: ${key.toString()}`
+ );
+ assert.throws(TypeError, function() {
+ Object.defineProperty(ns, key, {value: 123});
+ }, `Change requested, Object.defineProperty: ${key.toString()}`);
+ }
+
+ assert.sameValue(
+ Reflect.defineProperty(ns, 'indirect',
+ {writable: true, enumerable: true, configurable: true}),
+ false,
+ 'Reflect.defineProperty: indirect'
+ );
+ assert.throws(TypeError, function() {
+ Object.defineProperty(ns, 'indirect',
+ {writable: true, enumerable: true, configurable: true});
+ }, 'Object.defineProperty: indirect');
+
+ assert.sameValue(
+ Reflect.defineProperty(ns, Symbol.toStringTag,
+ {value: "module", writable: false, enumerable: false,
+ configurable: false}),
+ false,
+ 'Reflect.defineProperty: Symbol.toStringTag'
+ );
+ assert.throws(TypeError, function() {
+ Object.defineProperty(ns, Symbol.toStringTag,
+ {value: "module", writable: false, enumerable: false,
+ configurable: false});
+ }, 'Object.defineProperty: Symbol.toStringTag');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-exported-init-no-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-exported-init-no-strict.js
new file mode 100644
index 0000000000..740073d0e9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-exported-init-no-strict.js
@@ -0,0 +1,113 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-delete-exported-init-no-strict.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[Delete]] behavior for a key that describes an initialized exported binding on non strict mode (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, noStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryDelete(O, P).
+ 3. Let exports be O.[[Exports]].
+ 4. If P is an element of exports, return false.
+ 5. Return true.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(delete ns.default, false, 'delete: default');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'default'), false, 'Reflect.deleteProperty: default'
+ );
+ assert.sameValue(ns.default, 42, 'binding unmodified: default');
+
+ assert.sameValue(delete ns.local1, false, 'delete: local1');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'local1'), false, 'Reflect.deleteProperty: local1'
+ );
+ assert.sameValue(ns.local1, 'Test262', 'binding unmodified: local1');
+
+ assert.sameValue(delete ns.renamed, false, 'delete: renamed');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'renamed'), false, 'Reflect.deleteProperty: renamed'
+ );
+ assert.sameValue(ns.renamed, 'TC39', 'binding unmodified: renamed');
+
+ assert.sameValue(delete ns.indirect, false, 'delete: indirect');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'indirect'),
+ false,
+ 'Reflect.deleteProperty: indirect'
+ );
+ assert.sameValue(ns.indirect, 'Test262', 'binding unmodified: indirect');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-exported-init-strict-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-exported-init-strict-strict.js
new file mode 100644
index 0000000000..da01dce614
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-exported-init-strict-strict.js
@@ -0,0 +1,122 @@
+// |reftest| async
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-delete-exported-init-strict.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[Delete]] behavior for a key that describes an initialized exported binding on strict mode (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, onlyStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryDelete(O, P).
+ 3. Let exports be O.[[Exports]].
+ 4. If P is an element of exports, return false.
+ 5. Return true.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.throws(TypeError, function() {
+ delete ns.default;
+ }, 'delete: default');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'default'), false, 'Reflect.deleteProperty: default'
+ );
+ assert.sameValue(ns.default, 42, 'binding unmodified: default');
+
+ assert.throws(TypeError, function() {
+ delete ns.local1;
+ }, 'delete: local1');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'local1'), false, 'Reflect.deleteProperty: local1'
+ );
+ assert.sameValue(ns.local1, 'Test262', 'binding unmodified: local1');
+
+ assert.throws(TypeError, function() {
+ delete ns.renamed;
+ }, 'delete: renamed');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'renamed'), false, 'Reflect.deleteProperty: renamed'
+ );
+ assert.sameValue(ns.renamed, 'TC39', 'binding unmodified: renamed');
+
+ assert.throws(TypeError, function() {
+ delete ns.indirect;
+ }, 'delete: indirect');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'indirect'),
+ false,
+ 'Reflect.deleteProperty: indirect'
+ );
+ assert.sameValue(ns.indirect, 'Test262', 'binding unmodified: indirect');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-non-exported-no-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-non-exported-no-strict.js
new file mode 100644
index 0000000000..0dd0b94205
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-non-exported-no-strict.js
@@ -0,0 +1,105 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-delete-non-exported-no-strict.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[Delete]] behavior for a key that does not describe an exported binding (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, noStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryDelete(O, P).
+ 3. Let exports be O.[[Exports]].
+ 4. If P is an element of exports, return false.
+ 5. Return true.
+
+---*/
+
+async function fn() {
+ const ns = await import('./empty_FIXTURE.js');
+
+ assert(delete ns.undef, 'delete: undef');
+ assert(Reflect.deleteProperty(ns, 'undef'), 'Reflect.deleteProperty: undef');
+
+ assert(delete ns.default, 'delete: default');
+ assert(
+ Reflect.deleteProperty(ns, 'default'), 'Reflect.deleteProperty: default'
+ );
+
+ assert.sameValue(delete ns[Symbol.toStringTag], false, 'delete: Symbol.toStringTag');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, Symbol.toStringTag), false,
+ 'Reflect.deleteProperty: Symbol.toStringTag'
+ );
+
+ var sym = Symbol('test262');
+ assert(delete ns[sym], 'delete: symbol');
+ assert(Reflect.deleteProperty(ns, sym), 'Reflect.deleteProperty: symbol');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-non-exported-strict-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-non-exported-strict-strict.js
new file mode 100644
index 0000000000..9351afcc43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-delete-non-exported-strict-strict.js
@@ -0,0 +1,106 @@
+// |reftest| async
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-delete-non-exported-strict.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[Delete]] behavior for a key that does not describe an exported binding (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, onlyStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryDelete(O, P).
+ 3. Let exports be O.[[Exports]].
+ 4. If P is an element of exports, return false.
+ 5. Return true.
+
+---*/
+
+async function fn() {
+ const ns = await import('./empty_FIXTURE.js');
+
+ assert(delete ns.undef, 'delete: undef');
+ assert(Reflect.deleteProperty(ns, 'undef'), 'Reflect.deleteProperty: undef');
+
+ assert(delete ns.default, 'delete: default');
+ assert(
+ Reflect.deleteProperty(ns, 'default'), 'Reflect.deleteProperty: default'
+ );
+
+ assert.sameValue(
+ Reflect.deleteProperty(ns, Symbol.toStringTag), false,
+ 'Reflect.deleteProperty: Symbol.toStringTag'
+ );
+ assert.throws(TypeError, function() { delete ns[Symbol.toStringTag]; }, 'delete: Symbol.toStringTag');
+
+ var sym = Symbol('test262');
+ assert(delete ns[sym], 'delete: symbol');
+ assert(Reflect.deleteProperty(ns, sym), 'Reflect.deleteProperty: symbol');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-extensible.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-extensible.js
new file mode 100644
index 0000000000..3b91635e73
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-extensible.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-extensible.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Module namespace objects are not extensible. (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(Object.isExtensible(ns), false);
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-dflt-direct.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-dflt-direct.js
new file mode 100644
index 0000000000..183c3ab36e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-dflt-direct.js
@@ -0,0 +1,127 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-nested-namespace-dflt-direct.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Direct Default exports are included in an imported module namespace object when a namespace object is created. (value from await resolving)
+esid: sec-finishdynamicimport
+features: [export-star-as-namespace-from-module, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 6. Let binding be ! m.ResolveExport(P, « »).
+ 7. Assert: binding is a ResolvedBinding Record.
+ 8. Let targetModule be binding.[[Module]].
+ 9. Assert: targetModule is not undefined.
+ 10. If binding.[[BindingName]] is "*namespace*", then
+ 11. Return ? GetModuleNamespace(targetModule).
+
+ Runtime Semantics: GetModuleNamespace
+ [...]
+ 3. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames,
+ i. Let resolution be ? module.ResolveExport(name, « », « »).
+ ii. If resolution is null, throw a SyntaxError exception.
+ iii. If resolution is not "ambiguous", append name to
+ unambiguousNames.
+ d. Let namespace be ModuleNamespaceCreate(module, unambiguousNames).
+ [...]
+
+---*/
+
+async function fn() {
+ const ns = await import('./get-nested-namespace-dflt-skip-prod_FIXTURE.js');
+
+ var desc = Object.getOwnPropertyDescriptor(ns, 'productionNS2');
+
+ assert.sameValue(desc.enumerable, true, 'ns.productionNS2: is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.productionNS2: is writable');
+ assert.sameValue(desc.configurable, false, 'ns.productionNS2: is non-configurable');
+
+ var keys = Object.getOwnPropertyNames(ns.productionNS2);
+
+ assert.sameValue(keys.length, 2);
+ assert.sameValue(keys[0], 'default');
+ assert.sameValue(keys[1], 'productionOther');
+
+ desc = Object.getOwnPropertyDescriptor(ns.productionNS2, 'productionOther');
+
+ assert.sameValue(desc.value, null, 'ns.productionNS2.productionOther: value is null');
+ assert.sameValue(desc.enumerable, true, 'ns.productionNS2.productionOther: is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.productionNS2.productionOther: is writable');
+ assert.sameValue(desc.configurable, false, 'ns.productionNS2.productionOther: is non-configurable');
+
+ desc = Object.getOwnPropertyDescriptor(ns.productionNS2, 'default');
+
+ assert.sameValue(desc.value, 42, 'ns.productionNS2.default value is 42');
+ assert.sameValue(desc.enumerable, true, 'ns.productionNS2.default is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.productionNS2.default is writable');
+ assert.sameValue(desc.configurable, false, 'ns.productionNS2.default is non-configurable');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-dflt-indirect.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-dflt-indirect.js
new file mode 100644
index 0000000000..809fe7a8d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-dflt-indirect.js
@@ -0,0 +1,127 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-nested-namespace-dflt-indirect.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Inirect Default exports are included in an imported module namespace object when a namespace object is created. (value from await resolving)
+esid: sec-finishdynamicimport
+features: [export-star-as-namespace-from-module, dynamic-import]
+flags: [generated, module, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 6. Let binding be ! m.ResolveExport(P, « »).
+ 7. Assert: binding is a ResolvedBinding Record.
+ 8. Let targetModule be binding.[[Module]].
+ 9. Assert: targetModule is not undefined.
+ 10. If binding.[[BindingName]] is "*namespace*", then
+ 11. Return ? GetModuleNamespace(targetModule).
+
+ Runtime Semantics: GetModuleNamespace
+ [...]
+ 3. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames,
+ i. Let resolution be ? module.ResolveExport(name, « », « »).
+ ii. If resolution is null, throw a SyntaxError exception.
+ iii. If resolution is not "ambiguous", append name to
+ unambiguousNames.
+ d. Let namespace be ModuleNamespaceCreate(module, unambiguousNames).
+ [...]
+
+---*/
+
+async function fn() {
+ const ns = await import('./get-nested-namespace-dflt-skip-named_FIXTURE.js');
+
+ var desc = Object.getOwnPropertyDescriptor(ns, 'namedNS2');
+
+ assert.sameValue(desc.enumerable, true, 'ns.namedNS2: is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.namedNS2: is writable');
+ assert.sameValue(desc.configurable, false, 'ns.namedNS2: is non-configurable');
+
+ var keys = Object.getOwnPropertyNames(ns.namedNS2);
+
+ assert.sameValue(keys.length, 2);
+ assert.sameValue(keys[0], 'default');
+ assert.sameValue(keys[1], 'namedOther');
+
+ desc = Object.getOwnPropertyDescriptor(ns.namedNS2, 'namedOther');
+
+ assert.sameValue(desc.value, null, 'ns.namedNS2.namedOther value is null');
+ assert.sameValue(desc.enumerable, true, 'ns.namedNS2.namedOther: is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.namedNS2.namedOther: is writable');
+ assert.sameValue(desc.configurable, false, 'ns.namedNS2.namedOther: is non-configurable');
+
+ desc = Object.getOwnPropertyDescriptor(ns.namedNS2, 'default');
+
+ assert.sameValue(desc.value, 42, 'ns.namedNS2.default value is 42');
+ assert.sameValue(desc.enumerable, true, 'ns.namedNS2.default is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.namedNS2.default is writable');
+ assert.sameValue(desc.configurable, false, 'ns.namedNS2.default is non-configurable');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-props-nrml.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-props-nrml.js
new file mode 100644
index 0000000000..6b9af79015
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-nested-namespace-props-nrml.js
@@ -0,0 +1,124 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-nested-namespace-props-nrml.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Module namespace object reports properties for all ExportEntries of all dependencies. (value from await resolving)
+esid: sec-finishdynamicimport
+features: [export-star-as-namespace-from-module, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 12. For each ImportEntry Record in in module.[[ImportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ in.[[ModuleRequest]]).
+ b. If in.[[ImportName]] is "*", then
+ i. Let namespace be ? GetModuleNamespace(importedModule).
+ [...]
+
+ Runtime Semantics: GetModuleNamespace
+ 3. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames,
+ i. Let resolution be ? module.ResolveExport(name, « », « »).
+ ii. If resolution is null, throw a SyntaxError exception.
+ iii. If resolution is not "ambiguous", append name to
+ unambiguousNames.
+ d. Let namespace be ModuleNamespaceCreate(module, unambiguousNames).
+
+---*/
+function hasOwnProperty(obj, property) {
+ return Object.prototype.hasOwnProperty.call(obj, property);
+}
+
+
+async function fn() {
+ const ns = await import('./get-nested-namespace-props-nrml-1_FIXTURE.js');
+
+ // Export entries defined by a re-exported as exportns module
+ assert(hasOwnProperty(ns.exportns, 'starAsVarDecl'), 'starssVarDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsLetDecl'), 'starSsLetDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsConstDecl'), 'starSsConstDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsFuncDecl'), 'starAsFuncDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsGenDecl'), 'starAsGenDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsClassDecl'), 'starAsClassDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsBindingId'), 'starAsBindingId');
+ assert(hasOwnProperty(ns.exportns, 'starIdName'), 'starIdName');
+ assert(hasOwnProperty(ns.exportns, 'starAsIndirectIdName'), 'starAsIndirectIdName');
+ assert(hasOwnProperty(ns.exportns, 'starAsIndirectIdName2'), 'starAsIndirectIdName2');
+ assert(hasOwnProperty(ns.exportns, 'namespaceBinding'), 'namespaceBinding');
+
+ // Bindings that were not exported from any module
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedVar'), false, 'nonExportedVar');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedLet'), false, 'nonExportedLet');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedConst'), false, 'nonExportedConst');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedFunc'), false, 'nonExportedFunc');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedGen'), false, 'nonExportedGen');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedClass'), false, 'nonExportedClass');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-str-found-init.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-str-found-init.js
new file mode 100644
index 0000000000..99066796a2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-str-found-init.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-own-property-str-found-init.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[GetOwnProperty]] internal method with a string argument describing an initialized binding (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. If Type(P) is Symbol, return OrdinaryGetOwnProperty(O, P).
+ 2. Let exports be the value of O's [[Exports]] internal slot.
+ 3. If P is not an element of exports, return undefined.
+ 4. Let value be ? O.[[Get]](P, O).
+ 5. Return PropertyDescriptor{[[Value]]: value, [[Writable]]: true,
+ [[Enumerable]]: true, [[Configurable]]: false }.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ var desc;
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'local1'), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'local1');
+ assert.sameValue(desc.value, 'Test262');
+ assert.sameValue(desc.enumerable, true, 'local1 enumerable');
+ assert.sameValue(desc.writable, true, 'local1 writable');
+ assert.sameValue(desc.configurable, false, 'local1 configurable');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'renamed'), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'renamed');
+ assert.sameValue(desc.value, 'TC39');
+ assert.sameValue(desc.enumerable, true, 'renamed enumerable');
+ assert.sameValue(desc.writable, true, 'renamed writable');
+ assert.sameValue(desc.configurable, false, 'renamed configurable');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'indirect'), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'indirect');
+ assert.sameValue(desc.value, 'Test262');
+ assert.sameValue(desc.enumerable, true, 'indirect enumerable');
+ assert.sameValue(desc.writable, true, 'indirect writable');
+ assert.sameValue(desc.configurable, false, 'indirect configurable');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'default'), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'default');
+ assert.sameValue(desc.value, 42);
+ assert.sameValue(desc.enumerable, true, 'default enumerable');
+ assert.sameValue(desc.writable, true, 'default writable');
+ assert.sameValue(desc.configurable, false, 'default configurable');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-str-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-str-not-found.js
new file mode 100644
index 0000000000..2936f3f6c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-str-not-found.js
@@ -0,0 +1,118 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-own-property-str-not-found.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[GetOwnProperty]] internal method with a string argument describing a binding that cannot be found (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. If Type(P) is Symbol, return OrdinaryGetOwnProperty(O, P).
+ 2. Let exports be the value of O's [[Exports]] internal slot.
+ 3. If P is not an element of exports, return undefined.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ var desc;
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'local2'),
+ false,
+ 'hasOwnProperty: local2'
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'local2');
+ assert.sameValue(desc, undefined, 'property descriptor for "local2"');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'toStringTag'),
+ false,
+ 'hasOwnProperty: toStringTag'
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'toStringTag');
+ assert.sameValue(desc, undefined, 'property descriptor for "toStringTag"');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'iterator'),
+ false,
+ 'hasOwnProperty: iterator'
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'iterator');
+ assert.sameValue(desc, undefined, 'property descriptor for "iterator"');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, '__proto__'),
+ false,
+ 'hasOwnProperty: __proto__'
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, '__proto__');
+ assert.sameValue(desc, undefined, 'property descriptor for "__proto__"');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-sym.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-sym.js
new file mode 100644
index 0000000000..fe14dbc8a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-own-property-sym.js
@@ -0,0 +1,96 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-own-property-sym.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[GetOwnProperty]] internal method with a Symbol argument (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+var notFound = Symbol('test262');
+
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ var desc;
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, Symbol.toStringTag), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, Symbol.toStringTag);
+ assert.sameValue(desc.value, ns[Symbol.toStringTag]);
+ assert.sameValue(desc.enumerable, false, 'Symbol.toStringTag enumerable');
+ assert.sameValue(desc.writable, false, 'Symbol.toStringTag writable');
+ assert.sameValue(desc.configurable, false, 'Symbol.toStringTag configurable');
+
+ assert.sameValue(Object.prototype.hasOwnProperty.call(ns, notFound), false);
+ desc = Object.getOwnPropertyDescriptor(ns, notFound);
+ assert.sameValue(desc, undefined);
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-str-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-str-found.js
new file mode 100644
index 0000000000..799ccd0f3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-str-found.js
@@ -0,0 +1,89 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-str-found.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[Get]] internal method with a string argument for exported initialized bindings. (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 12. Let targetEnvRec be targetEnv's EnvironmentRecord.
+ 13. Return ? targetEnvRec.GetBindingValue(binding.[[BindingName]], true).
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(ns.local1, 'Test262');
+ assert.sameValue(ns.renamed, 'TC39');
+ assert.sameValue(ns.indirect, 'Test262');
+ assert.sameValue(ns.default, 42);
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-str-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-str-not-found.js
new file mode 100644
index 0000000000..01bb5f092d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-str-not-found.js
@@ -0,0 +1,91 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-str-not-found.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[Get]] internal method with a string argument for non-exported bindings (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 3. Let exports be the value of O's [[Exports]] internal slot.
+ 4. If P is not an element of exports, return undefined.
+
+---*/
+var local2; // not used
+
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(ns.local2, undefined, 'key: local2');
+ assert.sameValue(ns.toStringTag, undefined, 'key: toStringTag');
+ assert.sameValue(ns.iterator, undefined, 'key: iterator');
+ assert.sameValue(ns.__proto__, undefined, 'key: __proto__');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-sym-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-sym-found.js
new file mode 100644
index 0000000000..dedf63a112
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-sym-found.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-sym-found.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[Get]] internal method with a symbol argument that can be found (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryGet(O, P, Receiver).
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(typeof ns[Symbol.toStringTag], 'string');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-sym-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-sym-not-found.js
new file mode 100644
index 0000000000..807056b97c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-get-sym-not-found.js
@@ -0,0 +1,86 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-sym-not-found.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[Get]] internal method with a symbol argument that cannot be found (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryGet(O, P, Receiver).
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(ns[Symbol('test262')], undefined, 'Symbol: test262');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-str-found-init.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-str-found-init.js
new file mode 100644
index 0000000000..9cff22d38d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-str-found-init.js
@@ -0,0 +1,96 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-has-property-str-found-init.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[HasProperty]] internal method with a string argument for exported initialized bindings. (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. Let exports be the value of O's [[Exports]] internal slot.
+ 3. If P is an element of exports, return true.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert('local1' in ns, 'in: local1');
+ assert(Reflect.has(ns, 'local1'), 'Reflect.has: local1');
+
+ assert('renamed' in ns, 'in: renamed');
+ assert(Reflect.has(ns, 'renamed'), 'Reflect.has: renamed');
+
+ assert('indirect' in ns, 'in: indirect');
+ assert(Reflect.has(ns, 'indirect'), 'Reflect.has: indirect');
+
+ assert('default' in ns, 'in: default');
+ assert(Reflect.has(ns, 'default'), 'Reflect.has: default');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-str-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-str-not-found.js
new file mode 100644
index 0000000000..4308486bb4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-str-not-found.js
@@ -0,0 +1,103 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-has-property-str-not-found.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[HasProperty]] internal method with a string argument for non-exported bindings (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. Let exports be the value of O's [[Exports]] internal slot.
+ 3. If P is an element of exports, return true.
+ 4. Return false.
+
+---*/
+var local2; // not used
+
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue('local2' in ns, false, 'in: local2');
+ assert.sameValue(Reflect.has(ns, 'local2'), false, 'Reflect.has: local2');
+
+ assert.sameValue('toStringTag' in ns, false, 'in: toStringTag');
+ assert.sameValue(
+ Reflect.has(ns, 'toStringTag'), false, 'Reflect.has: toStringTag'
+ );
+
+ assert.sameValue('iterator' in ns, false, 'in: iterator');
+ assert.sameValue(Reflect.has(ns, 'iterator'), false, 'Reflect.has: iterator');
+
+ assert.sameValue('__proto__' in ns, false, 'in: __proto__');
+ assert.sameValue(
+ Reflect.has(ns, '__proto__'), false, 'Reflect.has: __proto__'
+ );
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-sym-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-sym-found.js
new file mode 100644
index 0000000000..b60f319f42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-sym-found.js
@@ -0,0 +1,85 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-has-property-sym-found.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[HasProperty]] internal method with a symbol argument that can be found (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. If Type(P) is Symbol, return OrdinaryHasProperty(O, P).
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert(Symbol.toStringTag in ns, 'in: Symbol.toStringTag');
+ assert(Reflect.has(ns, Symbol.toStringTag), 'Reflect.has: Symbol.toStringTag');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-sym-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-sym-not-found.js
new file mode 100644
index 0000000000..e139111c7e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-has-property-sym-not-found.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-has-property-sym-not-found.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Behavior of the [[HasProperty]] internal method with a symbol argument that cannot be found (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. If Type(P) is Symbol, return OrdinaryHasProperty(O, P).
+
+---*/
+var sym = Symbol('test262');
+
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(sym in ns, false, 'in');
+ assert.sameValue(Reflect.has(ns, sym), false, 'Reflect.has');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-no-iterator.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-no-iterator.js
new file mode 100644
index 0000000000..59f216ce0a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-no-iterator.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-no-iterator.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Module namespace objects lack a Symbol.toStringTag (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol.iterator, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(Object.prototype.hasOwnProperty.call(ns, Symbol.iterator), false);
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-own-property-keys-sort.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-own-property-keys-sort.js
new file mode 100644
index 0000000000..92c54f3994
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-own-property-keys-sort.js
@@ -0,0 +1,131 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-own-property-keys-sort.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[OwnPropertyKeys]] internal method reflects the sorted order (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Let exports be a copy of the value of O's [[Exports]] internal slot.
+ 2. Let symbolKeys be ! OrdinaryOwnPropertyKeys(O).
+ 3. Append all the entries of symbolKeys to the end of exports.
+ 4. Return exports.
+
+---*/
+
+async function fn() {
+ const ns = await import('./own-keys-sort_FIXTURE.js');
+
+ var stringKeys = Object.getOwnPropertyNames(ns);
+
+ assert.sameValue(stringKeys.length, 16);
+ assert.sameValue(stringKeys[0], '$', 'stringKeys[0] === "$"');
+ assert.sameValue(stringKeys[1], '$$', 'stringKeys[1] === "$$"');
+ assert.sameValue(stringKeys[2], 'A', 'stringKeys[2] === "A"');
+ assert.sameValue(stringKeys[3], 'Z', 'stringKeys[3] === "Z"');
+ assert.sameValue(stringKeys[4], '_', 'stringKeys[4] === "_"');
+ assert.sameValue(stringKeys[5], '__', 'stringKeys[5] === "__"');
+ assert.sameValue(stringKeys[6], 'a', 'stringKeys[6] === "a"');
+ assert.sameValue(stringKeys[7], 'aa', 'stringKeys[7] === "aa"');
+ assert.sameValue(stringKeys[8], 'az', 'stringKeys[8] === "az"');
+ assert.sameValue(stringKeys[9], 'default', 'stringKeys[9] === "default"');
+ assert.sameValue(stringKeys[10], 'z', 'stringKeys[10] === "z"');
+ assert.sameValue(stringKeys[11], 'za', 'stringKeys[11] === "za"');
+ assert.sameValue(stringKeys[12], 'zz', 'stringKeys[12] === "zz"');
+ assert.sameValue(stringKeys[13], '\u03bb', 'stringKeys[13] === "\u03bb"');
+ assert.sameValue(stringKeys[14], '\u03bc', 'stringKeys[14] === "\u03bc"');
+ assert.sameValue(stringKeys[15], '\u03c0', 'stringKeys[15] === "\u03c0"');
+
+ var allKeys = Reflect.ownKeys(ns);
+ assert(
+ allKeys.length >= 17,
+ 'at least as many keys as defined by the module and the specification'
+ );
+ assert.sameValue(allKeys[0], '$', 'allKeys[0] === "$"');
+ assert.sameValue(allKeys[1], '$$', 'allKeys[1] === "$$"');
+ assert.sameValue(allKeys[2], 'A', 'allKeys[2] === "A"');
+ assert.sameValue(allKeys[3], 'Z', 'allKeys[3] === "Z"');
+ assert.sameValue(allKeys[4], '_', 'allKeys[4] === "_"');
+ assert.sameValue(allKeys[5], '__', 'allKeys[5] === "__"');
+ assert.sameValue(allKeys[6], 'a', 'allKeys[6] === "a"');
+ assert.sameValue(allKeys[7], 'aa', 'allKeys[7] === "aa"');
+ assert.sameValue(allKeys[8], 'az', 'allKeys[8] === "az"');
+ assert.sameValue(allKeys[9], 'default', 'allKeys[9] === "default"');
+ assert.sameValue(allKeys[10], 'z', 'allKeys[10] === "z"');
+ assert.sameValue(allKeys[11], 'za', 'allKeys[11] === "za"');
+ assert.sameValue(allKeys[12], 'zz', 'allKeys[12] === "zz"');
+ assert.sameValue(allKeys[13], '\u03bb', 'allKeys[13] === "\u03bb"');
+ assert.sameValue(allKeys[14], '\u03bc', 'allKeys[14] === "\u03bc"');
+ assert.sameValue(allKeys[15], '\u03c0', 'allKeys[15] === "\u03c0"');
+ assert(
+ allKeys.indexOf(Symbol.toStringTag) > 15,
+ 'keys array includes Symbol.toStringTag'
+ );
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prevent-extensions-object.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prevent-extensions-object.js
new file mode 100644
index 0000000000..c8ceab4c44
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prevent-extensions-object.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-prevent-extensions-object.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[PreventExtensions]] internal method returns `true` (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+async function fn() {
+ const ns = await import('./empty_FIXTURE.js');
+
+ // This invocation should not throw an exception
+ Object.preventExtensions(ns);
+
+ assert.sameValue(Reflect.preventExtensions(ns), true);
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prevent-extensions-reflect.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prevent-extensions-reflect.js
new file mode 100644
index 0000000000..647a3041b5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prevent-extensions-reflect.js
@@ -0,0 +1,81 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-prevent-extensions-reflect.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[PreventExtensions]] internal method returns `true` (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+async function fn() {
+ const ns = await import('./empty_FIXTURE.js');
+
+ assert.sameValue(Reflect.preventExtensions(ns), true);
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prop-descs.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prop-descs.js
new file mode 100644
index 0000000000..f1f8f52cad
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prop-descs.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-prop-descs.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: imported object properties descriptors (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ // propertyHelper.js is not appropriate for this test because it assumes that
+ // the object exposes the ordinary object's implementation of [[Get]], [[Set]],
+// [[Delete]], and [[OwnPropertyKeys]], which the module namespace exotic
+// object does not.
+var desc = Object.getOwnPropertyDescriptor(ns, 'default');
+
+assert.sameValue(desc.value, 42, 'default: value is 42');
+assert.sameValue(desc.enumerable, true, 'default: is enumerable');
+assert.sameValue(desc.writable, true, 'default: is writable');
+assert.sameValue(desc.configurable, false, 'default: is non-configurable');
+
+desc = Object.getOwnPropertyDescriptor(ns, 'local1');
+
+assert.sameValue(desc.value, 'Test262', 'local1: value is "Test262"');
+assert.sameValue(desc.enumerable, true, 'local1: is enumerable');
+assert.sameValue(desc.writable, true, 'local1: is writable');
+assert.sameValue(desc.configurable, false, 'local1: is non-configurable');
+
+desc = Object.getOwnPropertyDescriptor(ns, 'renamed');
+
+assert.sameValue(desc.value, 'TC39', 'renamed: value is TC39"');
+assert.sameValue(desc.enumerable, true, 'renamed: is enumerable');
+assert.sameValue(desc.writable, true, 'renamed: is writable');
+assert.sameValue(desc.configurable, false, 'renamed: is non-configurable');
+
+desc = Object.getOwnPropertyDescriptor(ns, 'indirect');
+
+assert.sameValue(desc.value, 'Test262', 'indirect: value is Test262"');
+assert.sameValue(desc.enumerable, true, 'indirect: is enumerable');
+assert.sameValue(desc.writable, true, 'indirect: is writable');
+assert.sameValue(desc.configurable, false, 'indirect: is non-configurable');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prototype.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prototype.js
new file mode 100644
index 0000000000..e3d3d107a9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-prototype.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-prototype.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: Module namespace object prototype is null (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(ns instanceof Object, false);
+ assert.sameValue(Object.getPrototypeOf(ns), null, 'prototype is null');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-no-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-no-strict.js
new file mode 100644
index 0000000000..1e0f8f6c92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-no-strict.js
@@ -0,0 +1,109 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-no-strict.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[Set]] internal method consistently returns `false`, No Strict Mode (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, noStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Return false.
+
+---*/
+var sym = Symbol('test262');
+
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(Reflect.set(ns, 'local1'), false, 'Reflect.set: local1');
+ assert.sameValue(ns.local1 = null, null, 'AssignmentExpression: local1');
+
+ assert.sameValue(Reflect.set(ns, 'local2'), false, 'Reflect.set: local2');
+ assert.sameValue(ns.local2 = null, null, 'AssignmentExpression: local2');
+
+ assert.sameValue(Reflect.set(ns, 'renamed'), false, 'Reflect.set: renamed');
+ assert.sameValue(ns.renamed = null, null, 'AssignmentExpression: renamed');
+
+ assert.sameValue(Reflect.set(ns, 'indirect'), false, 'Reflect.set: indirect');
+ assert.sameValue(ns.indirect = null, null, 'AssignmentExpression: indirect');
+
+ assert.sameValue(Reflect.set(ns, 'default'), false, 'Reflect.set: default');
+ assert.sameValue(ns.default = null, null, 'AssignmentExpression: default');
+
+ assert.sameValue(
+ Reflect.set(ns, Symbol.toStringTag, null),
+ false,
+ 'Reflect.set: Symbol.toStringTag'
+ );
+ assert.sameValue(ns[Symbol.toStringTag] = null, null, 'AssignmentExpression: Symbol.toStringTag');
+
+ assert.sameValue(Reflect.set(ns, sym), false, 'Reflect.set: sym');
+ assert.sameValue(ns[sym] = null, null, 'AssignmentExpression: sym');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-prototype-of-null.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-prototype-of-null.js
new file mode 100644
index 0000000000..d8fae22d3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-prototype-of-null.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-prototype-of-null.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[SetPrototypeOf]] internal method returns `true` if passed `null` (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+async function fn() {
+ const ns = await import('./empty_FIXTURE.js');
+
+ assert.sameValue(typeof Object.setPrototypeOf, 'function');
+ assert.sameValue(ns, Object.setPrototypeOf(ns, null));
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-prototype-of.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-prototype-of.js
new file mode 100644
index 0000000000..8d295cd2cd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-prototype-of.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-prototype-of.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[SetPrototypeOf]] internal method returns `false` (value from await resolving)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ var newProto = {};
+
+ assert.sameValue(typeof Object.setPrototypeOf, 'function');
+
+ assert.throws(TypeError, function() {
+ Object.setPrototypeOf(ns, newProto);
+ });
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-same-values-no-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-same-values-no-strict.js
new file mode 100644
index 0000000000..7556eb86a6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-same-values-no-strict.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-same-values-no-strict.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[Set]] internal method consistently returns `false` even setting the same value - No Strict Mode (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, noStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Return false.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(Reflect.set(ns, 'local1', 'Test262'), false, 'Reflect.set: local1');
+ assert.sameValue(ns.local1 = 'Test262', 'Test262', 'AssignmentExpression: local1');
+
+ assert.sameValue(Reflect.set(ns, 'renamed', 'TC39'), false, 'Reflect.set: renamed');
+ assert.sameValue(ns.renamed = 'TC39', 'TC39', 'AssignmentExpression: renamed');
+
+ assert.sameValue(Reflect.set(ns, 'indirect', 'Test262'), false, 'Reflect.set: indirect');
+ assert.sameValue(ns.indirect = 'Test262', 'Test262', 'AssignmentExpression: indirect');
+
+ assert.sameValue(Reflect.set(ns, 'default', 42), false, 'Reflect.set: default');
+ assert.sameValue(ns.default = 42, 42, 'AssignmentExpression: default');
+
+ assert.sameValue(
+ Reflect.set(ns, Symbol.toStringTag, ns[Symbol.toStringTag]),
+ false,
+ 'Reflect.set: Symbol.toStringTag'
+ );
+ assert.sameValue(ns[Symbol.toStringTag] = ns[Symbol.toStringTag], 'Module', 'AssignmentExpression: Symbol.toStringTag');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-same-values-strict-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-same-values-strict-strict.js
new file mode 100644
index 0000000000..6973c733dd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-same-values-strict-strict.js
@@ -0,0 +1,112 @@
+// |reftest| async
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-same-values-strict.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[Set]] internal method consistently returns `false` even setting the same value - Strict Mode (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, onlyStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Return false.
+
+---*/
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(Reflect.set(ns, 'local1', 'Test262'), false, 'Reflect.set: local1');
+ assert.throws(TypeError, function() {
+ ns.local1 = 'Test262';
+ }, 'AssignmentExpression: local1');
+
+ assert.sameValue(Reflect.set(ns, 'renamed', 'TC39'), false, 'Reflect.set: renamed');
+ assert.throws(TypeError, function() {
+ ns.renamed = 'TC39';
+ }, 'AssignmentExpression: renamed');
+
+ assert.sameValue(Reflect.set(ns, 'indirect', 'Test262'), false, 'Reflect.set: indirect');
+ assert.throws(TypeError, function() {
+ ns.indirect = 'Test262';
+ }, 'AssignmentExpression: indirect');
+
+ assert.sameValue(Reflect.set(ns, 'default', 42), false, 'Reflect.set: default');
+ assert.throws(TypeError, function() {
+ ns.default = 42;
+ }, 'AssignmentExpression: default');
+
+ assert.sameValue(
+ Reflect.set(ns, Symbol.toStringTag, ns[Symbol.toStringTag]),
+ false,
+ 'Reflect.set: Symbol.toStringTag'
+ );
+ assert.throws(TypeError, function() {
+ ns[Symbol.toStringTag] = ns[Symbol.toStringTag];
+ }, 'AssignmentExpression: Symbol.toStringTag');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-strict-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-strict-strict.js
new file mode 100644
index 0000000000..5119a5d350
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/await-ns-set-strict-strict.js
@@ -0,0 +1,124 @@
+// |reftest| async
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-strict.case
+// - src/dynamic-import/namespace/await.template
+/*---
+description: The [[Set]] internal method consistently returns `false`, Strict Mode (value from await resolving)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, onlyStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Return false.
+
+---*/
+var sym = Symbol('test262');
+
+
+async function fn() {
+ const ns = await import('./module-code_FIXTURE.js');
+
+ assert.sameValue(Reflect.set(ns, 'local1'), false, 'Reflect.set: local1');
+ assert.throws(TypeError, function() {
+ ns.local1 = null;
+ }, 'AssignmentExpression: local1');
+
+ assert.sameValue(Reflect.set(ns, 'local2'), false, 'Reflect.set: local2');
+ assert.throws(TypeError, function() {
+ ns.local2 = null;
+ }, 'AssignmentExpression: local2');
+
+ assert.sameValue(Reflect.set(ns, 'renamed'), false, 'Reflect.set: renamed');
+ assert.throws(TypeError, function() {
+ ns.renamed = null;
+ }, 'AssignmentExpression: renamed');
+
+ assert.sameValue(Reflect.set(ns, 'indirect'), false, 'Reflect.set: indirect');
+ assert.throws(TypeError, function() {
+ ns.indirect = null;
+ }, 'AssignmentExpression: indirect');
+
+ assert.sameValue(Reflect.set(ns, 'default'), false, 'Reflect.set: default');
+ assert.throws(TypeError, function() {
+ ns.default = null;
+ }, 'AssignmentExpression: default');
+
+ assert.sameValue(
+ Reflect.set(ns, Symbol.toStringTag, null),
+ false,
+ 'Reflect.set: Symbol.toStringTag'
+ );
+ assert.throws(TypeError, function() {
+ ns[Symbol.toStringTag] = null;
+ }, 'AssignmentExpression: Symbol.toStringTag');
+
+ assert.sameValue(Reflect.set(ns, sym), false, 'Reflect.set: sym');
+ assert.throws(TypeError, function() {
+ ns[sym] = null;
+ }, 'AssignmentExpression: sym');
+}
+
+fn().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/browser.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/browser.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/default-property-not-set-own.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/default-property-not-set-own.js
new file mode 100644
index 0000000000..ca08d02709
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/default-property-not-set-own.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: The default property is not set the if the module doesn't export any default
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ ...
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+---*/
+
+import('./empty_FIXTURE.js').then(ns => {
+
+ assert.sameValue(Object.prototype.hasOwnProperty.call(ns, 'default'), false);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/define-own-property_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/define-own-property_FIXTURE.js
new file mode 100644
index 0000000000..5dbd9208c9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/define-own-property_FIXTURE.js
@@ -0,0 +1,8 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export var local1;
+var local2;
+export { local2 as renamed };
+export { local1 as indirect } from './define-own-property_FIXTURE.js';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/empty_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/empty_FIXTURE.js
new file mode 100644
index 0000000000..9200e13455
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/empty_FIXTURE.js
@@ -0,0 +1,3 @@
+// |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.
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-named-end_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-named-end_FIXTURE.js
new file mode 100644
index 0000000000..270996ee52
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-named-end_FIXTURE.js
@@ -0,0 +1,7 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+var x = 42;
+export var namedOther = null;
+export { x as default };
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-named_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-named_FIXTURE.js
new file mode 100644
index 0000000000..55135279d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-named_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export * as namedNS2 from './get-nested-namespace-dflt-skip-named-end_FIXTURE.js';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-prod-end_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-prod-end_FIXTURE.js
new file mode 100644
index 0000000000..56f2668efe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-prod-end_FIXTURE.js
@@ -0,0 +1,6 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export var productionOther = null;
+export default 42;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-prod_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-prod_FIXTURE.js
new file mode 100644
index 0000000000..15458ce109
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-dflt-skip-prod_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export * as productionNS2 from './get-nested-namespace-dflt-skip-prod-end_FIXTURE.js';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-1_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-1_FIXTURE.js
new file mode 100644
index 0000000000..3eb0886e15
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-1_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export * as exportns from './get-nested-namespace-props-nrml-2_FIXTURE.js';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-2_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-2_FIXTURE.js
new file mode 100644
index 0000000000..7ec2cc2b4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-2_FIXTURE.js
@@ -0,0 +1,24 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+var notExportedVar;
+let notExportedLet;
+const notExportedConst = null;
+function notExportedFunc() {}
+function* notExportedGen() {}
+class notExportedClass {}
+
+var starAsBindingId;
+
+export var starAsVarDecl;
+export let starAsLetDecl;
+export const starAsConstDecl = null;
+export function starAsFuncDecl() {}
+export function* starAsGenDecl() {}
+export class starAsClassDecl {}
+export { starAsBindingId };
+export { starAsBindingId as starIdName };
+export { starAsIndirectIdName } from './get-nested-namespace-props-nrml-3_FIXTURE.js';
+export { starAsIndirectIdName as starAsIndirectIdName2 } from './get-nested-namespace-props-nrml-3_FIXTURE.js';
+export * as namespaceBinding from './get-nested-namespace-props-nrml-3_FIXTURE.js';;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-3_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-3_FIXTURE.js
new file mode 100644
index 0000000000..11ccdef663
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/get-nested-namespace-props-nrml-3_FIXTURE.js
@@ -0,0 +1,6 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 Valerie Young. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export var indirectIdName;
+export var starAsIndirectIdName;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/module-code_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/module-code_FIXTURE.js
new file mode 100644
index 0000000000..bfe3fbce80
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/module-code_FIXTURE.js
@@ -0,0 +1,11 @@
+// |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.
+
+// exports: default === 42, local1 === 'Test262', renamed === 'TC39', indirect === 'Test262'
+
+export var local1 = 'Test262';
+var local2 = 'TC39';
+export { local2 as renamed };
+export { local1 as indirect } from './module-code_FIXTURE.js';
+export default 42;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/own-keys-sort_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/own-keys-sort_FIXTURE.js
new file mode 100644
index 0000000000..6f21dacdbe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/own-keys-sort_FIXTURE.js
@@ -0,0 +1,21 @@
+// |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.
+
+var x;
+export { x as π }; // u03c0
+export { x as az };
+export { x as __ };
+export { x as za };
+export { x as Z };
+export { x as \u03bc };
+export { x as z };
+export { x as zz };
+export { x as a };
+export { x as A };
+export { x as aa };
+export { x as λ }; // u03bb
+export { x as _ };
+export { x as $$ };
+export { x as $ };
+export default null;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-Symbol-toStringTag.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-Symbol-toStringTag.js
new file mode 100644
index 0000000000..64cb2e8f88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-Symbol-toStringTag.js
@@ -0,0 +1,97 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-Symbol-toStringTag.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Module namespace objects have a Symbol.toStringTag (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false,
+ [[Configurable]]: false }.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(ns[Symbol.toStringTag], 'Module');
+
+ // propertyHelper.js is not appropriate for this test because it assumes that
+ // the object exposes the ordinary object's implementation of [[Get]], [[Set]],
+// [[Delete]], and [[OwnPropertyKeys]], which the module namespace exotic
+// object does not.
+var desc = Object.getOwnPropertyDescriptor(ns, Symbol.toStringTag);
+
+assert.sameValue(desc.enumerable, false, 'reports as non-enumerable');
+assert.sameValue(desc.writable, false, 'reports as non-writable');
+assert.sameValue(desc.configurable, false, 'reports as non-configurable');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-define-own-property.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-define-own-property.js
new file mode 100644
index 0000000000..03547833e9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-define-own-property.js
@@ -0,0 +1,176 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-define-own-property.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[DefineOwnProperty]] internal method returns `true` if no change is requested, and `false` otherwise. (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol.iterator, Reflect, Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+var sym = Symbol('test262');
+
+const exported = ['local1', 'renamed', 'indirect'];
+
+
+import('./define-own-property_FIXTURE.js').then(ns => {
+
+ // Non-existant properties.
+
+ for (const key of ['local2', 0, sym, Symbol.iterator]) {
+ assert.sameValue(
+ Reflect.defineProperty(ns, key, {}),
+ false,
+ 'Reflect.defineProperty: ' + key.toString()
+ );
+ assert.throws(TypeError, function() {
+ Object.defineProperty(ns, key, {});
+ }, 'Object.defineProperty: ' + key.toString());
+ }
+
+ // Own properties. No change requested.
+
+ for (const key of ([...exported, Symbol.toStringTag])) {
+ assert.sameValue(
+ Reflect.defineProperty(ns, key, {}),
+ true,
+ `No change requested, Reflect.defineProperty: ${key.toString()}`
+ );
+ assert.sameValue(
+ Object.defineProperty(ns, key, {}),
+ ns,
+ `No change requested, Object.defineProperty: ${key.toString()}`
+ );
+
+ }
+
+ assert.sameValue(
+ Reflect.defineProperty(ns, 'indirect',
+ {writable: true, enumerable: true, configurable: false}),
+ true,
+ 'Reflect.defineProperty: indirect'
+ );
+ assert.sameValue(
+ Object.defineProperty(ns, 'indirect',
+ {writable: true, enumerable: true, configurable: false}),
+ ns,
+ 'Object.defineProperty: indirect'
+ );
+
+ assert.sameValue(
+ Reflect.defineProperty(ns, Symbol.toStringTag,
+ {value: "Module", writable: false, enumerable: false,
+ configurable: false}),
+ true,
+ 'Reflect.defineProperty: Symbol.toStringTag'
+ );
+ assert.sameValue(
+ Object.defineProperty(ns, Symbol.toStringTag,
+ {value: "Module", writable: false, enumerable: false,
+ configurable: false}),
+ ns,
+ 'Object.defineProperty: Symbol.toStringTag'
+ );
+
+
+ // Own properties. Change requested.
+
+ for (const key of ([...exported, Symbol.toStringTag])) {
+ assert.sameValue(
+ Reflect.defineProperty(ns, key, {value: 123}),
+ false,
+ `Change requested, Reflect.defineProperty: ${key.toString()}`
+ );
+ assert.throws(TypeError, function() {
+ Object.defineProperty(ns, key, {value: 123});
+ }, `Change requested, Object.defineProperty: ${key.toString()}`);
+ }
+
+ assert.sameValue(
+ Reflect.defineProperty(ns, 'indirect',
+ {writable: true, enumerable: true, configurable: true}),
+ false,
+ 'Reflect.defineProperty: indirect'
+ );
+ assert.throws(TypeError, function() {
+ Object.defineProperty(ns, 'indirect',
+ {writable: true, enumerable: true, configurable: true});
+ }, 'Object.defineProperty: indirect');
+
+ assert.sameValue(
+ Reflect.defineProperty(ns, Symbol.toStringTag,
+ {value: "module", writable: false, enumerable: false,
+ configurable: false}),
+ false,
+ 'Reflect.defineProperty: Symbol.toStringTag'
+ );
+ assert.throws(TypeError, function() {
+ Object.defineProperty(ns, Symbol.toStringTag,
+ {value: "module", writable: false, enumerable: false,
+ configurable: false});
+ }, 'Object.defineProperty: Symbol.toStringTag');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-exported-init-no-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-exported-init-no-strict.js
new file mode 100644
index 0000000000..5b67e2fc80
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-exported-init-no-strict.js
@@ -0,0 +1,111 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-delete-exported-init-no-strict.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[Delete]] behavior for a key that describes an initialized exported binding on non strict mode (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, noStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryDelete(O, P).
+ 3. Let exports be O.[[Exports]].
+ 4. If P is an element of exports, return false.
+ 5. Return true.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(delete ns.default, false, 'delete: default');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'default'), false, 'Reflect.deleteProperty: default'
+ );
+ assert.sameValue(ns.default, 42, 'binding unmodified: default');
+
+ assert.sameValue(delete ns.local1, false, 'delete: local1');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'local1'), false, 'Reflect.deleteProperty: local1'
+ );
+ assert.sameValue(ns.local1, 'Test262', 'binding unmodified: local1');
+
+ assert.sameValue(delete ns.renamed, false, 'delete: renamed');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'renamed'), false, 'Reflect.deleteProperty: renamed'
+ );
+ assert.sameValue(ns.renamed, 'TC39', 'binding unmodified: renamed');
+
+ assert.sameValue(delete ns.indirect, false, 'delete: indirect');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'indirect'),
+ false,
+ 'Reflect.deleteProperty: indirect'
+ );
+ assert.sameValue(ns.indirect, 'Test262', 'binding unmodified: indirect');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-exported-init-strict-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-exported-init-strict-strict.js
new file mode 100644
index 0000000000..f804eb8e97
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-exported-init-strict-strict.js
@@ -0,0 +1,120 @@
+// |reftest| async
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-delete-exported-init-strict.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[Delete]] behavior for a key that describes an initialized exported binding on strict mode (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, onlyStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryDelete(O, P).
+ 3. Let exports be O.[[Exports]].
+ 4. If P is an element of exports, return false.
+ 5. Return true.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.throws(TypeError, function() {
+ delete ns.default;
+ }, 'delete: default');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'default'), false, 'Reflect.deleteProperty: default'
+ );
+ assert.sameValue(ns.default, 42, 'binding unmodified: default');
+
+ assert.throws(TypeError, function() {
+ delete ns.local1;
+ }, 'delete: local1');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'local1'), false, 'Reflect.deleteProperty: local1'
+ );
+ assert.sameValue(ns.local1, 'Test262', 'binding unmodified: local1');
+
+ assert.throws(TypeError, function() {
+ delete ns.renamed;
+ }, 'delete: renamed');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'renamed'), false, 'Reflect.deleteProperty: renamed'
+ );
+ assert.sameValue(ns.renamed, 'TC39', 'binding unmodified: renamed');
+
+ assert.throws(TypeError, function() {
+ delete ns.indirect;
+ }, 'delete: indirect');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, 'indirect'),
+ false,
+ 'Reflect.deleteProperty: indirect'
+ );
+ assert.sameValue(ns.indirect, 'Test262', 'binding unmodified: indirect');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-non-exported-no-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-non-exported-no-strict.js
new file mode 100644
index 0000000000..3ea0e7e799
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-non-exported-no-strict.js
@@ -0,0 +1,103 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-delete-non-exported-no-strict.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[Delete]] behavior for a key that does not describe an exported binding (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, noStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryDelete(O, P).
+ 3. Let exports be O.[[Exports]].
+ 4. If P is an element of exports, return false.
+ 5. Return true.
+
+---*/
+
+import('./empty_FIXTURE.js').then(ns => {
+
+ assert(delete ns.undef, 'delete: undef');
+ assert(Reflect.deleteProperty(ns, 'undef'), 'Reflect.deleteProperty: undef');
+
+ assert(delete ns.default, 'delete: default');
+ assert(
+ Reflect.deleteProperty(ns, 'default'), 'Reflect.deleteProperty: default'
+ );
+
+ assert.sameValue(delete ns[Symbol.toStringTag], false, 'delete: Symbol.toStringTag');
+ assert.sameValue(
+ Reflect.deleteProperty(ns, Symbol.toStringTag), false,
+ 'Reflect.deleteProperty: Symbol.toStringTag'
+ );
+
+ var sym = Symbol('test262');
+ assert(delete ns[sym], 'delete: symbol');
+ assert(Reflect.deleteProperty(ns, sym), 'Reflect.deleteProperty: symbol');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-non-exported-strict-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-non-exported-strict-strict.js
new file mode 100644
index 0000000000..782360533d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-delete-non-exported-strict-strict.js
@@ -0,0 +1,104 @@
+// |reftest| async
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-delete-non-exported-strict.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[Delete]] behavior for a key that does not describe an exported binding (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, onlyStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryDelete(O, P).
+ 3. Let exports be O.[[Exports]].
+ 4. If P is an element of exports, return false.
+ 5. Return true.
+
+---*/
+
+import('./empty_FIXTURE.js').then(ns => {
+
+ assert(delete ns.undef, 'delete: undef');
+ assert(Reflect.deleteProperty(ns, 'undef'), 'Reflect.deleteProperty: undef');
+
+ assert(delete ns.default, 'delete: default');
+ assert(
+ Reflect.deleteProperty(ns, 'default'), 'Reflect.deleteProperty: default'
+ );
+
+ assert.sameValue(
+ Reflect.deleteProperty(ns, Symbol.toStringTag), false,
+ 'Reflect.deleteProperty: Symbol.toStringTag'
+ );
+ assert.throws(TypeError, function() { delete ns[Symbol.toStringTag]; }, 'delete: Symbol.toStringTag');
+
+ var sym = Symbol('test262');
+ assert(delete ns[sym], 'delete: symbol');
+ assert(Reflect.deleteProperty(ns, sym), 'Reflect.deleteProperty: symbol');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-extensible.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-extensible.js
new file mode 100644
index 0000000000..5978629216
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-extensible.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-extensible.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Module namespace objects are not extensible. (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(Object.isExtensible(ns), false);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-dflt-direct.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-dflt-direct.js
new file mode 100644
index 0000000000..2c7205228b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-dflt-direct.js
@@ -0,0 +1,125 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-nested-namespace-dflt-direct.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Direct Default exports are included in an imported module namespace object when a namespace object is created. (value from promise then)
+esid: sec-finishdynamicimport
+features: [export-star-as-namespace-from-module, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 6. Let binding be ! m.ResolveExport(P, « »).
+ 7. Assert: binding is a ResolvedBinding Record.
+ 8. Let targetModule be binding.[[Module]].
+ 9. Assert: targetModule is not undefined.
+ 10. If binding.[[BindingName]] is "*namespace*", then
+ 11. Return ? GetModuleNamespace(targetModule).
+
+ Runtime Semantics: GetModuleNamespace
+ [...]
+ 3. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames,
+ i. Let resolution be ? module.ResolveExport(name, « », « »).
+ ii. If resolution is null, throw a SyntaxError exception.
+ iii. If resolution is not "ambiguous", append name to
+ unambiguousNames.
+ d. Let namespace be ModuleNamespaceCreate(module, unambiguousNames).
+ [...]
+
+---*/
+
+import('./get-nested-namespace-dflt-skip-prod_FIXTURE.js').then(ns => {
+
+ var desc = Object.getOwnPropertyDescriptor(ns, 'productionNS2');
+
+ assert.sameValue(desc.enumerable, true, 'ns.productionNS2: is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.productionNS2: is writable');
+ assert.sameValue(desc.configurable, false, 'ns.productionNS2: is non-configurable');
+
+ var keys = Object.getOwnPropertyNames(ns.productionNS2);
+
+ assert.sameValue(keys.length, 2);
+ assert.sameValue(keys[0], 'default');
+ assert.sameValue(keys[1], 'productionOther');
+
+ desc = Object.getOwnPropertyDescriptor(ns.productionNS2, 'productionOther');
+
+ assert.sameValue(desc.value, null, 'ns.productionNS2.productionOther: value is null');
+ assert.sameValue(desc.enumerable, true, 'ns.productionNS2.productionOther: is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.productionNS2.productionOther: is writable');
+ assert.sameValue(desc.configurable, false, 'ns.productionNS2.productionOther: is non-configurable');
+
+ desc = Object.getOwnPropertyDescriptor(ns.productionNS2, 'default');
+
+ assert.sameValue(desc.value, 42, 'ns.productionNS2.default value is 42');
+ assert.sameValue(desc.enumerable, true, 'ns.productionNS2.default is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.productionNS2.default is writable');
+ assert.sameValue(desc.configurable, false, 'ns.productionNS2.default is non-configurable');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-dflt-indirect.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-dflt-indirect.js
new file mode 100644
index 0000000000..57330345b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-dflt-indirect.js
@@ -0,0 +1,125 @@
+// |reftest| module async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-nested-namespace-dflt-indirect.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Inirect Default exports are included in an imported module namespace object when a namespace object is created. (value from promise then)
+esid: sec-finishdynamicimport
+features: [export-star-as-namespace-from-module, dynamic-import]
+flags: [generated, module, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 6. Let binding be ! m.ResolveExport(P, « »).
+ 7. Assert: binding is a ResolvedBinding Record.
+ 8. Let targetModule be binding.[[Module]].
+ 9. Assert: targetModule is not undefined.
+ 10. If binding.[[BindingName]] is "*namespace*", then
+ 11. Return ? GetModuleNamespace(targetModule).
+
+ Runtime Semantics: GetModuleNamespace
+ [...]
+ 3. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames,
+ i. Let resolution be ? module.ResolveExport(name, « », « »).
+ ii. If resolution is null, throw a SyntaxError exception.
+ iii. If resolution is not "ambiguous", append name to
+ unambiguousNames.
+ d. Let namespace be ModuleNamespaceCreate(module, unambiguousNames).
+ [...]
+
+---*/
+
+import('./get-nested-namespace-dflt-skip-named_FIXTURE.js').then(ns => {
+
+ var desc = Object.getOwnPropertyDescriptor(ns, 'namedNS2');
+
+ assert.sameValue(desc.enumerable, true, 'ns.namedNS2: is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.namedNS2: is writable');
+ assert.sameValue(desc.configurable, false, 'ns.namedNS2: is non-configurable');
+
+ var keys = Object.getOwnPropertyNames(ns.namedNS2);
+
+ assert.sameValue(keys.length, 2);
+ assert.sameValue(keys[0], 'default');
+ assert.sameValue(keys[1], 'namedOther');
+
+ desc = Object.getOwnPropertyDescriptor(ns.namedNS2, 'namedOther');
+
+ assert.sameValue(desc.value, null, 'ns.namedNS2.namedOther value is null');
+ assert.sameValue(desc.enumerable, true, 'ns.namedNS2.namedOther: is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.namedNS2.namedOther: is writable');
+ assert.sameValue(desc.configurable, false, 'ns.namedNS2.namedOther: is non-configurable');
+
+ desc = Object.getOwnPropertyDescriptor(ns.namedNS2, 'default');
+
+ assert.sameValue(desc.value, 42, 'ns.namedNS2.default value is 42');
+ assert.sameValue(desc.enumerable, true, 'ns.namedNS2.default is enumerable');
+ assert.sameValue(desc.writable, true, 'ns.namedNS2.default is writable');
+ assert.sameValue(desc.configurable, false, 'ns.namedNS2.default is non-configurable');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-props-nrml.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-props-nrml.js
new file mode 100644
index 0000000000..07d0fd4f67
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-nested-namespace-props-nrml.js
@@ -0,0 +1,122 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-nested-namespace-props-nrml.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Module namespace object reports properties for all ExportEntries of all dependencies. (value from promise then)
+esid: sec-finishdynamicimport
+features: [export-star-as-namespace-from-module, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 12. For each ImportEntry Record in in module.[[ImportEntries]], do
+ a. Let importedModule be ? HostResolveImportedModule(module,
+ in.[[ModuleRequest]]).
+ b. If in.[[ImportName]] is "*", then
+ i. Let namespace be ? GetModuleNamespace(importedModule).
+ [...]
+
+ Runtime Semantics: GetModuleNamespace
+ 3. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames,
+ i. Let resolution be ? module.ResolveExport(name, « », « »).
+ ii. If resolution is null, throw a SyntaxError exception.
+ iii. If resolution is not "ambiguous", append name to
+ unambiguousNames.
+ d. Let namespace be ModuleNamespaceCreate(module, unambiguousNames).
+
+---*/
+function hasOwnProperty(obj, property) {
+ return Object.prototype.hasOwnProperty.call(obj, property);
+}
+
+
+import('./get-nested-namespace-props-nrml-1_FIXTURE.js').then(ns => {
+
+ // Export entries defined by a re-exported as exportns module
+ assert(hasOwnProperty(ns.exportns, 'starAsVarDecl'), 'starssVarDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsLetDecl'), 'starSsLetDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsConstDecl'), 'starSsConstDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsFuncDecl'), 'starAsFuncDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsGenDecl'), 'starAsGenDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsClassDecl'), 'starAsClassDecl');
+ assert(hasOwnProperty(ns.exportns, 'starAsBindingId'), 'starAsBindingId');
+ assert(hasOwnProperty(ns.exportns, 'starIdName'), 'starIdName');
+ assert(hasOwnProperty(ns.exportns, 'starAsIndirectIdName'), 'starAsIndirectIdName');
+ assert(hasOwnProperty(ns.exportns, 'starAsIndirectIdName2'), 'starAsIndirectIdName2');
+ assert(hasOwnProperty(ns.exportns, 'namespaceBinding'), 'namespaceBinding');
+
+ // Bindings that were not exported from any module
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedVar'), false, 'nonExportedVar');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedLet'), false, 'nonExportedLet');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedConst'), false, 'nonExportedConst');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedFunc'), false, 'nonExportedFunc');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedGen'), false, 'nonExportedGen');
+ assert.sameValue(hasOwnProperty(ns.exportns, 'nonExportedClass'), false, 'nonExportedClass');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-str-found-init.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-str-found-init.js
new file mode 100644
index 0000000000..c71519dfe0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-str-found-init.js
@@ -0,0 +1,123 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-own-property-str-found-init.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[GetOwnProperty]] internal method with a string argument describing an initialized binding (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. If Type(P) is Symbol, return OrdinaryGetOwnProperty(O, P).
+ 2. Let exports be the value of O's [[Exports]] internal slot.
+ 3. If P is not an element of exports, return undefined.
+ 4. Let value be ? O.[[Get]](P, O).
+ 5. Return PropertyDescriptor{[[Value]]: value, [[Writable]]: true,
+ [[Enumerable]]: true, [[Configurable]]: false }.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ var desc;
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'local1'), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'local1');
+ assert.sameValue(desc.value, 'Test262');
+ assert.sameValue(desc.enumerable, true, 'local1 enumerable');
+ assert.sameValue(desc.writable, true, 'local1 writable');
+ assert.sameValue(desc.configurable, false, 'local1 configurable');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'renamed'), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'renamed');
+ assert.sameValue(desc.value, 'TC39');
+ assert.sameValue(desc.enumerable, true, 'renamed enumerable');
+ assert.sameValue(desc.writable, true, 'renamed writable');
+ assert.sameValue(desc.configurable, false, 'renamed configurable');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'indirect'), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'indirect');
+ assert.sameValue(desc.value, 'Test262');
+ assert.sameValue(desc.enumerable, true, 'indirect enumerable');
+ assert.sameValue(desc.writable, true, 'indirect writable');
+ assert.sameValue(desc.configurable, false, 'indirect configurable');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'default'), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'default');
+ assert.sameValue(desc.value, 42);
+ assert.sameValue(desc.enumerable, true, 'default enumerable');
+ assert.sameValue(desc.writable, true, 'default writable');
+ assert.sameValue(desc.configurable, false, 'default configurable');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-str-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-str-not-found.js
new file mode 100644
index 0000000000..b171ee36a6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-str-not-found.js
@@ -0,0 +1,116 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-own-property-str-not-found.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[GetOwnProperty]] internal method with a string argument describing a binding that cannot be found (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. If Type(P) is Symbol, return OrdinaryGetOwnProperty(O, P).
+ 2. Let exports be the value of O's [[Exports]] internal slot.
+ 3. If P is not an element of exports, return undefined.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ var desc;
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'local2'),
+ false,
+ 'hasOwnProperty: local2'
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'local2');
+ assert.sameValue(desc, undefined, 'property descriptor for "local2"');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'toStringTag'),
+ false,
+ 'hasOwnProperty: toStringTag'
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'toStringTag');
+ assert.sameValue(desc, undefined, 'property descriptor for "toStringTag"');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, 'iterator'),
+ false,
+ 'hasOwnProperty: iterator'
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, 'iterator');
+ assert.sameValue(desc, undefined, 'property descriptor for "iterator"');
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, '__proto__'),
+ false,
+ 'hasOwnProperty: __proto__'
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, '__proto__');
+ assert.sameValue(desc, undefined, 'property descriptor for "__proto__"');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-sym.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-sym.js
new file mode 100644
index 0000000000..7cec74f55d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-own-property-sym.js
@@ -0,0 +1,94 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-own-property-sym.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[GetOwnProperty]] internal method with a Symbol argument (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+var notFound = Symbol('test262');
+
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ var desc;
+
+ assert.sameValue(
+ Object.prototype.hasOwnProperty.call(ns, Symbol.toStringTag), true
+ );
+ desc = Object.getOwnPropertyDescriptor(ns, Symbol.toStringTag);
+ assert.sameValue(desc.value, ns[Symbol.toStringTag]);
+ assert.sameValue(desc.enumerable, false, 'Symbol.toStringTag enumerable');
+ assert.sameValue(desc.writable, false, 'Symbol.toStringTag writable');
+ assert.sameValue(desc.configurable, false, 'Symbol.toStringTag configurable');
+
+ assert.sameValue(Object.prototype.hasOwnProperty.call(ns, notFound), false);
+ desc = Object.getOwnPropertyDescriptor(ns, notFound);
+ assert.sameValue(desc, undefined);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-str-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-str-found.js
new file mode 100644
index 0000000000..e3945478e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-str-found.js
@@ -0,0 +1,87 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-str-found.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[Get]] internal method with a string argument for exported initialized bindings. (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 12. Let targetEnvRec be targetEnv's EnvironmentRecord.
+ 13. Return ? targetEnvRec.GetBindingValue(binding.[[BindingName]], true).
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(ns.local1, 'Test262');
+ assert.sameValue(ns.renamed, 'TC39');
+ assert.sameValue(ns.indirect, 'Test262');
+ assert.sameValue(ns.default, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-str-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-str-not-found.js
new file mode 100644
index 0000000000..fc013a8e6a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-str-not-found.js
@@ -0,0 +1,89 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-str-not-found.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[Get]] internal method with a string argument for non-exported bindings (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 3. Let exports be the value of O's [[Exports]] internal slot.
+ 4. If P is not an element of exports, return undefined.
+
+---*/
+var local2; // not used
+
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(ns.local2, undefined, 'key: local2');
+ assert.sameValue(ns.toStringTag, undefined, 'key: toStringTag');
+ assert.sameValue(ns.iterator, undefined, 'key: iterator');
+ assert.sameValue(ns.__proto__, undefined, 'key: __proto__');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-sym-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-sym-found.js
new file mode 100644
index 0000000000..847c9a0568
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-sym-found.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-sym-found.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[Get]] internal method with a symbol argument that can be found (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryGet(O, P, Receiver).
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(typeof ns[Symbol.toStringTag], 'string');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-sym-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-sym-not-found.js
new file mode 100644
index 0000000000..b887351ee5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-get-sym-not-found.js
@@ -0,0 +1,84 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-get-sym-not-found.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[Get]] internal method with a symbol argument that cannot be found (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. If Type(P) is Symbol, then
+ a. Return ? OrdinaryGet(O, P, Receiver).
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(ns[Symbol('test262')], undefined, 'Symbol: test262');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-str-found-init.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-str-found-init.js
new file mode 100644
index 0000000000..eb8d24df60
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-str-found-init.js
@@ -0,0 +1,94 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-has-property-str-found-init.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[HasProperty]] internal method with a string argument for exported initialized bindings. (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. Let exports be the value of O's [[Exports]] internal slot.
+ 3. If P is an element of exports, return true.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert('local1' in ns, 'in: local1');
+ assert(Reflect.has(ns, 'local1'), 'Reflect.has: local1');
+
+ assert('renamed' in ns, 'in: renamed');
+ assert(Reflect.has(ns, 'renamed'), 'Reflect.has: renamed');
+
+ assert('indirect' in ns, 'in: indirect');
+ assert(Reflect.has(ns, 'indirect'), 'Reflect.has: indirect');
+
+ assert('default' in ns, 'in: default');
+ assert(Reflect.has(ns, 'default'), 'Reflect.has: default');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-str-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-str-not-found.js
new file mode 100644
index 0000000000..fc548a6afa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-str-not-found.js
@@ -0,0 +1,101 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-has-property-str-not-found.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[HasProperty]] internal method with a string argument for non-exported bindings (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ [...]
+ 2. Let exports be the value of O's [[Exports]] internal slot.
+ 3. If P is an element of exports, return true.
+ 4. Return false.
+
+---*/
+var local2; // not used
+
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue('local2' in ns, false, 'in: local2');
+ assert.sameValue(Reflect.has(ns, 'local2'), false, 'Reflect.has: local2');
+
+ assert.sameValue('toStringTag' in ns, false, 'in: toStringTag');
+ assert.sameValue(
+ Reflect.has(ns, 'toStringTag'), false, 'Reflect.has: toStringTag'
+ );
+
+ assert.sameValue('iterator' in ns, false, 'in: iterator');
+ assert.sameValue(Reflect.has(ns, 'iterator'), false, 'Reflect.has: iterator');
+
+ assert.sameValue('__proto__' in ns, false, 'in: __proto__');
+ assert.sameValue(
+ Reflect.has(ns, '__proto__'), false, 'Reflect.has: __proto__'
+ );
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-sym-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-sym-found.js
new file mode 100644
index 0000000000..f22014c83a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-sym-found.js
@@ -0,0 +1,83 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-has-property-sym-found.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[HasProperty]] internal method with a symbol argument that can be found (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. If Type(P) is Symbol, return OrdinaryHasProperty(O, P).
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert(Symbol.toStringTag in ns, 'in: Symbol.toStringTag');
+ assert(Reflect.has(ns, Symbol.toStringTag), 'Reflect.has: Symbol.toStringTag');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-sym-not-found.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-sym-not-found.js
new file mode 100644
index 0000000000..4fa6d5493d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-has-property-sym-not-found.js
@@ -0,0 +1,85 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-has-property-sym-not-found.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Behavior of the [[HasProperty]] internal method with a symbol argument that cannot be found (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. If Type(P) is Symbol, return OrdinaryHasProperty(O, P).
+
+---*/
+var sym = Symbol('test262');
+
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(sym in ns, false, 'in');
+ assert.sameValue(Reflect.has(ns, sym), false, 'Reflect.has');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-no-iterator.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-no-iterator.js
new file mode 100644
index 0000000000..b15ff59470
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-no-iterator.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-no-iterator.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Module namespace objects lack a Symbol.toStringTag (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol.iterator, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(Object.prototype.hasOwnProperty.call(ns, Symbol.iterator), false);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-own-property-keys-sort.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-own-property-keys-sort.js
new file mode 100644
index 0000000000..cf0cf65c9d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-own-property-keys-sort.js
@@ -0,0 +1,129 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-own-property-keys-sort.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[OwnPropertyKeys]] internal method reflects the sorted order (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol.toStringTag, dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Let exports be a copy of the value of O's [[Exports]] internal slot.
+ 2. Let symbolKeys be ! OrdinaryOwnPropertyKeys(O).
+ 3. Append all the entries of symbolKeys to the end of exports.
+ 4. Return exports.
+
+---*/
+
+import('./own-keys-sort_FIXTURE.js').then(ns => {
+
+ var stringKeys = Object.getOwnPropertyNames(ns);
+
+ assert.sameValue(stringKeys.length, 16);
+ assert.sameValue(stringKeys[0], '$', 'stringKeys[0] === "$"');
+ assert.sameValue(stringKeys[1], '$$', 'stringKeys[1] === "$$"');
+ assert.sameValue(stringKeys[2], 'A', 'stringKeys[2] === "A"');
+ assert.sameValue(stringKeys[3], 'Z', 'stringKeys[3] === "Z"');
+ assert.sameValue(stringKeys[4], '_', 'stringKeys[4] === "_"');
+ assert.sameValue(stringKeys[5], '__', 'stringKeys[5] === "__"');
+ assert.sameValue(stringKeys[6], 'a', 'stringKeys[6] === "a"');
+ assert.sameValue(stringKeys[7], 'aa', 'stringKeys[7] === "aa"');
+ assert.sameValue(stringKeys[8], 'az', 'stringKeys[8] === "az"');
+ assert.sameValue(stringKeys[9], 'default', 'stringKeys[9] === "default"');
+ assert.sameValue(stringKeys[10], 'z', 'stringKeys[10] === "z"');
+ assert.sameValue(stringKeys[11], 'za', 'stringKeys[11] === "za"');
+ assert.sameValue(stringKeys[12], 'zz', 'stringKeys[12] === "zz"');
+ assert.sameValue(stringKeys[13], '\u03bb', 'stringKeys[13] === "\u03bb"');
+ assert.sameValue(stringKeys[14], '\u03bc', 'stringKeys[14] === "\u03bc"');
+ assert.sameValue(stringKeys[15], '\u03c0', 'stringKeys[15] === "\u03c0"');
+
+ var allKeys = Reflect.ownKeys(ns);
+ assert(
+ allKeys.length >= 17,
+ 'at least as many keys as defined by the module and the specification'
+ );
+ assert.sameValue(allKeys[0], '$', 'allKeys[0] === "$"');
+ assert.sameValue(allKeys[1], '$$', 'allKeys[1] === "$$"');
+ assert.sameValue(allKeys[2], 'A', 'allKeys[2] === "A"');
+ assert.sameValue(allKeys[3], 'Z', 'allKeys[3] === "Z"');
+ assert.sameValue(allKeys[4], '_', 'allKeys[4] === "_"');
+ assert.sameValue(allKeys[5], '__', 'allKeys[5] === "__"');
+ assert.sameValue(allKeys[6], 'a', 'allKeys[6] === "a"');
+ assert.sameValue(allKeys[7], 'aa', 'allKeys[7] === "aa"');
+ assert.sameValue(allKeys[8], 'az', 'allKeys[8] === "az"');
+ assert.sameValue(allKeys[9], 'default', 'allKeys[9] === "default"');
+ assert.sameValue(allKeys[10], 'z', 'allKeys[10] === "z"');
+ assert.sameValue(allKeys[11], 'za', 'allKeys[11] === "za"');
+ assert.sameValue(allKeys[12], 'zz', 'allKeys[12] === "zz"');
+ assert.sameValue(allKeys[13], '\u03bb', 'allKeys[13] === "\u03bb"');
+ assert.sameValue(allKeys[14], '\u03bc', 'allKeys[14] === "\u03bc"');
+ assert.sameValue(allKeys[15], '\u03c0', 'allKeys[15] === "\u03c0"');
+ assert(
+ allKeys.indexOf(Symbol.toStringTag) > 15,
+ 'keys array includes Symbol.toStringTag'
+ );
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prevent-extensions-object.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prevent-extensions-object.js
new file mode 100644
index 0000000000..20f425acee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prevent-extensions-object.js
@@ -0,0 +1,82 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-prevent-extensions-object.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[PreventExtensions]] internal method returns `true` (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+import('./empty_FIXTURE.js').then(ns => {
+
+ // This invocation should not throw an exception
+ Object.preventExtensions(ns);
+
+ assert.sameValue(Reflect.preventExtensions(ns), true);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prevent-extensions-reflect.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prevent-extensions-reflect.js
new file mode 100644
index 0000000000..afbdc8e7df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prevent-extensions-reflect.js
@@ -0,0 +1,79 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-prevent-extensions-reflect.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[PreventExtensions]] internal method returns `true` (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+import('./empty_FIXTURE.js').then(ns => {
+
+ assert.sameValue(Reflect.preventExtensions(ns), true);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prop-descs.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prop-descs.js
new file mode 100644
index 0000000000..5cf35f9427
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prop-descs.js
@@ -0,0 +1,109 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-prop-descs.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: imported object properties descriptors (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ // propertyHelper.js is not appropriate for this test because it assumes that
+ // the object exposes the ordinary object's implementation of [[Get]], [[Set]],
+// [[Delete]], and [[OwnPropertyKeys]], which the module namespace exotic
+// object does not.
+var desc = Object.getOwnPropertyDescriptor(ns, 'default');
+
+assert.sameValue(desc.value, 42, 'default: value is 42');
+assert.sameValue(desc.enumerable, true, 'default: is enumerable');
+assert.sameValue(desc.writable, true, 'default: is writable');
+assert.sameValue(desc.configurable, false, 'default: is non-configurable');
+
+desc = Object.getOwnPropertyDescriptor(ns, 'local1');
+
+assert.sameValue(desc.value, 'Test262', 'local1: value is "Test262"');
+assert.sameValue(desc.enumerable, true, 'local1: is enumerable');
+assert.sameValue(desc.writable, true, 'local1: is writable');
+assert.sameValue(desc.configurable, false, 'local1: is non-configurable');
+
+desc = Object.getOwnPropertyDescriptor(ns, 'renamed');
+
+assert.sameValue(desc.value, 'TC39', 'renamed: value is TC39"');
+assert.sameValue(desc.enumerable, true, 'renamed: is enumerable');
+assert.sameValue(desc.writable, true, 'renamed: is writable');
+assert.sameValue(desc.configurable, false, 'renamed: is non-configurable');
+
+desc = Object.getOwnPropertyDescriptor(ns, 'indirect');
+
+assert.sameValue(desc.value, 'Test262', 'indirect: value is Test262"');
+assert.sameValue(desc.enumerable, true, 'indirect: is enumerable');
+assert.sameValue(desc.writable, true, 'indirect: is writable');
+assert.sameValue(desc.configurable, false, 'indirect: is non-configurable');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prototype.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prototype.js
new file mode 100644
index 0000000000..7ab7e524e0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-prototype.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-prototype.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: Module namespace object prototype is null (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(ns instanceof Object, false);
+ assert.sameValue(Object.getPrototypeOf(ns), null, 'prototype is null');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-no-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-no-strict.js
new file mode 100644
index 0000000000..cdd3bfb82e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-no-strict.js
@@ -0,0 +1,107 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-no-strict.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[Set]] internal method consistently returns `false`, No Strict Mode (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, noStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Return false.
+
+---*/
+var sym = Symbol('test262');
+
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(Reflect.set(ns, 'local1'), false, 'Reflect.set: local1');
+ assert.sameValue(ns.local1 = null, null, 'AssignmentExpression: local1');
+
+ assert.sameValue(Reflect.set(ns, 'local2'), false, 'Reflect.set: local2');
+ assert.sameValue(ns.local2 = null, null, 'AssignmentExpression: local2');
+
+ assert.sameValue(Reflect.set(ns, 'renamed'), false, 'Reflect.set: renamed');
+ assert.sameValue(ns.renamed = null, null, 'AssignmentExpression: renamed');
+
+ assert.sameValue(Reflect.set(ns, 'indirect'), false, 'Reflect.set: indirect');
+ assert.sameValue(ns.indirect = null, null, 'AssignmentExpression: indirect');
+
+ assert.sameValue(Reflect.set(ns, 'default'), false, 'Reflect.set: default');
+ assert.sameValue(ns.default = null, null, 'AssignmentExpression: default');
+
+ assert.sameValue(
+ Reflect.set(ns, Symbol.toStringTag, null),
+ false,
+ 'Reflect.set: Symbol.toStringTag'
+ );
+ assert.sameValue(ns[Symbol.toStringTag] = null, null, 'AssignmentExpression: Symbol.toStringTag');
+
+ assert.sameValue(Reflect.set(ns, sym), false, 'Reflect.set: sym');
+ assert.sameValue(ns[sym] = null, null, 'AssignmentExpression: sym');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-prototype-of-null.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-prototype-of-null.js
new file mode 100644
index 0000000000..f5416c4e5b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-prototype-of-null.js
@@ -0,0 +1,80 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-prototype-of-null.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[SetPrototypeOf]] internal method returns `true` if passed `null` (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+import('./empty_FIXTURE.js').then(ns => {
+
+ assert.sameValue(typeof Object.setPrototypeOf, 'function');
+ assert.sameValue(ns, Object.setPrototypeOf(ns, null));
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-prototype-of.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-prototype-of.js
new file mode 100644
index 0000000000..6ad38c4bc7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-prototype-of.js
@@ -0,0 +1,85 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-prototype-of.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[SetPrototypeOf]] internal method returns `false` (value from promise then)
+esid: sec-finishdynamicimport
+features: [dynamic-import]
+flags: [generated, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ var newProto = {};
+
+ assert.sameValue(typeof Object.setPrototypeOf, 'function');
+
+ assert.throws(TypeError, function() {
+ Object.setPrototypeOf(ns, newProto);
+ });
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-same-values-no-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-same-values-no-strict.js
new file mode 100644
index 0000000000..436c90da33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-same-values-no-strict.js
@@ -0,0 +1,99 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-same-values-no-strict.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[Set]] internal method consistently returns `false` even setting the same value - No Strict Mode (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, noStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Return false.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(Reflect.set(ns, 'local1', 'Test262'), false, 'Reflect.set: local1');
+ assert.sameValue(ns.local1 = 'Test262', 'Test262', 'AssignmentExpression: local1');
+
+ assert.sameValue(Reflect.set(ns, 'renamed', 'TC39'), false, 'Reflect.set: renamed');
+ assert.sameValue(ns.renamed = 'TC39', 'TC39', 'AssignmentExpression: renamed');
+
+ assert.sameValue(Reflect.set(ns, 'indirect', 'Test262'), false, 'Reflect.set: indirect');
+ assert.sameValue(ns.indirect = 'Test262', 'Test262', 'AssignmentExpression: indirect');
+
+ assert.sameValue(Reflect.set(ns, 'default', 42), false, 'Reflect.set: default');
+ assert.sameValue(ns.default = 42, 42, 'AssignmentExpression: default');
+
+ assert.sameValue(
+ Reflect.set(ns, Symbol.toStringTag, ns[Symbol.toStringTag]),
+ false,
+ 'Reflect.set: Symbol.toStringTag'
+ );
+ assert.sameValue(ns[Symbol.toStringTag] = ns[Symbol.toStringTag], 'Module', 'AssignmentExpression: Symbol.toStringTag');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-same-values-strict-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-same-values-strict-strict.js
new file mode 100644
index 0000000000..8cfce72270
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-same-values-strict-strict.js
@@ -0,0 +1,110 @@
+// |reftest| async
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-same-values-strict.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[Set]] internal method consistently returns `false` even setting the same value - Strict Mode (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, onlyStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Return false.
+
+---*/
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(Reflect.set(ns, 'local1', 'Test262'), false, 'Reflect.set: local1');
+ assert.throws(TypeError, function() {
+ ns.local1 = 'Test262';
+ }, 'AssignmentExpression: local1');
+
+ assert.sameValue(Reflect.set(ns, 'renamed', 'TC39'), false, 'Reflect.set: renamed');
+ assert.throws(TypeError, function() {
+ ns.renamed = 'TC39';
+ }, 'AssignmentExpression: renamed');
+
+ assert.sameValue(Reflect.set(ns, 'indirect', 'Test262'), false, 'Reflect.set: indirect');
+ assert.throws(TypeError, function() {
+ ns.indirect = 'Test262';
+ }, 'AssignmentExpression: indirect');
+
+ assert.sameValue(Reflect.set(ns, 'default', 42), false, 'Reflect.set: default');
+ assert.throws(TypeError, function() {
+ ns.default = 42;
+ }, 'AssignmentExpression: default');
+
+ assert.sameValue(
+ Reflect.set(ns, Symbol.toStringTag, ns[Symbol.toStringTag]),
+ false,
+ 'Reflect.set: Symbol.toStringTag'
+ );
+ assert.throws(TypeError, function() {
+ ns[Symbol.toStringTag] = ns[Symbol.toStringTag];
+ }, 'AssignmentExpression: Symbol.toStringTag');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-strict-strict.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-strict-strict.js
new file mode 100644
index 0000000000..02ad976bee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/promise-then-ns-set-strict-strict.js
@@ -0,0 +1,122 @@
+// |reftest| async
+'use strict';
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/ns-set-strict.case
+// - src/dynamic-import/namespace/promise.template
+/*---
+description: The [[Set]] internal method consistently returns `false`, Strict Mode (value from promise then)
+esid: sec-finishdynamicimport
+features: [Symbol, Symbol.toStringTag, dynamic-import]
+flags: [generated, onlyStrict, async]
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ a. Let exportedNames be ? module.GetExportedNames(« »).
+ b. Let unambiguousNames be a new empty List.
+ c. For each name that is an element of exportedNames, do
+ i. Let resolution be ? module.ResolveExport(name, « »).
+ ii. If resolution is a ResolvedBinding Record, append name to unambiguousNames.
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+
+ ModuleNamespaceCreate ( module, exports )
+
+ ...
+ 4. Let M be a newly created object.
+ 5. Set M's essential internal methods to the definitions specified in 9.4.6.
+ 7. Let sortedExports be a new List containing the same values as the list exports where the
+ values are ordered as if an Array of the same values had been sorted using Array.prototype.sort
+ using undefined as comparefn.
+ 8. Set M.[[Exports]] to sortedExports.
+ 9. Create own properties of M corresponding to the definitions in 26.3.
+ 10. Set module.[[Namespace]] to M.
+ 11. Return M.
+
+ 26.3 Module Namespace Objects
+
+ A Module Namespace Object is a module namespace exotic object that provides runtime
+ property-based access to a module's exported bindings. There is no constructor function for
+ Module Namespace Objects. Instead, such an object is created for each module that is imported
+ by an ImportDeclaration that includes a NameSpaceImport.
+
+ In addition to the properties specified in 9.4.6 each Module Namespace Object has the
+ following own property:
+
+ 26.3.1 @@toStringTag
+
+ The initial value of the @@toStringTag property is the String value "Module".
+
+ This property has the attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: false }.
+
+ Module Namespace Exotic Objects
+
+ A module namespace object is an exotic object that exposes the bindings exported from an
+ ECMAScript Module (See 15.2.3). There is a one-to-one correspondence between the String-keyed
+ own properties of a module namespace exotic object and the binding names exported by the
+ Module. The exported bindings include any bindings that are indirectly exported using export *
+ export items. Each String-valued own property key is the StringValue of the corresponding
+ exported binding name. These are the only String-keyed properties of a module namespace exotic
+ object. Each such property has the attributes { [[Writable]]: true, [[Enumerable]]: true,
+ [[Configurable]]: false }. Module namespace objects are not extensible.
+
+
+ 1. Return false.
+
+---*/
+var sym = Symbol('test262');
+
+
+import('./module-code_FIXTURE.js').then(ns => {
+
+ assert.sameValue(Reflect.set(ns, 'local1'), false, 'Reflect.set: local1');
+ assert.throws(TypeError, function() {
+ ns.local1 = null;
+ }, 'AssignmentExpression: local1');
+
+ assert.sameValue(Reflect.set(ns, 'local2'), false, 'Reflect.set: local2');
+ assert.throws(TypeError, function() {
+ ns.local2 = null;
+ }, 'AssignmentExpression: local2');
+
+ assert.sameValue(Reflect.set(ns, 'renamed'), false, 'Reflect.set: renamed');
+ assert.throws(TypeError, function() {
+ ns.renamed = null;
+ }, 'AssignmentExpression: renamed');
+
+ assert.sameValue(Reflect.set(ns, 'indirect'), false, 'Reflect.set: indirect');
+ assert.throws(TypeError, function() {
+ ns.indirect = null;
+ }, 'AssignmentExpression: indirect');
+
+ assert.sameValue(Reflect.set(ns, 'default'), false, 'Reflect.set: default');
+ assert.throws(TypeError, function() {
+ ns.default = null;
+ }, 'AssignmentExpression: default');
+
+ assert.sameValue(
+ Reflect.set(ns, Symbol.toStringTag, null),
+ false,
+ 'Reflect.set: Symbol.toStringTag'
+ );
+ assert.throws(TypeError, function() {
+ ns[Symbol.toStringTag] = null;
+ }, 'AssignmentExpression: Symbol.toStringTag');
+
+ assert.sameValue(Reflect.set(ns, sym), false, 'Reflect.set: sym');
+ assert.throws(TypeError, function() {
+ ns[sym] = null;
+ }, 'AssignmentExpression: sym');
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/namespace/shell.js b/js/src/tests/test262/language/expressions/dynamic-import/namespace/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/namespace/shell.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/returns-promise.js b/js/src/tests/test262/language/expressions/dynamic-import/returns-promise.js
new file mode 100644
index 0000000000..e184297af9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/returns-promise.js
@@ -0,0 +1,55 @@
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall returns a promise
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ Import Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+features: [dynamic-import]
+includes: [fnGlobalObject.js]
+---*/
+
+const originalPromise = Promise;
+
+fnGlobalObject().Promise = function() {
+ throw "This should not be called";
+};
+
+const p = import('./dynamic-import-module_FIXTURE.js');
+
+assert.sameValue(p.constructor, originalPromise, 'constructor is %Promise%');
+assert.sameValue(Object.getPrototypeOf(p), originalPromise.prototype, 'prototype is %PromisePrototype%');
+assert.sameValue(p.then, originalPromise.prototype.then, 'preserves the original `then` method');
+assert.sameValue(p.catch, originalPromise.prototype.catch, 'preserves the original `catch` method');
+assert.sameValue(p.finally, originalPromise.prototype.finally, 'preserves the original `finally` method');
+
+assert.sameValue(
+ Object.prototype.hasOwnProperty.call(p, 'then'), false,
+ 'returned promise has no own property then'
+);
+
+assert.sameValue(
+ Object.prototype.hasOwnProperty.call(p, 'catch'), false,
+ 'returned promise has no own property catch'
+);
+
+assert.sameValue(
+ Object.prototype.hasOwnProperty.call(p, 'finally'), false,
+ 'returned promise has no own property finally'
+);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object-from-import.js b/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object-from-import.js
new file mode 100644
index 0000000000..92b2a36307
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object-from-import.js
@@ -0,0 +1,39 @@
+// |reftest| module async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Reuse the resolved namespace object already imported from a static import
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ ...
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+features: [dynamic-import]
+flags: [async, module]
+---*/
+
+import * as ns from './module-code_FIXTURE.js';
+
+Promise.all([
+ import('./module-code_FIXTURE.js'),
+ import('./module-code_FIXTURE.js'),
+]).then(([a, b]) => {
+ assert.sameValue(a, b, 'it returns the same namespace are the same');
+ assert.sameValue(a, ns, 'dynamic imported a is the same object as ns');
+ assert.sameValue(b, ns, 'dynamic imported b is the same object as ns');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object-from-script.js b/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object-from-script.js
new file mode 100644
index 0000000000..c95e9fc569
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object-from-script.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Reuse the resolved namespace object from a script code.
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ ...
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+features: [dynamic-import]
+flags: [async]
+---*/
+
+// empty_FIXTURE.js does not export anything, so it wouldn't suit for a module code exported namespace
+// we use this to assume it's a close example to a script code imported.
+Promise.all([
+ import('./empty_FIXTURE.js'),
+ import('./empty_FIXTURE.js'),
+]).then(([a, b]) => {
+ assert.sameValue(a, b, 'it returns the same namespace are the same');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object.js b/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object.js
new file mode 100644
index 0000000000..bd1d5dfdf5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/reuse-namespace-object.js
@@ -0,0 +1,35 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Reuse the resolved namespace object instead of creating a new one
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 1. If completion is an abrupt completion, ...
+ 2. Otherwise,
+ ...
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ e. If namespace is an abrupt completion, perform ! Call(promiseCapability.[[Reject]], undefined, « namespace.[[Value]] »).
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+
+ Runtime Semantics: GetModuleNamespace ( module )
+
+ ...
+ 3. Let namespace be module.[[Namespace]].
+ 4. If namespace is undefined, then
+ ...
+ d. Set namespace to ModuleNamespaceCreate(module, unambiguousNames).
+ 5. Return namespace.
+features: [dynamic-import]
+flags: [async]
+---*/
+
+Promise.all([
+ import('./dynamic-import-module_FIXTURE.js'),
+ import('./dynamic-import-module_FIXTURE.js'),
+]).then(([a, b]) => {
+ assert.sameValue(a, b, 'it returns the same namespace are the same');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/shell.js b/js/src/tests/test262/language/expressions/dynamic-import/shell.js
new file mode 100644
index 0000000000..d109217fc3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/shell.js
@@ -0,0 +1,127 @@
+// GENERATED, DO NOT EDIT
+// file: asyncHelpers.js
+// Copyright (C) 2022 Igalia, S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: |
+ A collection of assertion and wrapper functions for testing asynchronous built-ins.
+defines: [asyncTest]
+---*/
+
+function asyncTest(testFunc) {
+ if (!Object.hasOwn(globalThis, "$DONE")) {
+ throw new Test262Error("asyncTest called without async flag");
+ }
+ if (typeof testFunc !== "function") {
+ $DONE(new Test262Error("asyncTest called with non-function argument"));
+ return;
+ }
+ try {
+ testFunc().then(
+ function () {
+ $DONE();
+ },
+ function (error) {
+ $DONE(error);
+ }
+ );
+ } catch (syncError) {
+ $DONE(syncError);
+ }
+}
+
+assert.throwsAsync = async function (expectedErrorConstructor, func, message) {
+ var innerThenable;
+ if (message === undefined) {
+ message = "";
+ } else {
+ message += " ";
+ }
+ if (typeof func === "function") {
+ try {
+ innerThenable = func();
+ if (
+ innerThenable === null ||
+ typeof innerThenable !== "object" ||
+ typeof innerThenable.then !== "function"
+ ) {
+ message +=
+ "Expected to obtain an inner promise that would reject with a" +
+ expectedErrorConstructor.name +
+ " but result was not a thenable";
+ throw new Test262Error(message);
+ }
+ } catch (thrown) {
+ message +=
+ "Expected a " +
+ expectedErrorConstructor.name +
+ " to be thrown asynchronously but an exception was thrown synchronously while obtaining the inner promise";
+ throw new Test262Error(message);
+ }
+ } else {
+ message +=
+ "assert.throwsAsync called with an argument that is not a function";
+ throw new Test262Error(message);
+ }
+
+ try {
+ return innerThenable.then(
+ function () {
+ message +=
+ "Expected a " +
+ expectedErrorConstructor.name +
+ " to be thrown asynchronously but no exception was thrown at all";
+ throw new Test262Error(message);
+ },
+ function (thrown) {
+ var expectedName, actualName;
+ if (typeof thrown !== "object" || thrown === null) {
+ message += "Thrown value was not an object!";
+ throw new Test262Error(message);
+ } else if (thrown.constructor !== expectedErrorConstructor) {
+ expectedName = expectedErrorConstructor.name;
+ actualName = thrown.constructor.name;
+ if (expectedName === actualName) {
+ message +=
+ "Expected a " +
+ expectedName +
+ " but got a different error constructor with the same name";
+ } else {
+ message +=
+ "Expected a " + expectedName + " but got a " + actualName;
+ }
+ throw new Test262Error(message);
+ }
+ }
+ );
+ } catch (thrown) {
+ if (typeof thrown !== "object" || thrown === null) {
+ message +=
+ "Expected a " +
+ expectedErrorConstructor.name +
+ " to be thrown asynchronously but innerThenable synchronously threw a value that was not an object ";
+ } else {
+ message +=
+ "Expected a " +
+ expectedErrorConstructor.name +
+ " to be thrown asynchronously but a " +
+ thrown.constructor.name +
+ " was thrown synchronously";
+ }
+ throw new Test262Error(message);
+ }
+};
+
+// file: fnGlobalObject.js
+// Copyright (C) 2017 Ecma International. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: |
+ Produce a reliable global object
+defines: [fnGlobalObject]
+---*/
+
+var __globalObject = Function("return this;")();
+function fnGlobalObject() {
+ return __globalObject;
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/browser.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/browser.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/browser.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/browser.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-1-update-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-1-update-expression.js
new file mode 100644
index 0000000000..aba3604ece
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-1-update-expression.js
@@ -0,0 +1,47 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and UpdateExpression, but it is an invalid
+ AssginmentTargetType then it should throw a ReferenceError if used in some
+ UpdateExpressions
+esid: prod-ImportCall
+info: |
+ Update Expressions
+ Static Semantics: Early Errors
+
+ UpdateExpression:
+ LeftHandSideExpression++
+ LeftHandSideExpression--
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('')++
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-10-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-10-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..3b9ef13e19
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-10-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') -= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-11-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-11-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..8434417f8b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-11-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') <<= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-12-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-12-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..6ae1cbcba2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-12-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') >>= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-13-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-13-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..6d4cb08c69
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-13-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') >>>= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-14-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-14-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..70b785c26e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-14-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') &= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-15-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-15-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..42b88838da
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-15-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') ^= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-16-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-16-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..2741ceb85c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-16-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') |= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-17-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-17-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..38ef80c35e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-17-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import, exponentiation]
+---*/
+
+$DONOTEVALUATE();
+
+import('') **= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-2-update-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-2-update-expression.js
new file mode 100644
index 0000000000..2903e33be1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-2-update-expression.js
@@ -0,0 +1,47 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and UpdateExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ UpdateExpressions
+esid: prod-ImportCall
+info: |
+ Update Expressions
+ Static Semantics: Early Errors
+
+ UpdateExpression:
+ LeftHandSideExpression++
+ LeftHandSideExpression--
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('')--
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-3-update-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-3-update-expression.js
new file mode 100644
index 0000000000..3b1a82524d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-3-update-expression.js
@@ -0,0 +1,47 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and UnaryExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ UpdateExpressions
+esid: prod-ImportCall
+info: |
+ Update Expressions
+ Static Semantics: Early Errors
+
+ UpdateExpression:
+ ++UnaryExpression
+ --UnaryExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of UnaryExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+++import('')
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-4-update-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-4-update-expression.js
new file mode 100644
index 0000000000..bb16f24300
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-4-update-expression.js
@@ -0,0 +1,47 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and UnaryExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ UpdateExpressions
+esid: prod-ImportCall
+info: |
+ Update Expressions
+ Static Semantics: Early Errors
+
+ UpdateExpression:
+ ++UnaryExpression
+ --UnaryExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of UnaryExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+--import('')
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-5-lhs-equals-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-5-lhs-equals-assignment-expression.js
new file mode 100644
index 0000000000..bac627ea43
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-5-lhs-equals-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') = 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-6-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-6-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..5f25575406
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-6-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') *= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-7-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-7-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..77a203add2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-7-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') /= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-8-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-8-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..a4626d5107
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-8-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') %= 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-9-lhs-assignment-operator-assignment-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-9-lhs-assignment-operator-assignment-expression.js
new file mode 100644
index 0000000000..b33e06f591
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/invalid-assignmenttargettype-syntax-error-9-lhs-assignment-operator-assignment-expression.js
@@ -0,0 +1,49 @@
+// |reftest| error:SyntaxError
+// 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 valid CallExpression and LHSExpression, but it is an invalid
+ AssginmentTargetType then it should throw a SyntaxError if used in some
+ LHS Expression of a AssignmentExpression production
+esid: prod-ImportCall
+info: |
+ Assignment Operators
+ Static Semantics: Early Errors
+
+ AssignmentExpression : LeftHandSideExpression = AssignmentExpression
+
+ - It is an early Syntax Error if LeftHandSideExpression is neither an ObjectLiteral nor an ArrayLiteral and AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ AssignmentExpression : LeftHandSideExpression AssignmentOperator AssignmentExpression
+
+ - It is an early Syntax Error if AssignmentTargetType of LeftHandSideExpression is invalid or strict.
+
+ LeftHandSideExpression:
+ NewExpression
+ CallExpression
+
+ CallExpression:
+ ImportCall
+
+ Left-Hand-Side Expressions
+ Static Semantics: AssignmentTargetType
+ #sec-static-semantics-static-semantics-assignmenttargettype
+
+ CallExpression :
+ MemberExpressionArguments
+ SuperCall
+ ImportCall
+ CallExpressionArguments
+ CallExpressionTemplateLiteral
+
+ 1. Return invalid
+negative:
+ phase: parse
+ type: SyntaxError
+features: [dynamic-import]
+---*/
+
+$DONOTEVALUATE();
+
+import('') += 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..cb1acc4acb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-arrow.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+let f = () => {
+ import();
+};
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..23712cb4cf
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-assignment-expr-not-optional.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+let f = () => import();
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-new-call-expression.js
new file mode 100644
index 0000000000..7cd4d3e324
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-new-call-expression.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+let f = () => new import('');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-rest-param.js
new file mode 100644
index 0000000000..8f04fe283d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-no-rest-param.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+let f = () => import(...['']);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-not-extensible-args.js
new file mode 100644
index 0000000000..1112b567a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-not-extensible-args.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-arrow-assignment-expression.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+let f = () => import('./empty_FIXTURE.js', {}, '');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-new-call-expression.js
new file mode 100644
index 0000000000..145fd3672e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-arrow.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+let f = () => {
+ new import('');
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-rest-param.js
new file mode 100644
index 0000000000..e8d1ffc39c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-arrow.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+let f = () => {
+ import(...['']);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-not-extensible-args.js
new file mode 100644
index 0000000000..61c1a044ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-arrow-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-arrow.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+let f = () => {
+ import('./empty_FIXTURE.js', {}, '');
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..5cd10e9d93
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+(async () => {
+ await import()
+});
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-new-call-expression.js
new file mode 100644
index 0000000000..c06d34440d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+(async () => {
+ await new import('')
+});
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-rest-param.js
new file mode 100644
index 0000000000..222812680e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+(async () => {
+ await import(...[''])
+});
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-not-extensible-args.js
new file mode 100644
index 0000000000..61955088c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+(async () => {
+ await import('./empty_FIXTURE.js', {}, '')
+});
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..a349b15fc8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-assignment-expr-not-optional.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+(async () => await import())
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-new-call-expression.js
new file mode 100644
index 0000000000..6b33cf2e47
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-new-call-expression.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+(async () => await new import(''))
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-rest-param.js
new file mode 100644
index 0000000000..19d0cd94b9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-no-rest-param.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+(async () => await import(...['']))
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-not-extensible-args.js
new file mode 100644
index 0000000000..9b123543f1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-not-extensible-args.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+(async () => await import('./empty_FIXTURE.js', {}, ''))
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..f41d9ff14d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-assignment-expr-not-optional.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-async-function.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ import();
+}
+
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..d1bf625e57
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-async-function-await.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ await import();
+}
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-new-call-expression.js
new file mode 100644
index 0000000000..01d36264f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-async-function-await.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ await new import('');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-rest-param.js
new file mode 100644
index 0000000000..dbf1c62cfa
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-async-function-await.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ await import(...['']);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-not-extensible-args.js
new file mode 100644
index 0000000000..62ec93fe04
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-async-function-await.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ await import('./empty_FIXTURE.js', {}, '');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-new-call-expression.js
new file mode 100644
index 0000000000..0f1c9fe21b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-new-call-expression.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-async-function.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ new import('');
+}
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-rest-param.js
new file mode 100644
index 0000000000..d63e9c9c5f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-no-rest-param.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-async-function.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ import(...['']);
+}
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-not-extensible-args.js
new file mode 100644
index 0000000000..1373d34d56
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-not-extensible-args.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-async-function.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ import('./empty_FIXTURE.js', {}, '');
+}
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..a78a8a821b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-assignment-expr-not-optional.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ return await import();
+}
+
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-new-call-expression.js
new file mode 100644
index 0000000000..af7017f8e5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-new-call-expression.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ return await new import('');
+}
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-rest-param.js
new file mode 100644
index 0000000000..48d4cc8c50
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-no-rest-param.js
@@ -0,0 +1,45 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ return await import(...['']);
+}
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-not-extensible-args.js
new file mode 100644
index 0000000000..c0e5b889e2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-not-extensible-args.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-async-function-return-await.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested arrow syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+async function f() {
+ return await import('./empty_FIXTURE.js', {}, '');
+}
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..3c0354c367
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+async function * f() {
+ await import()
+}
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-new-call-expression.js
new file mode 100644
index 0000000000..a180c76d2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+async function * f() {
+ await new import('')
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-rest-param.js
new file mode 100644
index 0000000000..3a36475b66
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+async function * f() {
+ await import(...[''])
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-not-extensible-args.js
new file mode 100644
index 0000000000..bbabf51ae2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-async-generator-await.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+async function * f() {
+ await import('./empty_FIXTURE.js', {}, '')
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..7452bd129a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-block.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+{
+ import();
+};
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..d0315f0f99
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-block-labeled.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+label: {
+ import();
+};
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-new-call-expression.js
new file mode 100644
index 0000000000..e7d2e7b772
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-block-labeled.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+label: {
+ new import('');
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js
new file mode 100644
index 0000000000..256450971b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-block-labeled.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+label: {
+ import(...['']);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-not-extensible-args.js
new file mode 100644
index 0000000000..7628fe57a1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-block-labeled.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+label: {
+ import('./empty_FIXTURE.js', {}, '');
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-no-new-call-expression.js
new file mode 100644
index 0000000000..6e519ad4a0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-block.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+{
+ new import('');
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-no-rest-param.js
new file mode 100644
index 0000000000..d7cf1caee1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-block.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+{
+ import(...['']);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-not-extensible-args.js
new file mode 100644
index 0000000000..5ecf856ba0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-block-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-block.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+{
+ import('./empty_FIXTURE.js', {}, '');
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..f8b900e5f5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-do-while.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+do {
+ import();
+} while (false);
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-new-call-expression.js
new file mode 100644
index 0000000000..7d7c6a03f6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-do-while.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+do {
+ new import('');
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-rest-param.js
new file mode 100644
index 0000000000..d13e754090
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-do-while.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+do {
+ import(...['']);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-not-extensible-args.js
new file mode 100644
index 0000000000..27f71c5e48
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-do-while-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-do-while.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+do {
+ import('./empty_FIXTURE.js', {}, '');
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..c5e65e3052
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-assignment-expr-not-optional.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-else.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+if (false) {
+
+} else {
+ import();
+}
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..37dba7bca7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-else-braceless.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+if (false) {
+
+} else import();
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-new-call-expression.js
new file mode 100644
index 0000000000..c889b7640d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-else-braceless.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+if (false) {
+
+} else new import('');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-rest-param.js
new file mode 100644
index 0000000000..7bbc550c01
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-else-braceless.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+if (false) {
+
+} else import(...['']);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-not-extensible-args.js
new file mode 100644
index 0000000000..7a8b48ae28
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-else-braceless.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+if (false) {
+
+} else import('./empty_FIXTURE.js', {}, '');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-no-new-call-expression.js
new file mode 100644
index 0000000000..77a98f9879
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-no-new-call-expression.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-else.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+if (false) {
+
+} else {
+ new import('');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-no-rest-param.js
new file mode 100644
index 0000000000..6175daa818
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-no-rest-param.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-else.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+if (false) {
+
+} else {
+ import(...['']);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-not-extensible-args.js
new file mode 100644
index 0000000000..73ca520a21
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-else-not-extensible-args.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-else.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested else syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+if (false) {
+
+} else {
+ import('./empty_FIXTURE.js', {}, '');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..733ddc3d12
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-function.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+function fn() {
+ import();
+}
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-no-new-call-expression.js
new file mode 100644
index 0000000000..a5de34d505
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-function.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+function fn() {
+ new import('');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-no-rest-param.js
new file mode 100644
index 0000000000..b559e84511
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-function.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+function fn() {
+ import(...['']);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-not-extensible-args.js
new file mode 100644
index 0000000000..7b29890555
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-function.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+function fn() {
+ import('./empty_FIXTURE.js', {}, '');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..d3e7f516d2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-function-return.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+function fn() {
+ return import();
+}
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-new-call-expression.js
new file mode 100644
index 0000000000..cd075b0620
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-function-return.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+function fn() {
+ return new import('');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-rest-param.js
new file mode 100644
index 0000000000..480fa1dca4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-function-return.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+function fn() {
+ return import(...['']);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-not-extensible-args.js
new file mode 100644
index 0000000000..c53f093c8e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-function-return-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-function-return.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested function syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+function fn() {
+ return import('./empty_FIXTURE.js', {}, '');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..111d3ccb1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-if.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+if (true) {
+ import();
+}
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..574c1f8d5a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-assignment-expr-not-optional.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-if-braceless.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+if (true) import();
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-new-call-expression.js
new file mode 100644
index 0000000000..b893a436bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-new-call-expression.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-if-braceless.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+if (true) new import('');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-rest-param.js
new file mode 100644
index 0000000000..3eb570d65e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-no-rest-param.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-if-braceless.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+if (true) import(...['']);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-not-extensible-args.js
new file mode 100644
index 0000000000..ffd265c1e1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-not-extensible-args.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-if-braceless.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+if (true) import('./empty_FIXTURE.js', {}, '');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-no-new-call-expression.js
new file mode 100644
index 0000000000..dffc90d5b5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-if.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+if (true) {
+ new import('');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-no-rest-param.js
new file mode 100644
index 0000000000..bedc90ae57
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-if.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+if (true) {
+ import(...['']);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-not-extensible-args.js
new file mode 100644
index 0000000000..b03b6f2c27
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-if-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-if.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+if (true) {
+ import('./empty_FIXTURE.js', {}, '');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..3824f66655
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-assignment-expr-not-optional.js
@@ -0,0 +1,40 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-while.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+let x = 0;
+while (!x) {
+ x++;
+ import();
+};
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-no-new-call-expression.js
new file mode 100644
index 0000000000..cea4fd2a3b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-no-new-call-expression.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-while.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+let x = 0;
+while (!x) {
+ x++;
+ new import('');
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-no-rest-param.js
new file mode 100644
index 0000000000..adc7101b5d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-no-rest-param.js
@@ -0,0 +1,46 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-while.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+let x = 0;
+while (!x) {
+ x++;
+ import(...['']);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-not-extensible-args.js
new file mode 100644
index 0000000000..d23f297759
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-while-not-extensible-args.js
@@ -0,0 +1,43 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-while.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./empty_FIXTURE.js', {}, '');
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..1efe4f35a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-assignment-expr-not-optional.js
@@ -0,0 +1,38 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-with.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+with ({}) {
+ import();
+}
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..525d257b32
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-assignment-expr-not-optional.js
@@ -0,0 +1,36 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/nested-with-expression.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+---*/
+
+$DONOTEVALUATE();
+
+with (import()) {}
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-new-call-expression.js
new file mode 100644
index 0000000000..b06217b806
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-new-call-expression.js
@@ -0,0 +1,37 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-with-expression.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+with (new import('')) {}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-rest-param.js
new file mode 100644
index 0000000000..5d54855328
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-no-rest-param.js
@@ -0,0 +1,42 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-with-expression.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+with (import(...[''])) {}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-not-extensible-args.js
new file mode 100644
index 0000000000..88a4b771ee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-not-extensible-args.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-with-expression.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested with syntax in the expression position)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+with (import('./empty_FIXTURE.js', {}, '')) {}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-no-new-call-expression.js
new file mode 100644
index 0000000000..9fb213a434
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-no-new-call-expression.js
@@ -0,0 +1,39 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/nested-with.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+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]].
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+with ({}) {
+ new import('');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-no-rest-param.js
new file mode 100644
index 0000000000..b0e2175d60
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-no-rest-param.js
@@ -0,0 +1,44 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/nested-with.template
+/*---
+description: ImportCall is not extensible - no rest parameter (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+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] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+with ({}) {
+ import(...['']);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-not-extensible-args.js
new file mode 100644
index 0000000000..f185ca7b4c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/nested-with-not-extensible-args.js
@@ -0,0 +1,41 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/nested-with.template
+/*---
+description: ImportCall is not extensible - no arguments list (nested with syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, noStrict]
+negative:
+ phase: parse
+ type: SyntaxError
+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 )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+with ({}) {
+ import('./empty_FIXTURE.js', {}, '');
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/shell.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/shell.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-assignment-expr-not-optional.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-assignment-expr-not-optional.js
new file mode 100644
index 0000000000..8e8cf5e3a6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-assignment-expr-not-optional.js
@@ -0,0 +1,26 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/assignment-expr-not-optional.case
+// - src/dynamic-import/syntax/invalid/top-level.template
+/*---
+description: It's a SyntaxError if AssignmentExpression is omitted (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+import();
+
+/* The params region intentionally empty */
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-no-new-call-expression.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-no-new-call-expression.js
new file mode 100644
index 0000000000..f76970cdda
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-no-new-call-expression.js
@@ -0,0 +1,27 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-new-call-expression.case
+// - src/dynamic-import/syntax/invalid/top-level.template
+/*---
+description: ImportCall is a CallExpression, it can't be preceded by the new keyword (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+
+ CallExpression:
+ ImportCall
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+---*/
+
+$DONOTEVALUATE();
+
+new import('');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-no-rest-param.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-no-rest-param.js
new file mode 100644
index 0000000000..27490e9c1d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-no-rest-param.js
@@ -0,0 +1,32 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/no-rest-param.case
+// - src/dynamic-import/syntax/invalid/top-level.template
+/*---
+description: ImportCall is not extensible - no rest parameter (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield] )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+
+ This production doesn't allow the following production from ArgumentsList:
+
+ ... AssignmentExpression
+---*/
+
+$DONOTEVALUATE();
+
+import(...['']);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-not-extensible-args.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-not-extensible-args.js
new file mode 100644
index 0000000000..755f44eb17
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/invalid/top-level-not-extensible-args.js
@@ -0,0 +1,29 @@
+// |reftest| error:SyntaxError
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/not-extensible-args.case
+// - src/dynamic-import/syntax/invalid/top-level.template
+/*---
+description: ImportCall is not extensible - no arguments list (top level syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated]
+negative:
+ phase: parse
+ type: SyntaxError
+info: |
+ ImportCall :
+ import( AssignmentExpression )
+
+
+ ImportCall :
+ import( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+
+ Forbidden Extensions
+
+ - ImportCall must not be extended.
+---*/
+
+$DONOTEVALUATE();
+
+import('./empty_FIXTURE.js', {}, '');
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/shell.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/shell.js
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-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-assignment-expression-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-trailing-comma-first.js
new file mode 100644
index 0000000000..6aa87b1235
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-trailing-comma-second.js
new file mode 100644
index 0000000000..49ddd3e6de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-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/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-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-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-arrow-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-trailing-comma-first.js
new file mode 100644
index 0000000000..6ed1b9c1e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-trailing-comma-second.js
new file mode 100644
index 0000000000..ea41180592
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-arrow-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/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-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-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-await-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-trailing-comma-first.js
new file mode 100644
index 0000000000..d51912b4e3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-trailing-comma-second.js
new file mode 100644
index 0000000000..7b70999dfc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-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/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-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-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-arrow-function-return-await-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-trailing-comma-first.js
new file mode 100644
index 0000000000..22b5fd62a8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-trailing-comma-second.js
new file mode 100644
index 0000000000..1164ca46e7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-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/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-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-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-await-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-trailing-comma-first.js
new file mode 100644
index 0000000000..41440e6962
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-trailing-comma-second.js
new file mode 100644
index 0000000000..c58cb2952c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-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/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-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-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-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-return-await-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-trailing-comma-first.js
new file mode 100644
index 0000000000..ad276bd085
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-trailing-comma-second.js
new file mode 100644
index 0000000000..dd26fd129c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-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/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-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-function-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-trailing-comma-first.js
new file mode 100644
index 0000000000..3732593660
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-trailing-comma-second.js
new file mode 100644
index 0000000000..1acd264d06
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-function-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/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-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-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-async-gen-await-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-trailing-comma-first.js
new file mode 100644
index 0000000000..d86d04c5d9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-trailing-comma-second.js
new file mode 100644
index 0000000000..ec6eb93b1a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-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/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-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-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-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-labeled-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-trailing-comma-first.js
new file mode 100644
index 0000000000..115943b652
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-trailing-comma-second.js
new file mode 100644
index 0000000000..a503fd00f9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-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/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-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-block-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-trailing-comma-first.js
new file mode 100644
index 0000000000..a443d538c6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-trailing-comma-second.js
new file mode 100644
index 0000000000..da466f8b13
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-block-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/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-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-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-do-while-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-trailing-comma-first.js
new file mode 100644
index 0000000000..7b4127cd3d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-trailing-comma-second.js
new file mode 100644
index 0000000000..f3d13c309b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-do-while-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/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-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-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-braceless-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-trailing-comma-first.js
new file mode 100644
index 0000000000..0330fec8fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-trailing-comma-second.js
new file mode 100644
index 0000000000..1bcb94ff3a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-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/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-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-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-else-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-trailing-comma-first.js
new file mode 100644
index 0000000000..ec1dcb26e8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-trailing-comma-second.js
new file mode 100644
index 0000000000..224f98e20a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-else-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/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-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-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-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-return-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-trailing-comma-first.js
new file mode 100644
index 0000000000..c3a1d279d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-trailing-comma-second.js
new file mode 100644
index 0000000000..6c70d25131
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-return-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/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-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-function-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-trailing-comma-first.js
new file mode 100644
index 0000000000..08d8eba368
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-trailing-comma-second.js
new file mode 100644
index 0000000000..9ad65d74d6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-function-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/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-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-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-braceless-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-trailing-comma-first.js
new file mode 100644
index 0000000000..0f44a2376c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-trailing-comma-second.js
new file mode 100644
index 0000000000..350531f357
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-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/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-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-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-if-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-trailing-comma-first.js
new file mode 100644
index 0000000000..669d26be3c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-trailing-comma-second.js
new file mode 100644
index 0000000000..6c27353c6d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-if-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/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-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-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-while-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-trailing-comma-first.js
new file mode 100644
index 0000000000..99ff3a329b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-trailing-comma-second.js
new file mode 100644
index 0000000000..adcdfe8837
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-while-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/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-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-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-expression-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-trailing-comma-first.js
new file mode 100644
index 0000000000..2e089e2c39
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-trailing-comma-second.js
new file mode 100644
index 0000000000..d585efbac5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-expression-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/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-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/nested-with-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-trailing-comma-first.js
new file mode 100644
index 0000000000..aab54f8bc7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-trailing-comma-second.js
new file mode 100644
index 0000000000..d375700933
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/nested-with-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/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/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-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);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-trailing-comma-first.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-trailing-comma-first.js
new file mode 100644
index 0000000000..77dbeb2019
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-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/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-trailing-comma-second.js b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-trailing-comma-second.js
new file mode 100644
index 0000000000..22393f52a7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/syntax/valid/top-level-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/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/trailing-comma-fulfill.js b/js/src/tests/test262/language/expressions/dynamic-import/trailing-comma-fulfill.js
new file mode 100644
index 0000000000..4f271f22bd
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/trailing-comma-fulfill.js
@@ -0,0 +1,21 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list supports an optional trailing comma (fulfillment
+ semantics)
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions]
+flags: [async]
+---*/
+
+import('./2nd-param_FIXTURE.js',)
+ .then(function(module) {
+ assert.sameValue(module.default, 262);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/trailing-comma-reject.js b/js/src/tests/test262/language/expressions/dynamic-import/trailing-comma-reject.js
new file mode 100644
index 0000000000..bae7a0a46a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/trailing-comma-reject.js
@@ -0,0 +1,25 @@
+// |reftest| shell-option(--enable-import-assertions) skip-if(!xulRuntime.shell) async -- requires shell-options
+// Copyright (C) 2021 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall parameter list supports an optional trailing comma (rejection
+ semantics)
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ ImportCall[Yield, Await]:
+ import ( AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+ import ( AssignmentExpression[+In, ?Yield, ?Await] , AssignmentExpression[+In, ?Yield, ?Await] ,opt )
+features: [dynamic-import, import-assertions]
+flags: [async]
+---*/
+
+var thrown = new Test262Error();
+
+import({toString: function() { throw thrown; } },)
+ .then(function() {
+ throw new Test262Error('Expected promise to be rejected, but it was fulfilled.');
+ }, function(caught) {
+ assert.sameValue(thrown, caught);
+ })
+ .then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import-other_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import-other_FIXTURE.js
new file mode 100644
index 0000000000..9232455f91
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import-other_FIXTURE.js
@@ -0,0 +1,9 @@
+// |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.
+
+var global = Function('return this;')();
+
+global.test262Update('other');
+
+export default 42;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import.js b/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import.js
new file mode 100644
index 0000000000..d1a9469ed5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import.js
@@ -0,0 +1,33 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ Resolve imports after a binding update
+esid: sec-finishdynamicimport
+info: |
+ Runtime Semantics: FinishDynamicImport ( referencingScriptOrModule, specifier, promiseCapability, completion )
+
+ 2. Otherwise,
+ a. Assert: completion is a normal completion and completion.[[Value]] is undefined.
+ b. Let moduleRecord be ! HostResolveImportedModule(referencingScriptOrModule, specifier).
+ c. Assert: Evaluate has already been invoked on moduleRecord and successfully completed.
+ d. Let namespace be GetModuleNamespace(moduleRecord).
+ ...
+ f. Otherwise, perform ! Call(promiseCapability.[[Resolve]], undefined, « namespace.[[Value]] »).
+flags: [async]
+features: [dynamic-import]
+includes: [asyncHelpers.js]
+---*/
+
+async function fn() {
+ const first = await import('./update-to-dynamic-import_FIXTURE.js');
+ assert.sameValue(first.x, 'first', 'the other module has not been evaluated yet');
+
+ const other = await first.default();
+
+ assert.sameValue(first.x, 'other', 'the other module is only evaluated after calling import()');
+ assert.sameValue(other.default, 42);
+}
+
+asyncTest(fn);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import_FIXTURE.js
new file mode 100644
index 0000000000..0212cef806
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/update-to-dynamic-import_FIXTURE.js
@@ -0,0 +1,11 @@
+// |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.
+
+Function('return this;')().test262Update = name => x = name;
+
+export default function() {
+ return import('./update-to-dynamic-import-other_FIXTURE.js');
+}
+
+export var x = 'first';
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage-from-eval.js b/js/src/tests/test262/language/expressions/dynamic-import/usage-from-eval.js
new file mode 100644
index 0000000000..c49b9f8770
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage-from-eval.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// Copyright (C) 2018 Leo Balter. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: >
+ ImportCall can be used from eval code
+esid: sec-import-call-runtime-semantics-evaluation
+info: |
+ Import Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+features: [dynamic-import]
+flags: [async]
+---*/
+
+const p = eval("import('./module-code_FIXTURE.js');");
+
+assert.sameValue(Promise.resolve(p), p, 'constructor is %Promise%');
+assert.sameValue(Object.getPrototypeOf(p), Promise.prototype, 'prototype is %PromisePrototype%');
+
+p.then(imported => {
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.local1, 'Test262');
+ assert.sameValue(imported.renamed, 'TC39');
+ assert.sameValue(imported.indirect, 'Test262');
+}).then($DONE, $DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/browser.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/browser.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/dynamic-import-module_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/dynamic-import-module_FIXTURE.js
new file mode 100644
index 0000000000..fe34b3bfee
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/dynamic-import-module_FIXTURE.js
@@ -0,0 +1,5 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2018 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export var x = 1;
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/eval-gtbndng-indirect-update-dflt_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/eval-gtbndng-indirect-update-dflt_FIXTURE.js
new file mode 100644
index 0000000000..635bcbb682
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/eval-gtbndng-indirect-update-dflt_FIXTURE.js
@@ -0,0 +1,8 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+export default function fn() {
+ fn = 2;
+ return 1;
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/eval-gtbndng-indirect-update_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/eval-gtbndng-indirect-update_FIXTURE.js
new file mode 100644
index 0000000000..37a51bb18b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/eval-gtbndng-indirect-update_FIXTURE.js
@@ -0,0 +1,10 @@
+// |reftest| skip -- not a test file
+// Copyright (C) 2016 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+var x = 1;
+export { x };
+
+Function('return this;')().test262update = function() {
+ x = 2;
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/module-code_FIXTURE.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/module-code_FIXTURE.js
new file mode 100644
index 0000000000..4bf5708b92
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/module-code_FIXTURE.js
@@ -0,0 +1,9 @@
+// |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.
+
+const x = 'Test262';
+const y = 42;
+
+export default y;
+export { x, y as z };
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..50736c6248
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,46 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-arrow-assign-expr.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+let f = () => import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+});
+
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..34cdc1fc5f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-gtbndng-indirect-update.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-arrow-assign-expr.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+let f = () => import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+});
+
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..1ed49170be
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-arrow-assign-expr.template
+/*---
+description: import() from a script code can load a file with module code (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+});
+
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..aa725080a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-is-call-expression-square-brackets.js
@@ -0,0 +1,35 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-arrow-assign-expr.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+let f = () => import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+});
+
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-returns-thenable.js
new file mode 100644
index 0000000000..3e2ac9da05
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-returns-thenable.js
@@ -0,0 +1,33 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-arrow-assign-expr.template
+/*---
+description: Dynamic import() returns a thenable object. (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+});
+
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-specifier-tostring.js
new file mode 100644
index 0000000000..744d782b86
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-assignment-expression-specifier-tostring.js
@@ -0,0 +1,59 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-arrow-assign-expr.template
+/*---
+description: ToString value of specifier (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+let f = () => import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+});
+
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..aab6224945
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,48 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-arrow.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+let f = () => {
+ return import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..9460fcac47
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-gtbndng-indirect-update.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-arrow.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+let f = () => {
+ return import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+};
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..3a8ce9e1b5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-arrow.template
+/*---
+description: import() from a script code can load a file with module code (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 = () => {
+ return import('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..0f241e07c7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-is-call-expression-square-brackets.js
@@ -0,0 +1,37 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-arrow.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+let f = () => {
+ return import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-returns-thenable.js
new file mode 100644
index 0000000000..59f7f933ed
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-returns-thenable.js
@@ -0,0 +1,35 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-arrow.template
+/*---
+description: Dynamic import() returns a thenable object. (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 = () => {
+ return import('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-specifier-tostring.js
new file mode 100644
index 0000000000..e3e83a9720
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-arrow-import-then-specifier-tostring.js
@@ -0,0 +1,61 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-arrow.template
+/*---
+description: ToString value of specifier (nested arrow)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+let f = () => {
+ return import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
+
+f();
+
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..b1d6857af4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-async-arrow-fn-await.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+const f = async () => {
+ await import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..d6e8dc8104
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-gtbndng-indirect-update.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-async-arrow-fn-await.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+const f = async () => {
+ await import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..25de6fab42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-async-arrow-fn-await.template
+/*---
+description: import() from a script code can load a file with module code (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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() {}
+
+
+const f = async () => {
+ await import('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..70ada1125b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-is-call-expression-square-brackets.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-async-arrow-fn-await.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+const f = async () => {
+ await import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-returns-thenable.js
new file mode 100644
index 0000000000..2fd456876b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-returns-thenable.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-async-arrow-fn-await.template
+/*---
+description: Dynamic import() returns a thenable object. (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+---*/
+
+const f = async () => {
+ await import('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-specifier-tostring.js
new file mode 100644
index 0000000000..219f5fb0e6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-await-specifier-tostring.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-async-arrow-fn-await.template
+/*---
+description: ToString value of specifier (nested in async arrow function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+const f = async () => {
+ await import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..536d11ab88
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,45 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-async-arrow-fn-return-await.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+const f = async () => await import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js');
+
+f().then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..44adb202ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-gtbndng-indirect-update.js
@@ -0,0 +1,53 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-async-arrow-fn-return-await.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+const f = async () => await import('./eval-gtbndng-indirect-update_FIXTURE.js');
+
+f().then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..db72fe4aa3
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-async-arrow-fn-return-await.template
+/*---
+description: import() from a script code can load a file with module code (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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() {}
+
+
+const f = async () => await import('./module-code_FIXTURE.js');
+
+f().then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..43591dfff6
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-is-call-expression-square-brackets.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-async-arrow-fn-return-await.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+const f = async () => await import('./dynamic-import-module_FIXTURE.js')['then'](x => x);
+
+f().then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-returns-thenable.js
new file mode 100644
index 0000000000..fdb7c287fc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-returns-thenable.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-async-arrow-fn-return-await.template
+/*---
+description: Dynamic import() returns a thenable object. (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+---*/
+
+const f = async () => await import('./dynamic-import-module_FIXTURE.js');
+
+f().then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-specifier-tostring.js
new file mode 100644
index 0000000000..fe6f558bc7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-arrow-function-return-await-specifier-tostring.js
@@ -0,0 +1,58 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-async-arrow-fn-return-await.template
+/*---
+description: ToString value of specifier (nested in async arrow function, returned)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+const f = async () => await import(obj);
+
+f().then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..c854e79a33
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-async-function-await.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+async function f() {
+ await import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..9876af748e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-gtbndng-indirect-update.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-async-function-await.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+async function f() {
+ await import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..372fb54337
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-async-function-await.template
+/*---
+description: import() from a script code can load a file with module code (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..b38d1d0831
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-is-call-expression-square-brackets.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-async-function-await.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+async function f() {
+ await import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-returns-thenable.js
new file mode 100644
index 0000000000..590e478092
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-returns-thenable.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-async-function-await.template
+/*---
+description: Dynamic import() returns a thenable object. (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-specifier-tostring.js
new file mode 100644
index 0000000000..9b9b1ec91c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-await-specifier-tostring.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-async-function-await.template
+/*---
+description: ToString value of specifier (nested in async function, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+async function f() {
+ await import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ });
+}
+
+f().then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..f8bad5fa23
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-async-function.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+async function f() {
+ import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..ca1ed65a21
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-gtbndng-indirect-update.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-async-function.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+async function f() {
+ import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..184e025505
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-async-function.template
+/*---
+description: import() from a script code can load a file with module code (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..c976697930
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-is-call-expression-square-brackets.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-async-function.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+async function f() {
+ import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..c47e86b5dc
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-async-function-return-await.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+async function f() {
+ return await import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js');
+}
+
+f().then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..a1840cf04f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-gtbndng-indirect-update.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-async-function-return-await.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+async function f() {
+ return await import('./eval-gtbndng-indirect-update_FIXTURE.js');
+}
+
+f().then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..d081e9c34e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-async-function-return-await.template
+/*---
+description: import() from a script code can load a file with module code (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js');
+}
+
+f().then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..5625149770
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-is-call-expression-square-brackets.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-async-function-return-await.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+async function f() {
+ return await import('./dynamic-import-module_FIXTURE.js')['then'](x => x);
+}
+
+f().then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-returns-thenable.js
new file mode 100644
index 0000000000..e8f85ff4ca
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-returns-thenable.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-async-function-return-await.template
+/*---
+description: Dynamic import() returns a thenable object. (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js');
+}
+
+f().then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-specifier-tostring.js
new file mode 100644
index 0000000000..b4df642ef7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-return-await-specifier-tostring.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-async-function-return-await.template
+/*---
+description: ToString value of specifier (nested in async function, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+async function f() {
+ return await import(obj);
+}
+
+f().then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-returns-thenable.js
new file mode 100644
index 0000000000..57497529b2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-returns-thenable.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-async-function.template
+/*---
+description: Dynamic import() returns a thenable object. (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-specifier-tostring.js
new file mode 100644
index 0000000000..7132d0379a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-function-specifier-tostring.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-async-function.template
+/*---
+description: ToString value of specifier (nested in async function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+async function f() {
+ import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..eef782aaf7
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,52 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-async-generator-await.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+let callCount = 0;
+
+async function * f() {
+ await import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ callCount++;
+ });
+}
+
+f().next().then(() => {
+ assert.sameValue(callCount, 1);
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..b2ea46f892
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-gtbndng-indirect-update.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-async-generator-await.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+let callCount = 0;
+
+async function * f() {
+ await import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ callCount++;
+ });
+}
+
+f().next().then(() => {
+ assert.sameValue(callCount, 1);
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..7ee84dc436
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,45 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-async-generator-await.template
+/*---
+description: import() from a script code can load a file with module code (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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 callCount = 0;
+
+async function * f() {
+ await import('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ callCount++;
+ });
+}
+
+f().next().then(() => {
+ assert.sameValue(callCount, 1);
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..d964950097
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-is-call-expression-square-brackets.js
@@ -0,0 +1,41 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-async-generator-await.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+let callCount = 0;
+
+async function * f() {
+ await import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ callCount++;
+ });
+}
+
+f().next().then(() => {
+ assert.sameValue(callCount, 1);
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-returns-thenable.js
new file mode 100644
index 0000000000..9b848fd3a5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-returns-thenable.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-async-generator-await.template
+/*---
+description: Dynamic import() returns a thenable object. (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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 callCount = 0;
+
+async function * f() {
+ await import('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ callCount++;
+ });
+}
+
+f().next().then(() => {
+ assert.sameValue(callCount, 1);
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-specifier-tostring.js
new file mode 100644
index 0000000000..63de7a0fd8
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-await-specifier-tostring.js
@@ -0,0 +1,65 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-async-generator-await.template
+/*---
+description: ToString value of specifier (nested in async generator, awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+let callCount = 0;
+
+async function * f() {
+ await import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ callCount++;
+ });
+}
+
+f().next().then(() => {
+ assert.sameValue(callCount, 1);
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..63efe9655c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-async-generator-return-await.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+async function * f() {
+ return await import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js');
+}
+
+f().next().then(({value: imported}) => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..7fb7d61be5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-gtbndng-indirect-update.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-async-generator-return-await.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+async function * f() {
+ return await import('./eval-gtbndng-indirect-update_FIXTURE.js');
+}
+
+f().next().then(({value: imported}) => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..e59a5c1973
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-async-generator-return-await.template
+/*---
+description: import() from a script code can load a file with module code (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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('./module-code_FIXTURE.js');
+}
+
+f().next().then(({value: imported}) => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..fe7999ca48
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-is-call-expression-square-brackets.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-async-generator-return-await.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+async function * f() {
+ return await import('./dynamic-import-module_FIXTURE.js')['then'](x => x);
+}
+
+f().next().then(({value: imported}) => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-returns-thenable.js
new file mode 100644
index 0000000000..10e780a61e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-returns-thenable.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-async-generator-return-await.template
+/*---
+description: Dynamic import() returns a thenable object. (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js');
+}
+
+f().next().then(({value: imported}) => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-specifier-tostring.js
new file mode 100644
index 0000000000..6860f6c7de
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-async-gen-return-await-specifier-tostring.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-async-generator-return-await.template
+/*---
+description: ToString value of specifier (nested in async generator, returns awaited)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import, async-iteration]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+async function * f() {
+ return await import(obj);
+}
+
+f().next().then(({value: imported}) => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..39560bd174
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,45 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-block.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+{
+ import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..6b9869e0d1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-gtbndng-indirect-update.js
@@ -0,0 +1,53 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-block.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+{
+ import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..ed0e01e870
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-block.template
+/*---
+description: import() from a script code can load a file with module code (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..5b1853896f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-is-call-expression-square-brackets.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-block.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+{
+ import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-returns-thenable.js
new file mode 100644
index 0000000000..debb765143
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-returns-thenable.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-block.template
+/*---
+description: Dynamic import() returns a thenable object. (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-specifier-tostring.js
new file mode 100644
index 0000000000..588e930e9c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-block-import-then-specifier-tostring.js
@@ -0,0 +1,58 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-block.template
+/*---
+description: ToString value of specifier (nested block)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+{
+ import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..9afd803e7c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,45 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-do-while.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+do {
+ import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..730b3c8d2b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-gtbndng-indirect-update.js
@@ -0,0 +1,53 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-do-while.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+do {
+ import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..40d3557911
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-do-while.template
+/*---
+description: import() from a script code can load a file with module code (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..617924bbb4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-is-call-expression-square-brackets.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-do-while.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+do {
+ import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-returns-thenable.js
new file mode 100644
index 0000000000..8cbb6ca6bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-returns-thenable.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-do-while.template
+/*---
+description: Dynamic import() returns a thenable object. (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-specifier-tostring.js
new file mode 100644
index 0000000000..8f46054a7b
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-do-while-specifier-tostring.js
@@ -0,0 +1,58 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-do-while.template
+/*---
+description: ToString value of specifier (nested do while syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+do {
+ import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+} while (false);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..75113b7b62
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-else.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+if (false) {
+
+} else {
+ import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..c6e86a47c2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-gtbndng-indirect-update.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-else.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+if (false) {
+
+} else {
+ import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..0f77bf936e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-else.template
+/*---
+description: import() from a script code can load a file with module code (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..1a30aaa94f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-is-call-expression-square-brackets.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-else.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+if (false) {
+
+} else {
+ import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-returns-thenable.js
new file mode 100644
index 0000000000..f0da24a6fe
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-returns-thenable.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-else.template
+/*---
+description: Dynamic import() returns a thenable object. (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-specifier-tostring.js
new file mode 100644
index 0000000000..3c9c8e1e95
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-else-import-then-specifier-tostring.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-else.template
+/*---
+description: ToString value of specifier (nested else)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+if (false) {
+
+} else {
+ import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..6c4c5bc1db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,46 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-function.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+function f() {
+ import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..eb0b4e8037
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-gtbndng-indirect-update.js
@@ -0,0 +1,54 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-function.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+function f() {
+ import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..b2ef5536fb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,39 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-function.template
+/*---
+description: import() from a script code can load a file with module code (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 f() {
+ import('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..026df1da22
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-is-call-expression-square-brackets.js
@@ -0,0 +1,35 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-function.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+function f() {
+ import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-returns-thenable.js
new file mode 100644
index 0000000000..607aa740a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-returns-thenable.js
@@ -0,0 +1,33 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-function.template
+/*---
+description: Dynamic import() returns a thenable object. (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 f() {
+ import('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-specifier-tostring.js
new file mode 100644
index 0000000000..b88c1dbf0e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-function-import-then-specifier-tostring.js
@@ -0,0 +1,59 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-function.template
+/*---
+description: ToString value of specifier (nested function)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+function f() {
+ import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
+f();
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..fd149270b4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,43 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-if-braceless.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+if (true) import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..2b5176e069
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-gtbndng-indirect-update.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-if-braceless.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+if (true) import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..de8ca0aa1f
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-if-braceless.template
+/*---
+description: import() from a script code can load a file with module code (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..efa7c68353
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-is-call-expression-square-brackets.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-if-braceless.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+if (true) import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-returns-thenable.js
new file mode 100644
index 0000000000..abcab19f64
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-returns-thenable.js
@@ -0,0 +1,30 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-if-braceless.template
+/*---
+description: Dynamic import() returns a thenable object. (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-specifier-tostring.js
new file mode 100644
index 0000000000..fbcf4498e9
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-braceless-specifier-tostring.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-if-braceless.template
+/*---
+description: ToString value of specifier (nested if syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+if (true) import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..9bd7b9ee2e
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,45 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-if.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+if (true) {
+ import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..04c4edd41a
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-gtbndng-indirect-update.js
@@ -0,0 +1,53 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-if.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+if (true) {
+ import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..bf587991d5
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-if.template
+/*---
+description: import() from a script code can load a file with module code (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..81041264df
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-is-call-expression-square-brackets.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-if.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+if (true) {
+ import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-returns-thenable.js
new file mode 100644
index 0000000000..a787e7a935
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-returns-thenable.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-if.template
+/*---
+description: Dynamic import() returns a thenable object. (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-specifier-tostring.js
new file mode 100644
index 0000000000..29689a00db
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-if-import-then-specifier-tostring.js
@@ -0,0 +1,58 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-if.template
+/*---
+description: ToString value of specifier (nested if)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+if (true) {
+ import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+}
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..4db59a8d73
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,47 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-while.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..d6c1f720b1
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-gtbndng-indirect-update.js
@@ -0,0 +1,55 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-while.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..784b590666
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,40 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-while.template
+/*---
+description: import() from a script code can load a file with module code (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..02949eafeb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-is-call-expression-square-brackets.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-while.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+let x = 0;
+while (!x) {
+ x++;
+ import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-returns-thenable.js
new file mode 100644
index 0000000000..4acb7c0b42
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-returns-thenable.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-while.template
+/*---
+description: Dynamic import() returns a thenable object. (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-specifier-tostring.js
new file mode 100644
index 0000000000..5e964f4b24
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/nested-while-import-then-specifier-tostring.js
@@ -0,0 +1,60 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-while.template
+/*---
+description: ToString value of specifier (nested while)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+let x = 0;
+while (!x) {
+ x++;
+ import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/shell.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/shell.js
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..c71c7402f4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,45 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/nested-block-labeled.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+label: {
+ import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..b4ebb1d9a4
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-gtbndng-indirect-update.js
@@ -0,0 +1,53 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/nested-block-labeled.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+label: {
+ import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..0ee09bea19
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,38 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/nested-block-labeled.template
+/*---
+description: import() from a script code can load a file with module code (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..191f0422f0
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-is-call-expression-square-brackets.js
@@ -0,0 +1,34 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/nested-block-labeled.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+label: {
+ import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-returns-thenable.js
new file mode 100644
index 0000000000..f5be52f78c
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-returns-thenable.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/nested-block-labeled.template
+/*---
+description: Dynamic import() returns a thenable object. (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-specifier-tostring.js
new file mode 100644
index 0000000000..2278032e10
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/syntax-nested-block-labeled-specifier-tostring.js
@@ -0,0 +1,58 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/nested-block-labeled.template
+/*---
+description: ToString value of specifier (nested block syntax)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+label: {
+ import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+ }).then($DONE, $DONE).catch($DONE);
+};
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-gtbndng-indirect-update-dflt.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-gtbndng-indirect-update-dflt.js
new file mode 100644
index 0000000000..af2f900476
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-gtbndng-indirect-update-dflt.js
@@ -0,0 +1,43 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update-dflt.case
+// - src/dynamic-import/default/top-level.template
+/*---
+description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default(), 1);
+ assert.sameValue(imported.default, 2);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-gtbndng-indirect-update.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-gtbndng-indirect-update.js
new file mode 100644
index 0000000000..e0edaa0862
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-gtbndng-indirect-update.js
@@ -0,0 +1,51 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-gtbndng-indirect-update.case
+// - src/dynamic-import/default/top-level.template
+/*---
+description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+includes: [fnGlobalObject.js]
+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]].
+
+
+ GetBindingValue (N, S)
+
+ [...]
+ 3. If the binding for N is an indirect binding, then
+ a. Let M and N2 be the indirection values provided when this binding for
+ N was created.
+ b. Let targetEnv be M.[[Environment]].
+ c. If targetEnv is undefined, throw a ReferenceError exception.
+ d. Let targetER be targetEnv's EnvironmentRecord.
+ e. Return ? targetER.GetBindingValue(N2, S).
+
+---*/
+
+import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+ // This function is exposed on the global scope (instead of as an exported
+ // binding) in order to avoid possible false positives from assuming correct
+ // behavior of the semantics under test.
+ fnGlobalObject().test262update();
+
+ assert.sameValue(imported.x, 2);
+
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-script-code-host-resolves-module-code.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-script-code-host-resolves-module-code.js
new file mode 100644
index 0000000000..d9eb3d4010
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-eval-script-code-host-resolves-module-code.js
@@ -0,0 +1,36 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/eval-script-code-host-resolves-module-code.case
+// - src/dynamic-import/default/top-level.template
+/*---
+description: import() from a script code can load a file with module code (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./module-code_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-is-call-expression-square-brackets.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-is-call-expression-square-brackets.js
new file mode 100644
index 0000000000..4ec4bfd6bb
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-is-call-expression-square-brackets.js
@@ -0,0 +1,32 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/is-call-expression-square-brackets.case
+// - src/dynamic-import/default/top-level.template
+/*---
+description: ImportCall is a CallExpression, it can be followed by square brackets (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js')
+
+
+import('./dynamic-import-module_FIXTURE.js')['then'](x => x).then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-returns-thenable.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-returns-thenable.js
new file mode 100644
index 0000000000..8824ea0b9d
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-returns-thenable.js
@@ -0,0 +1,30 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/returns-thenable.case
+// - src/dynamic-import/default/top-level.template
+/*---
+description: Dynamic import() returns a thenable object. (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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('./dynamic-import-module_FIXTURE.js').then(imported => {
+
+ assert.sameValue(imported.x, 1);
+
+}).then($DONE, $DONE).catch($DONE);
diff --git a/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-specifier-tostring.js b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-specifier-tostring.js
new file mode 100644
index 0000000000..2958212116
--- /dev/null
+++ b/js/src/tests/test262/language/expressions/dynamic-import/usage/top-level-import-then-specifier-tostring.js
@@ -0,0 +1,56 @@
+// |reftest| async
+// This file was procedurally generated from the following sources:
+// - src/dynamic-import/specifier-tostring.case
+// - src/dynamic-import/default/top-level.template
+/*---
+description: ToString value of specifier (top level)
+esid: sec-import-call-runtime-semantics-evaluation
+features: [dynamic-import]
+flags: [generated, async]
+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 Calls
+
+ Runtime Semantics: Evaluation
+
+ ImportCall : import(AssignmentExpression)
+
+ 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule().
+ 2. Let argRef be the result of evaluating AssignmentExpression.
+ 3. Let specifier be ? GetValue(argRef).
+ 4. Let promiseCapability be ! NewPromiseCapability(%Promise%).
+ 5. Let specifierString be ToString(specifier).
+ 6. IfAbruptRejectPromise(specifierString, promiseCapability).
+ 7. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability).
+ 8. Return promiseCapability.[[Promise]].
+
+---*/
+// import('./module-code_FIXTURE.js')
+
+const obj = {
+ toString() {
+ return './module-code_FIXTURE.js';
+ }
+};
+
+
+import(obj).then(imported => {
+
+ assert.sameValue(imported.default, 42);
+ assert.sameValue(imported.x, 'Test262');
+ assert.sameValue(imported.z, 42);
+
+}).then($DONE, $DONE).catch($DONE);