From 470bb57ee0550ab62f64d43bfd492fdf4f142c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Fri, 10 Jan 2025 17:59:22 +0100 Subject: [PATCH 1/2] Add syntax tests for `import.defer` These tests are all based on the existing dynamic import syntax tests, just updated to use the new syntax. This PR does not contain any manually written tests -- they are all generated. --- .../importcall-defer.case | 25 ++++++++ ...rt-defer-assignment-expr-not-optional.case | 16 +++++ ...-defer-empty-str-is-valid-assign-expr.case | 12 ++++ .../import-defer-no-new-call-expression.case | 18 ++++++ .../import-defer-no-rest-param.case | 18 ++++++ .../import-defer-script-code-valid.case | 16 +++++ ...fer-specifier-tostring-abrupt-rejects.case | 40 +++++++++++++ .../direct-importcall-defer.js | 21 +++++++ .../parenthesized-importcall-defer.js | 24 ++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 57 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 57 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 55 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 57 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 58 +++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 57 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 57 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 57 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 55 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 55 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 55 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 57 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 56 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 55 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 57 ++++++++++++++++++ ...defer-specifier-tostring-abrupt-rejects.js | 53 +++++++++++++++++ ...port-defer-assignment-expr-not-optional.js | 36 ++++++++++++ ...ion-import-defer-no-new-call-expression.js | 37 ++++++++++++ ...t-expression-import-defer-no-rest-param.js | 38 ++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...row-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...nested-arrow-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...ait-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...nction-await-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 36 ++++++++++++ ...ait-import-defer-no-new-call-expression.js | 37 ++++++++++++ ...return-await-import-defer-no-rest-param.js | 38 ++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...ait-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...nction-await-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 39 +++++++++++++ ...ion-import-defer-no-new-call-expression.js | 40 +++++++++++++ ...ync-function-import-defer-no-rest-param.js | 41 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 39 +++++++++++++ ...ait-import-defer-no-new-call-expression.js | 40 +++++++++++++ ...return-await-import-defer-no-rest-param.js | 41 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...ait-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...nc-gen-await-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...ock-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...nested-block-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...led-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...lock-labeled-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...ile-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...ted-do-while-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...ess-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...se-braceless-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 40 +++++++++++++ ...lse-import-defer-no-new-call-expression.js | 41 +++++++++++++ .../nested-else-import-defer-no-rest-param.js | 42 ++++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...ion-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...ted-function-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...urn-import-defer-no-new-call-expression.js | 39 +++++++++++++ ...ction-return-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 36 ++++++++++++ ...ess-import-defer-no-new-call-expression.js | 37 ++++++++++++ ...if-braceless-import-defer-no-rest-param.js | 38 ++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...-if-import-defer-no-new-call-expression.js | 39 +++++++++++++ .../nested-if-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 40 +++++++++++++ ...ile-import-defer-no-new-call-expression.js | 41 +++++++++++++ ...nested-while-import-defer-no-rest-param.js | 42 ++++++++++++++ ...port-defer-assignment-expr-not-optional.js | 36 ++++++++++++ ...ion-import-defer-no-new-call-expression.js | 37 ++++++++++++ ...h-expression-import-defer-no-rest-param.js | 38 ++++++++++++ ...port-defer-assignment-expr-not-optional.js | 38 ++++++++++++ ...ith-import-defer-no-new-call-expression.js | 39 +++++++++++++ .../nested-with-import-defer-no-rest-param.js | 40 +++++++++++++ ...port-defer-assignment-expr-not-optional.js | 26 +++++++++ ...vel-import-defer-no-new-call-expression.js | 27 +++++++++ .../top-level-import-defer-no-rest-param.js | 28 +++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 25 ++++++++ ...pression-import-defer-script-code-valid.js | 29 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...ed-arrow-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...on-await-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 25 ++++++++ ...rn-await-import-defer-script-code-valid.js | 29 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...on-await-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 28 +++++++++ ...function-import-defer-script-code-valid.js | 32 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 28 +++++++++ ...rn-await-import-defer-script-code-valid.js | 32 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...en-await-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...ed-block-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...-labeled-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...do-while-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...raceless-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 29 ++++++++++ ...ted-else-import-defer-script-code-valid.js | 33 +++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...function-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...n-return-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 25 ++++++++ ...raceless-import-defer-script-code-valid.js | 29 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...ested-if-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 29 ++++++++++ ...ed-while-import-defer-script-code-valid.js | 33 +++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 28 +++++++++ ...pression-import-defer-script-code-valid.js | 32 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 27 +++++++++ ...ted-with-import-defer-script-code-valid.js | 31 ++++++++++ ...rt-defer-empty-str-is-valid-assign-expr.js | 15 +++++ ...op-level-import-defer-script-code-valid.js | 19 ++++++ 130 files changed, 4699 insertions(+) create mode 100644 src/assignment-target-type/importcall-defer.case create mode 100644 src/dynamic-import/import-defer-assignment-expr-not-optional.case create mode 100644 src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case create mode 100644 src/dynamic-import/import-defer-no-new-call-expression.case create mode 100644 src/dynamic-import/import-defer-no-rest-param.case create mode 100644 src/dynamic-import/import-defer-script-code-valid.case create mode 100644 src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case create mode 100644 test/language/expressions/assignmenttargettype/direct-importcall-defer.js create mode 100644 test/language/expressions/assignmenttargettype/parenthesized-importcall-defer.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-async-function-await-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-async-function-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-block-labeled-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-do-while-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/catch/top-level-import-catch-import-defer-specifier-tostring-abrupt-rejects.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-assignment-expr-not-optional.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-new-call-expression.js create mode 100644 test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-empty-str-is-valid-assign-expr.js create mode 100644 test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js diff --git a/src/assignment-target-type/importcall-defer.case b/src/assignment-target-type/importcall-defer.case new file mode 100644 index 00000000000..06eaaca4b84 --- /dev/null +++ b/src/assignment-target-type/importcall-defer.case @@ -0,0 +1,25 @@ +// Copyright (C) 2020 Rick Waldron. All rights reserved. +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-static-semantics-static-semantics-assignmenttargettype +desc: > + Static Semantics AssignmentTargetType, Return invalid. +info: | + ImportCall + Static Semantics AssignmentTargetType, Return invalid. +template: invalid +flags: [module] +features: [import-defer] +negative: + phase: parse + type: SyntaxError +---*/ + +//- assignmenttarget +import.defer() +//- operator += +//- value +1 diff --git a/src/dynamic-import/import-defer-assignment-expr-not-optional.case b/src/dynamic-import/import-defer-assignment-expr-not-optional.case new file mode 100644 index 00000000000..7cec300e038 --- /dev/null +++ b/src/dynamic-import/import-defer-assignment-expr-not-optional.case @@ -0,0 +1,16 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: It's a SyntaxError if AssignmentExpression is omitted +template: syntax/invalid +info: | + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) +features: [import-defer] +---*/ +//- import +import.defer() +//- teardown +/* The params region intentionally empty */ diff --git a/src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case b/src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case new file mode 100644 index 00000000000..d606272e894 --- /dev/null +++ b/src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case @@ -0,0 +1,12 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: Calling import.defer('') +template: syntax/valid +features: [import-defer] +---*/ + +//- import +import.defer('./empty_FIXTURE.js') diff --git a/src/dynamic-import/import-defer-no-new-call-expression.case b/src/dynamic-import/import-defer-no-new-call-expression.case new file mode 100644 index 00000000000..7b1ae48cf80 --- /dev/null +++ b/src/dynamic-import/import-defer-no-new-call-expression.case @@ -0,0 +1,18 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: ImportCall is a CallExpression, it can't be preceded by the new keyword +template: syntax/invalid +info: | + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +features: [import-defer] +---*/ + +//- import +new import.defer('./empty_FIXTURE.js') diff --git a/src/dynamic-import/import-defer-no-rest-param.case b/src/dynamic-import/import-defer-no-rest-param.case new file mode 100644 index 00000000000..d6e0943865d --- /dev/null +++ b/src/dynamic-import/import-defer-no-rest-param.case @@ -0,0 +1,18 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: ImportCall is not extensible - no rest parameter +template: syntax/invalid +info: | + ImportCall : + import . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression +features: [import-defer] +---*/ + +//- import +import.defer(...['./empty_FIXTURE.js']) diff --git a/src/dynamic-import/import-defer-script-code-valid.case b/src/dynamic-import/import-defer-script-code-valid.case new file mode 100644 index 00000000000..c6d705c6404 --- /dev/null +++ b/src/dynamic-import/import-defer-script-code-valid.case @@ -0,0 +1,16 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Leo Balter. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: import.defer() can be used in script code +template: syntax/valid +features: [import-defer] +---*/ + +//- setup +// 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 +import.defer('./empty_FIXTURE.js') diff --git a/src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case b/src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case new file mode 100644 index 00000000000..efbc58bfce0 --- /dev/null +++ b/src/dynamic-import/import-defer-specifier-tostring-abrupt-rejects.case @@ -0,0 +1,40 @@ +// Copyright (C) 2025 Igalia, S.L. All rights reserved. +// Copyright (C) 2018 Rick Waldron. All rights reserved. +// Copyright (C) 2018 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +desc: > + Abrupt from ToString(specifier) rejects the promise +esid: sec-moduleevaluation +info: | + Import Calls + + Runtime Semantics: Evaluation + + ImportCall : import . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... +template: catch +features: [import-defer] +---*/ + +//- setup +const obj = { + toString() { + throw 'custom error'; + } +}; + +//- import +import.defer(obj) +//- body +assert.sameValue(error, 'custom error'); diff --git a/test/language/expressions/assignmenttargettype/direct-importcall-defer.js b/test/language/expressions/assignmenttargettype/direct-importcall-defer.js new file mode 100644 index 00000000000..cf36b1cf832 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/direct-importcall-defer.js @@ -0,0 +1,21 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/importcall-defer.case +// - src/assignment-target-type/invalid/direct.template +/*--- +description: Static Semantics AssignmentTargetType, Return invalid. (Direct assignment) +features: [import-defer] +flags: [generated, module] +negative: + phase: parse + type: SyntaxError +info: | + Direct assignment + + ImportCall + Static Semantics AssignmentTargetType, Return invalid. + +---*/ + +$DONOTEVALUATE(); + +import.defer() = 1; diff --git a/test/language/expressions/assignmenttargettype/parenthesized-importcall-defer.js b/test/language/expressions/assignmenttargettype/parenthesized-importcall-defer.js new file mode 100644 index 00000000000..927f9e46b68 --- /dev/null +++ b/test/language/expressions/assignmenttargettype/parenthesized-importcall-defer.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - src/assignment-target-type/importcall-defer.case +// - src/assignment-target-type/invalid/parenthesized.template +/*--- +description: Static Semantics AssignmentTargetType, Return invalid. (ParenthesizedExpression) +esid: sec-grouping-operator-static-semantics-assignmenttargettype +features: [import-defer] +flags: [generated, module] +negative: + phase: parse + type: SyntaxError +info: | + ParenthesizedExpression: (Expression) + + Return AssignmentTargetType of Expression. + + ImportCall + Static Semantics AssignmentTargetType, Return invalid. + +---*/ + +$DONOTEVALUATE(); + +(import.defer()) = 1; diff --git a/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..4a29c659221 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-arrow-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +let f = () => { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +}; + +f(); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..fd0be3deeda --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +const f = async () => { + await import.defer(obj); +} + +f().catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..938eb8932de --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-arrow-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +const f = async () => await import.defer(obj); + +f().catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..6dc81c817f1 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function f() { + await import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-function-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..f7dcd35010c --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,58 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function f() { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} + +f(); + diff --git a/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..bf484e0bd6f --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-function-return-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function f() { + return await import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..5ebc27ea7f3 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-gen-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function * f() { + await import.defer(obj); +} + +f().next().catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..a6fd391b114 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-async-gen-return-await-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +async function * f() { + return await import.defer(obj); +} + +f().next().catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..314c791eec1 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-block-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +{ + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..445e4bd0d7b --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-block-labeled-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +label: { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/expressions/dynamic-import/catch/nested-do-while-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-do-while-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..bfc1691fa46 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-do-while-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +do { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} while (false); diff --git a/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..64d291f4154 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-else-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +if (false) { + +} else { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} diff --git a/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..fd30fa8137a --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-function-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,56 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +function f() { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} +f(); diff --git a/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..037234391c7 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-if-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +if (true) { + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +} diff --git a/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..86bf40e8dc9 --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/nested-while-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +let x = 0; +while (!x) { + x++; + import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-defer-specifier-tostring-abrupt-rejects.js b/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-defer-specifier-tostring-abrupt-rejects.js new file mode 100644 index 00000000000..564ddfbb2ef --- /dev/null +++ b/test/language/expressions/dynamic-import/catch/top-level-import-catch-import-defer-specifier-tostring-abrupt-rejects.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( |AssignmentExpression| ) + 1. Return ? EvaluateImportCall(|AssignmentExpression|, ~defer~) + + EvaluateImportCall ( specifierExpression, phase ) + 1. Let _referrer_ be GetActiveScriptOrModule(). + 1. If _referrer_ is *null*, set _referrer_ to the current Realm Record. + 1. Let _specifierRef_ be ? Evaluation of _specifierExpression_. + 1. Let _specifier_ be ? GetValue(_specifierRef_). + 1. Let _promiseCapability_ be ! NewPromiseCapability(%Promise%). + 1. Let _specifierString_ be Completion(ToString(_specifier_)). + 1. IfAbruptRejectPromise(_specifierString_, _promiseCapability_). + ... + +---*/ +const obj = { + toString() { + throw 'custom error'; + } +}; + + +import.defer(obj).catch(error => { + + assert.sameValue(error, 'custom error'); + +}).then($DONE, $DONE); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..dc5aa770931 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let f = () => import.defer(); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..4eb77f4e5f9 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-new-call-expression.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let f = () => new import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js new file mode 100644 index 00000000000..0869028b5a4 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +let f = () => import.defer(...['./empty_FIXTURE.js']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..cc9156baa54 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let f = () => { + import.defer(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..638808f0f55 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let f = () => { + new import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js new file mode 100644 index 00000000000..3fdb3ca39ff --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +let f = () => { + import.defer(...['./empty_FIXTURE.js']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..cec4eea3754 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +(async () => { + await import.defer() +}); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..39a1fdaaa53 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +(async () => { + await new import.defer('./empty_FIXTURE.js') +}); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..b13519c4c98 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +(async () => { + await import.defer(...['./empty_FIXTURE.js']) +}); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..30255f57280 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +(async () => await import.defer()) + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..ca540341c24 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-new-call-expression.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +(async () => await new import.defer('./empty_FIXTURE.js')) diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..1e48779ce02 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +(async () => await import.defer(...['./empty_FIXTURE.js'])) diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..ffb328424f0 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + await import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..bc1fa4d1416 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + await new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..5b3032494c9 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +async function f() { + await import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..935169ab094 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + import.defer(); +} + + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..7bb1c22911f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-new-call-expression.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + new import.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js new file mode 100644 index 00000000000..b2541fbabfd --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +async function f() { + import.defer(...['./empty_FIXTURE.js']); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..4573cca670a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + return await import.defer(); +} + + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..501854f2d7b --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-new-call-expression.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function f() { + return await new import.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..719b4c16255 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +async function f() { + return await import.defer(...['./empty_FIXTURE.js']); +} + diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..46a6da824a7 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function * f() { + await import.defer() +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..34cc167f7b1 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +async function * f() { + await new import.defer('./empty_FIXTURE.js') +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js new file mode 100644 index 00000000000..d50a6c05634 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +async function * f() { + await import.defer(...['./empty_FIXTURE.js']) +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..1d6a7dca2d2 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +{ + import.defer(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..959d8b070aa --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +{ + new import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js new file mode 100644 index 00000000000..9e1b63eeb44 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +{ + import.defer(...['./empty_FIXTURE.js']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..f80e559ab1f --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +label: { + import.defer(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..cc9e2461149 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +label: { + new import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js new file mode 100644 index 00000000000..549bee7f11e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +label: { + import.defer(...['./empty_FIXTURE.js']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..63f321e3aa5 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +do { + import.defer(); +} while (false); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..2409a5dd070 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +do { + new import.defer('./empty_FIXTURE.js'); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js new file mode 100644 index 00000000000..47eb8715564 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +do { + import.defer(...['./empty_FIXTURE.js']); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..0be28a2b2ae --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else import.defer(); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..e8ca2ae8f8a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else new import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js new file mode 100644 index 00000000000..a0eca47e8cc --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else import.defer(...['./empty_FIXTURE.js']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..8af57918ca4 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else { + import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..7461ae77e04 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-new-call-expression.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else { + new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js new file mode 100644 index 00000000000..f9c6f79fbc1 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +if (false) { + +} else { + import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..2d97bd986fe --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +function fn() { + import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..008d4a40d5e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +function fn() { + new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js new file mode 100644 index 00000000000..35709d02267 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +function fn() { + import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..7e436fa46bf --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +function fn() { + return import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..3a5d6e61ab0 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +function fn() { + return new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js new file mode 100644 index 00000000000..757fff388ad --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +function fn() { + return import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..47f7a0bd461 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (true) import.defer(); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..5878734ea57 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-new-call-expression.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (true) new import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js new file mode 100644 index 00000000000..339a36022e1 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +if (true) import.defer(...['./empty_FIXTURE.js']); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..b659460c076 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (true) { + import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..4b73727103d --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +if (true) { + new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js new file mode 100644 index 00000000000..c2f6eb670cf --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +if (true) { + import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..24779ab0a0c --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let x = 0; +while (!x) { + x++; + import.defer(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..af97d6a9ebb --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-new-call-expression.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +let x = 0; +while (!x) { + x++; + new import.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js new file mode 100644 index 00000000000..b68dca56a7e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +let x = 0; +while (!x) { + x++; + import.defer(...['./empty_FIXTURE.js']); +}; diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..97bc80796e4 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +with (import.defer()) {} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..f015efa59c6 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-new-call-expression.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +with (new import.defer('./empty_FIXTURE.js')) {} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js new file mode 100644 index 00000000000..5e77283f2fa --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +with (import.defer(...['./empty_FIXTURE.js'])) {} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..ed47194418e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +with ({}) { + import.defer(); +} + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..990418f4953 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-new-call-expression.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +with ({}) { + new import.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js new file mode 100644 index 00000000000..8d8d9522df5 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, 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 . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +with ({}) { + import.defer(...['./empty_FIXTURE.js']); +} diff --git a/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-assignment-expr-not-optional.js b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-assignment-expr-not-optional.js new file mode 100644 index 00000000000..52a01d89b61 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-assignment-expr-not-optional.js @@ -0,0 +1,26 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + + ImportCall[Yield, Await] : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +import.defer(); + +/* The params region intentionally empty */ diff --git a/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-new-call-expression.js b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-new-call-expression.js new file mode 100644 index 00000000000..61c8bbeccf6 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-new-call-expression.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + + CallExpression: + ImportCall + + ImportCall : + import . defer ( AssignmentExpression[+In, ?Yield, ?Await] ) + +---*/ + +$DONOTEVALUATE(); + +new import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js new file mode 100644 index 00000000000..5af2d29d97a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-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: [import-defer, dynamic-import] +flags: [generated] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + + ImportCall : + import . source ( AssignmentExpression[+In, ?Yield] ) + + This production doesn't allow the following production from ArgumentsList: + + ... AssignmentExpression + +---*/ + +$DONOTEVALUATE(); + +import.defer(...['./empty_FIXTURE.js']); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..193c11cbc85 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js new file mode 100644 index 00000000000..516500efadd --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-arrow-assignment-expression.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..24d32fe0ae3 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-arrow.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js new file mode 100644 index 00000000000..7f997b658de --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-arrow.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..b107f5e49e3 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template +/*--- +description: Calling import.defer('') (nested in async arrow function) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js') +}); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..fdc27fca941 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-await.template +/*--- +description: import.defer() can be used in script code (nested in async arrow function) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js') +}); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..0d89d59654e --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template +/*--- +description: Calling import.defer('') (nested in async arrow function, returned) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js')); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..34a0a6ddea0 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-arrow-fn-return-await.template +/*--- +description: import.defer() can be used in script code (nested in async arrow function, returned) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js')); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..79334eb834a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-function-await.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..9c2cc01ce24 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-function-await.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..3fd238d2017 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-function.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js new file mode 100644 index 00000000000..57d59dc230c --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-function.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..41cf6bef5db --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template +/*--- +description: Calling import.defer('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..f41206d5b64 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-function-return-await.template +/*--- +description: import.defer() can be used in script code (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} + diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..8b7f3ef0d43 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-async-generator-await.template +/*--- +description: Calling import.defer('') (nested in async generator, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js') +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js new file mode 100644 index 00000000000..512ab142b22 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-async-generator-await.template +/*--- +description: import.defer() can be used in script code (nested in async generator, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js') +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..701ea46b679 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-block.template +/*--- +description: Calling import.defer('') (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js new file mode 100644 index 00000000000..2d8672c8681 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-block.template +/*--- +description: import.defer() can be used in script code (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..a10a50825cb --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-block-labeled.template +/*--- +description: Calling import.defer('') (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js new file mode 100644 index 00000000000..7c606206254 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-block-labeled.template +/*--- +description: import.defer() can be used in script code (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..af6d8ba4645 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-do-while.template +/*--- +description: Calling import.defer('') (nested do while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js new file mode 100644 index 00000000000..9f0cc388bd2 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-do-while.template +/*--- +description: import.defer() can be used in script code (nested do while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} while (false); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..3cf0651d35a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-else-braceless.template +/*--- +description: Calling import.defer('') (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js new file mode 100644 index 00000000000..dc98f28e3d1 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-else-braceless.template +/*--- +description: import.defer() can be used in script code (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..a957f7745dd --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-else.template +/*--- +description: Calling import.defer('') (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js new file mode 100644 index 00000000000..5a44d90d821 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-else.template +/*--- +description: import.defer() can be used in script code (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..954c37d18f2 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-function.template +/*--- +description: Calling import.defer('') (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js new file mode 100644 index 00000000000..ac029b0ce7a --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-function.template +/*--- +description: import.defer() can be used in script code (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..2cd2bd54c44 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-function-return.template +/*--- +description: Calling import.defer('') (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js new file mode 100644 index 00000000000..818f667a2c9 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-function-return.template +/*--- +description: import.defer() can be used in script code (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..49d5de3ee46 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-if-braceless.template +/*--- +description: Calling import.defer('') (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js new file mode 100644 index 00000000000..6c2847c652d --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-if-braceless.template +/*--- +description: import.defer() can be used in script code (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..60cf90bc6b3 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-if.template +/*--- +description: Calling import.defer('') (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js new file mode 100644 index 00000000000..225dd3724c5 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-if.template +/*--- +description: import.defer() can be used in script code (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..59a88257d91 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-while.template +/*--- +description: Calling import.defer('') (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js new file mode 100644 index 00000000000..c82a4dafb39 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-while.template +/*--- +description: import.defer() can be used in script code (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +}; diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..806279e0466 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,28 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-with-expression.template +/*--- +description: Calling import.defer('') (nested with syntax in the expression position) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js')) { + assert.sameValue(then, Promise.prototype.then); + assert.sameValue(constructor, Promise); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js new file mode 100644 index 00000000000..32d64e4ad55 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-with-expression.template +/*--- +description: import.defer() can be used in script code (nested with syntax in the expression position) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js')) { + assert.sameValue(then, Promise.prototype.then); + assert.sameValue(constructor, Promise); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..bc790bf6664 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/nested-with.template +/*--- +description: Calling import.defer('') (nested with syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js new file mode 100644 index 00000000000..cd0ca7c31af --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/nested-with.template +/*--- +description: import.defer() can be used in script code (nested with syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); +} diff --git a/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-empty-str-is-valid-assign-expr.js b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-empty-str-is-valid-assign-expr.js new file mode 100644 index 00000000000..d852943805b --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-empty-str-is-valid-assign-expr.js @@ -0,0 +1,15 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-empty-str-is-valid-assign-expr.case +// - src/dynamic-import/syntax/valid/top-level.template +/*--- +description: Calling import.defer('') (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, dynamic-import] +flags: [generated] +info: | + ImportCall : + import( AssignmentExpression ) + +---*/ + +import.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js new file mode 100644 index 00000000000..a4f726f2a83 --- /dev/null +++ b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js @@ -0,0 +1,19 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/import-defer-script-code-valid.case +// - src/dynamic-import/syntax/valid/top-level.template +/*--- +description: import.defer() can be used in script code (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [import-defer, 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.defer('./empty_FIXTURE.js'); From a9d3eb66040fd7215507897105b84b1d0115071e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Mon, 3 Feb 2025 19:37:24 +0100 Subject: [PATCH 2/2] ptomato review --- src/dynamic-import/import-defer-no-rest-param.case | 2 +- src/dynamic-import/import-defer-script-code-valid.case | 5 ----- ...arrow-assignment-expression-import-defer-no-rest-param.js | 2 +- .../invalid/nested-arrow-import-defer-no-rest-param.js | 2 +- ...-async-arrow-function-await-import-defer-no-rest-param.js | 2 +- ...arrow-function-return-await-import-defer-no-rest-param.js | 2 +- ...nested-async-function-await-import-defer-no-rest-param.js | 2 +- .../nested-async-function-import-defer-no-rest-param.js | 2 +- ...async-function-return-await-import-defer-no-rest-param.js | 2 +- .../nested-async-gen-await-import-defer-no-rest-param.js | 2 +- .../invalid/nested-block-import-defer-no-rest-param.js | 2 +- .../nested-block-labeled-import-defer-no-rest-param.js | 2 +- .../invalid/nested-do-while-import-defer-no-rest-param.js | 2 +- .../nested-else-braceless-import-defer-no-rest-param.js | 2 +- .../syntax/invalid/nested-else-import-defer-no-rest-param.js | 2 +- .../invalid/nested-function-import-defer-no-rest-param.js | 2 +- .../nested-function-return-import-defer-no-rest-param.js | 2 +- .../nested-if-braceless-import-defer-no-rest-param.js | 2 +- .../syntax/invalid/nested-if-import-defer-no-rest-param.js | 2 +- .../invalid/nested-while-import-defer-no-rest-param.js | 2 +- .../nested-with-expression-import-defer-no-rest-param.js | 2 +- .../syntax/invalid/nested-with-import-defer-no-rest-param.js | 2 +- .../syntax/invalid/top-level-import-defer-no-rest-param.js | 2 +- ...w-assignment-expression-import-defer-script-code-valid.js | 4 ---- .../valid/nested-arrow-import-defer-script-code-valid.js | 4 ---- ...nc-arrow-function-await-import-defer-script-code-valid.js | 4 ---- ...w-function-return-await-import-defer-script-code-valid.js | 4 ---- ...ed-async-function-await-import-defer-script-code-valid.js | 4 ---- .../nested-async-function-import-defer-script-code-valid.js | 4 ---- ...c-function-return-await-import-defer-script-code-valid.js | 4 ---- .../nested-async-gen-await-import-defer-script-code-valid.js | 4 ---- .../valid/nested-block-import-defer-script-code-valid.js | 4 ---- .../nested-block-labeled-import-defer-script-code-valid.js | 4 ---- .../valid/nested-do-while-import-defer-script-code-valid.js | 4 ---- .../nested-else-braceless-import-defer-script-code-valid.js | 4 ---- .../valid/nested-else-import-defer-script-code-valid.js | 4 ---- .../valid/nested-function-import-defer-script-code-valid.js | 4 ---- .../nested-function-return-import-defer-script-code-valid.js | 4 ---- .../nested-if-braceless-import-defer-script-code-valid.js | 4 ---- .../syntax/valid/nested-if-import-defer-script-code-valid.js | 4 ---- .../valid/nested-while-import-defer-script-code-valid.js | 4 ---- .../nested-with-expression-import-defer-script-code-valid.js | 4 ---- .../valid/nested-with-import-defer-script-code-valid.js | 4 ---- .../syntax/valid/top-level-import-defer-script-code-valid.js | 4 ---- 44 files changed, 22 insertions(+), 111 deletions(-) diff --git a/src/dynamic-import/import-defer-no-rest-param.case b/src/dynamic-import/import-defer-no-rest-param.case index d6e0943865d..ddf5dcb3a4f 100644 --- a/src/dynamic-import/import-defer-no-rest-param.case +++ b/src/dynamic-import/import-defer-no-rest-param.case @@ -6,7 +6,7 @@ desc: ImportCall is not extensible - no rest parameter template: syntax/invalid info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/src/dynamic-import/import-defer-script-code-valid.case b/src/dynamic-import/import-defer-script-code-valid.case index c6d705c6404..6205de6681e 100644 --- a/src/dynamic-import/import-defer-script-code-valid.case +++ b/src/dynamic-import/import-defer-script-code-valid.case @@ -7,10 +7,5 @@ template: syntax/valid features: [import-defer] ---*/ -//- setup -// 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 import.defer('./empty_FIXTURE.js') diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js index 0869028b5a4..36dc8653de5 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-assignment-expression-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js index 3fdb3ca39ff..1e57fdfe76e 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-arrow-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js index b13519c4c98..22a5e081f4f 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-await-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js index 1e48779ce02..db2c249a23c 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-arrow-function-return-await-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js index 5b3032494c9..5b7e2bf803f 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-await-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js index b2541fbabfd..a1a90080e5b 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js index 719b4c16255..cd64f3e05fc 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-function-return-await-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js index d50a6c05634..7327bb0331d 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-async-gen-await-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js index 9e1b63eeb44..1283572dba6 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js index 549bee7f11e..8db4ae84222 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-block-labeled-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js index 47eb8715564..d65cdc136b3 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-do-while-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js index a0eca47e8cc..fb5cf17e42e 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-braceless-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js index f9c6f79fbc1..f5512b9ce0f 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-else-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js index 35709d02267..a491d923136 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js index 757fff388ad..12ce40f3646 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-function-return-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js index 339a36022e1..f09463f785b 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-braceless-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js index c2f6eb670cf..722c57b30cb 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-if-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js index b68dca56a7e..3d076437a62 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-while-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js index 5e77283f2fa..6e7e1345346 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-expression-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js index 8d8d9522df5..46f3d58e2c7 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/nested-with-import-defer-no-rest-param.js @@ -25,7 +25,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js index 5af2d29d97a..253c662311a 100644 --- a/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js +++ b/test/language/expressions/dynamic-import/syntax/invalid/top-level-import-defer-no-rest-param.js @@ -15,7 +15,7 @@ info: | ImportCall : - import . source ( AssignmentExpression[+In, ?Yield] ) + import . defer ( AssignmentExpression[+In, ?Yield] ) This production doesn't allow the following production from ArgumentsList: diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js index 516500efadd..bd14d343ef2 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-assignment-expression-import-defer-script-code-valid.js @@ -21,9 +21,5 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js index 7f997b658de..8d6ae752a16 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-arrow-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js index fdc27fca941..c4dd4e8d3eb 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-await-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js') diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js index 34a0a6ddea0..13d6a41d4ea 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-arrow-function-return-await-import-defer-script-code-valid.js @@ -21,9 +21,5 @@ info: | 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.defer('./empty_FIXTURE.js')); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js index 9c2cc01ce24..2e80b611226 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-await-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js index 57d59dc230c..63f0ec007bf 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js index f41206d5b64..1a791e5a40a 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-function-return-await-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js index 512ab142b22..dbe3c4725b9 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-async-gen-await-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js') diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js index 2d8672c8681..bc55f05c0f0 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js index 7c606206254..37fc1dea25d 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-block-labeled-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js index 9f0cc388bd2..122ef9335f9 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-do-while-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js index dc98f28e3d1..d5b539475b1 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-braceless-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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) { diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js index 5a44d90d821..5ff80e561ca 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-else-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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) { diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js index ac029b0ce7a..951e485bfd2 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js index 818f667a2c9..db192bc1bcd 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-function-return-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js index 6c2847c652d..dbe63393f45 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-braceless-import-defer-script-code-valid.js @@ -21,9 +21,5 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js index 225dd3724c5..6fb92c6e4fd 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-if-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js index c82a4dafb39..684af5eede3 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-while-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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) { diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js index 32d64e4ad55..94537e90795 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-expression-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js')) { assert.sameValue(then, Promise.prototype.then); diff --git a/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js index cd0ca7c31af..aea63922d29 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/nested-with-import-defer-script-code-valid.js @@ -21,10 +21,6 @@ info: | 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.defer('./empty_FIXTURE.js'); diff --git a/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js index a4f726f2a83..34a56ca844a 100644 --- a/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js +++ b/test/language/expressions/dynamic-import/syntax/valid/top-level-import-defer-script-code-valid.js @@ -11,9 +11,5 @@ info: | 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.defer('./empty_FIXTURE.js');