From a3eef3f39fc0ecb7196db8570284cf4a06e57463 Mon Sep 17 00:00:00 2001 From: Rick Waldron Date: Fri, 10 Aug 2018 15:14:38 -0400 Subject: [PATCH] Generate tests --- ...mport-catch-eval-rqstd-abrupt-typeerror.js | 40 ++++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 40 ++++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 61 ++++++++++++++++++ ...row-import-catch-instn-iee-err-circular.js | 50 +++++++++++++++ ...ow-import-catch-instn-iee-err-not-found.js | 49 +++++++++++++++ ...ction-await-eval-rqstd-abrupt-typeerror.js | 40 ++++++++++++ ...nction-await-eval-rqstd-abrupt-urierror.js | 40 ++++++++++++ ...on-await-instn-iee-err-ambiguous-import.js | 61 ++++++++++++++++++ ...c-function-await-instn-iee-err-circular.js | 50 +++++++++++++++ ...-function-await-instn-iee-err-not-found.js | 49 +++++++++++++++ ...nc-function-eval-rqstd-abrupt-typeerror.js | 41 ++++++++++++ ...ync-function-eval-rqstd-abrupt-urierror.js | 41 ++++++++++++ ...function-instn-iee-err-ambiguous-import.js | 62 +++++++++++++++++++ ...d-async-function-instn-iee-err-circular.js | 51 +++++++++++++++ ...-async-function-instn-iee-err-not-found.js | 50 +++++++++++++++ ...eturn-await-eval-rqstd-abrupt-typeerror.js | 40 ++++++++++++ ...return-await-eval-rqstd-abrupt-urierror.js | 40 ++++++++++++ ...rn-await-instn-iee-err-ambiguous-import.js | 61 ++++++++++++++++++ ...ion-return-await-instn-iee-err-circular.js | 50 +++++++++++++++ ...on-return-await-instn-iee-err-not-found.js | 49 +++++++++++++++ ...mport-catch-eval-rqstd-abrupt-typeerror.js | 38 ++++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 38 ++++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 59 ++++++++++++++++++ ...ock-import-catch-instn-iee-err-circular.js | 48 ++++++++++++++ ...ck-import-catch-instn-iee-err-not-found.js | 47 ++++++++++++++ ...ock-labeled-eval-rqstd-abrupt-typeerror.js | 38 ++++++++++++ ...lock-labeled-eval-rqstd-abrupt-urierror.js | 38 ++++++++++++ ...-labeled-instn-iee-err-ambiguous-import.js | 59 ++++++++++++++++++ ...ed-block-labeled-instn-iee-err-circular.js | 48 ++++++++++++++ ...d-block-labeled-instn-iee-err-not-found.js | 47 ++++++++++++++ ...mport-catch-eval-rqstd-abrupt-typeerror.js | 40 ++++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 40 ++++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 61 ++++++++++++++++++ ...-do-import-catch-instn-iee-err-circular.js | 50 +++++++++++++++ ...do-import-catch-instn-iee-err-not-found.js | 49 +++++++++++++++ ...ed-do-while-eval-rqstd-abrupt-typeerror.js | 38 ++++++++++++ ...ted-do-while-eval-rqstd-abrupt-urierror.js | 38 ++++++++++++ ...do-while-instn-iee-err-ambiguous-import.js | 59 ++++++++++++++++++ ...-nested-do-while-instn-iee-err-circular.js | 48 ++++++++++++++ ...nested-do-while-instn-iee-err-not-found.js | 47 ++++++++++++++ ...mport-catch-eval-rqstd-abrupt-typeerror.js | 40 ++++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 40 ++++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 61 ++++++++++++++++++ ...lse-import-catch-instn-iee-err-circular.js | 50 +++++++++++++++ ...se-import-catch-instn-iee-err-not-found.js | 49 +++++++++++++++ ...mport-catch-eval-rqstd-abrupt-typeerror.js | 39 ++++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 39 ++++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 60 ++++++++++++++++++ ...ion-import-catch-instn-iee-err-circular.js | 49 +++++++++++++++ ...on-import-catch-instn-iee-err-not-found.js | 48 ++++++++++++++ ...mport-catch-eval-rqstd-abrupt-typeerror.js | 38 ++++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 38 ++++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 59 ++++++++++++++++++ ...-if-import-catch-instn-iee-err-circular.js | 48 ++++++++++++++ ...if-import-catch-instn-iee-err-not-found.js | 47 ++++++++++++++ ...mport-catch-eval-rqstd-abrupt-typeerror.js | 38 ++++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 38 ++++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 59 ++++++++++++++++++ ...ock-import-catch-instn-iee-err-circular.js | 48 ++++++++++++++ ...ck-import-catch-instn-iee-err-not-found.js | 47 ++++++++++++++ ...mport-catch-eval-rqstd-abrupt-typeerror.js | 40 ++++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 40 ++++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 61 ++++++++++++++++++ ...ile-import-catch-instn-iee-err-circular.js | 50 +++++++++++++++ ...le-import-catch-instn-iee-err-not-found.js | 49 +++++++++++++++ ...mport-catch-eval-rqstd-abrupt-typeerror.js | 36 +++++++++++ ...import-catch-eval-rqstd-abrupt-urierror.js | 36 +++++++++++ ...rt-catch-instn-iee-err-ambiguous-import.js | 57 +++++++++++++++++ ...vel-import-catch-instn-iee-err-circular.js | 46 ++++++++++++++ ...el-import-catch-instn-iee-err-not-found.js | 45 ++++++++++++++ ...pression-eval-gtbdng-indirect-update-as.js | 52 ++++++++++++++++ ...ession-eval-gtbdng-indirect-update-dflt.js | 45 ++++++++++++++ ...expression-eval-gtbndng-indirect-update.js | 53 ++++++++++++++++ ...w-assignment-expression-returns-promise.js | 32 ++++++++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 54 ++++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 47 ++++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 55 ++++++++++++++++ ...ested-arrow-import-then-returns-promise.js | 34 ++++++++++ ...on-await-eval-gtbdng-indirect-update-as.js | 53 ++++++++++++++++ ...-await-eval-gtbdng-indirect-update-dflt.js | 46 ++++++++++++++ ...tion-await-eval-gtbndng-indirect-update.js | 54 ++++++++++++++++ ...ed-async-function-await-returns-promise.js | 33 ++++++++++ ...function-eval-gtbdng-indirect-update-as.js | 54 ++++++++++++++++ ...nction-eval-gtbdng-indirect-update-dflt.js | 47 ++++++++++++++ ...c-function-eval-gtbndng-indirect-update.js | 55 ++++++++++++++++ ...rn-await-eval-gtbdng-indirect-update-as.js | 53 ++++++++++++++++ ...-await-eval-gtbdng-indirect-update-dflt.js | 46 ++++++++++++++ ...turn-await-eval-gtbndng-indirect-update.js | 54 ++++++++++++++++ ...c-function-return-await-returns-promise.js | 33 ++++++++++ .../nested-async-function-returns-promise.js | 34 ++++++++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 51 +++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 44 +++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 52 ++++++++++++++++ ...ested-block-import-then-returns-promise.js | 31 ++++++++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 53 ++++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 46 ++++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 54 ++++++++++++++++ .../nested-do-import-then-returns-promise.js | 33 ++++++++++ ...do-while-eval-gtbdng-indirect-update-as.js | 51 +++++++++++++++ ...-while-eval-gtbdng-indirect-update-dflt.js | 44 +++++++++++++ ...d-do-while-eval-gtbndng-indirect-update.js | 52 ++++++++++++++++ .../nested-do-while-returns-promise.js | 31 ++++++++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 53 ++++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 46 ++++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 54 ++++++++++++++++ ...nested-else-import-then-returns-promise.js | 33 ++++++++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 52 ++++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 45 ++++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 53 ++++++++++++++++ ...ed-function-import-then-returns-promise.js | 32 ++++++++++ ...raceless-eval-gtbdng-indirect-update-as.js | 38 ++++++++++++ ...celess-eval-gtbdng-indirect-update-dflt.js | 37 +++++++++++ ...-braceless-eval-gtbndng-indirect-update.js | 38 ++++++++++++ .../nested-if-braceless-returns-promise.js | 25 ++++++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 51 +++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 44 +++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 52 ++++++++++++++++ .../nested-if-import-then-returns-promise.js | 31 ++++++++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 51 +++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 44 +++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 52 ++++++++++++++++ ...beled-block-import-then-returns-promise.js | 31 ++++++++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 53 ++++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 46 ++++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 54 ++++++++++++++++ ...ested-while-import-then-returns-promise.js | 33 ++++++++++ ...nment-expression-empty-args-early-error.js | 35 +++++++++++ ...row-assignment-expression-empty-str-arg.js | 25 ++++++++ ...tax-nested-arrow-empty-args-early-error.js | 37 +++++++++++ .../syntax-nested-arrow-empty-str-arg.js | 27 ++++++++ ...tax-nested-block-empty-args-early-error.js | 37 +++++++++++ .../syntax-nested-block-empty-str-arg.js | 27 ++++++++ ...ed-block-labeled-empty-args-early-error.js | 37 +++++++++++ ...ntax-nested-block-labeled-empty-str-arg.js | 27 ++++++++ ...-labeled-eval-gtbdng-indirect-update-as.js | 51 +++++++++++++++ ...abeled-eval-gtbdng-indirect-update-dflt.js | 44 +++++++++++++ ...ck-labeled-eval-gtbndng-indirect-update.js | 52 ++++++++++++++++ ...ax-nested-block-labeled-returns-promise.js | 31 ++++++++++ ...syntax-nested-do-empty-args-early-error.js | 39 ++++++++++++ .../syntax-nested-do-empty-str-arg.js | 29 +++++++++ ...-nested-do-while-empty-args-early-error.js | 37 +++++++++++ .../syntax-nested-do-while-empty-str-arg.js | 27 ++++++++ ...d-else-braceless-empty-args-early-error.js | 37 +++++++++++ ...tax-nested-else-braceless-empty-str-arg.js | 27 ++++++++ ...ntax-nested-else-empty-args-early-error.js | 39 ++++++++++++ .../syntax-nested-else-empty-str-arg.js | 29 +++++++++ ...-nested-function-empty-args-early-error.js | 37 +++++++++++ .../syntax-nested-function-empty-str-arg.js | 27 ++++++++ ...-function-return-empty-args-early-error.js | 37 +++++++++++ ...ax-nested-function-return-empty-str-arg.js | 27 ++++++++ ...ted-if-braceless-empty-args-early-error.js | 35 +++++++++++ ...yntax-nested-if-braceless-empty-str-arg.js | 25 ++++++++ ...syntax-nested-if-empty-args-early-error.js | 37 +++++++++++ .../syntax-nested-if-empty-str-arg.js | 27 ++++++++ ...ed-labeled-block-empty-args-early-error.js | 37 +++++++++++ ...ntax-nested-labeled-block-empty-str-arg.js | 27 ++++++++ ...tax-nested-while-empty-args-early-error.js | 39 ++++++++++++ .../syntax-nested-while-empty-str-arg.js | 29 +++++++++ ...syntax-top-level-empty-args-early-error.js | 25 ++++++++ .../syntax-top-level-empty-str-arg.js | 15 +++++ ...ort-then-eval-gtbdng-indirect-update-as.js | 49 +++++++++++++++ ...t-then-eval-gtbdng-indirect-update-dflt.js | 42 +++++++++++++ ...mport-then-eval-gtbndng-indirect-update.js | 50 +++++++++++++++ .../top-level-import-then-returns-promise.js | 29 +++++++++ 164 files changed, 7102 insertions(+) create mode 100644 test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-await-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-await-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-return-await-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-labeled-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-labeled-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-while-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-while-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-else-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-else-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-function-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-function-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-if-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-if-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-while-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-while-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/catch-top-level-import-catch-eval-rqstd-abrupt-typeerror.js create mode 100644 test/language/module-code/dynamic-import/catch-top-level-import-catch-eval-rqstd-abrupt-urierror.js create mode 100644 test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-ambiguous-import.js create mode 100644 test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-circular.js create mode 100644 test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-not-found.js create mode 100644 test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-arrow-assignment-expression-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-arrow-import-then-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-await-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-return-await-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-async-function-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-block-import-then-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-do-import-then-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-do-while-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-do-while-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-do-while-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-do-while-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-else-import-then-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-function-import-then-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-if-braceless-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-if-import-then-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-labeled-block-import-then-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/nested-while-import-then-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-arrow-assignment-expression-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-arrow-assignment-expression-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-arrow-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-arrow-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-block-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-block-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-block-labeled-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-block-labeled-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-block-labeled-returns-promise.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-do-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-do-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-do-while-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-do-while-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-else-braceless-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-else-braceless-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-else-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-else-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-function-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-function-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-function-return-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-function-return-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-if-braceless-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-if-braceless-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-if-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-if-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-labeled-block-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-labeled-block-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-while-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-nested-while-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/syntax-top-level-empty-args-early-error.js create mode 100644 test/language/module-code/dynamic-import/syntax-top-level-empty-str-arg.js create mode 100644 test/language/module-code/dynamic-import/top-level-import-then-eval-gtbdng-indirect-update-as.js create mode 100644 test/language/module-code/dynamic-import/top-level-import-then-eval-gtbdng-indirect-update-dflt.js create mode 100644 test/language/module-code/dynamic-import/top-level-import-then-eval-gtbndng-indirect-update.js create mode 100644 test/language/module-code/dynamic-import/top-level-import-then-returns-promise.js diff --git a/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..d3dd8e2c18 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-arrow.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +let f = () => { + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +}; + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..fee78c1ceb --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-arrow.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +let f = () => { + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +}; + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..da618ae27d --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-arrow.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +let f = () => { + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..7430e694eb --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-circular.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-arrow.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +let f = () => { + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..610b63ea89 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-arrow-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-arrow.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +let f = () => { + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-await-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-async-function-await-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..4dcec7ce67 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-await-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-async-function-await.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +async function f() { + await import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-await-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-async-function-await-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..356f1e4065 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-await-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-async-function-await.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +async function f() { + await import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..e55ce63b7b --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-ambiguous-import.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-async-function-await.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +async function f() { + await import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-circular.js new file mode 100644 index 0000000000..e78815a8a4 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-circular.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-async-function-await.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +async function f() { + await import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-not-found.js new file mode 100644 index 0000000000..a90a98d3e5 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-await-instn-iee-err-not-found.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-async-function-await.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +async function f() { + await import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-async-function-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..f2241b0f48 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-async-function.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +async function f() { + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-async-function-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..542922c561 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-async-function.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +async function f() { + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..f538caa95d --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-ambiguous-import.js @@ -0,0 +1,62 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-async-function.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +async function f() { + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-circular.js new file mode 100644 index 0000000000..503aa178ef --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-circular.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-async-function.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +async function f() { + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-not-found.js new file mode 100644 index 0000000000..0a0448db7c --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-instn-iee-err-not-found.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-async-function.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +async function f() { + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..cd30196830 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-async-function-return-await.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +async function f() { + return await import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..36070045dd --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-async-function-return-await.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +async function f() { + return await import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..83ccba5bc5 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-ambiguous-import.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-async-function-return-await.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +async function f() { + return await import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-circular.js new file mode 100644 index 0000000000..a466241050 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-circular.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-async-function-return-await.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +async function f() { + return await import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-not-found.js new file mode 100644 index 0000000000..305ba0b1fb --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-async-function-return-await-instn-iee-err-not-found.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-async-function-return-await.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +async function f() { + return await import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-block-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..2b52f97d36 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-block.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +{ + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..f589833cbc --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-block.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +{ + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..010f8f864d --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-block.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +{ + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..0925b34163 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-circular.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-block.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +{ + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..28f5d28798 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-block.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +{ + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-labeled-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-block-labeled-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..cf864c22b9 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-labeled-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-block-labeled.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +label: { + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-labeled-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-block-labeled-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..c797b0cb96 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-labeled-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-block-labeled.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +label: { + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..1241fc4ce6 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-ambiguous-import.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-block-labeled.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +label: { + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-circular.js new file mode 100644 index 0000000000..6e78144ba0 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-circular.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-block-labeled.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +label: { + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-not-found.js new file mode 100644 index 0000000000..f5bc0d63b5 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-block-labeled-instn-iee-err-not-found.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-block-labeled.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +label: { + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-do-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..69b87face8 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-do.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +let x = 0; +do { + x++; + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..82f5aff7fa --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-do.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +let x = 0; +do { + x++; + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..14be5f0626 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-do.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +let x = 0; +do { + x++; + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..d25f0e304c --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-circular.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-do.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +let x = 0; +do { + x++; + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..d516db8f5d --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-do.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +let x = 0; +do { + x++; + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-while-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-do-while-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..20cc8cc346 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-while-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-do-while.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +do { + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-while-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-do-while-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..f1925e4051 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-while-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-do-while.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +do { + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..691e76ea83 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-ambiguous-import.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-do-while.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +do { + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-circular.js new file mode 100644 index 0000000000..5ed7dee8ee --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-circular.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-do-while.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +do { + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-not-found.js new file mode 100644 index 0000000000..cf1d999409 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-do-while-instn-iee-err-not-found.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-do-while.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +do { + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/catch-nested-else-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..8d7410255d --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-else.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +if (false) { + +} else { + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-else-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..0d8ef65125 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-else.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +if (false) { + +} else { + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..0f0995465e --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-else.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +if (false) { + +} else { + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..398905eb5a --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-circular.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-else.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +if (false) { + +} else { + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..497f53b92b --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-else-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-else.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +if (false) { + +} else { + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-function-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..b2d9039a18 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-function.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +function f() { + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-function-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..049c6a848f --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-function.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +function f() { + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..4b95b46ef2 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,60 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-function.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +function f() { + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..9ac9e48458 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-circular.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-function.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +function f() { + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..cac01e5775 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-function-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-function.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +function f() { + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/catch-nested-if-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..1d5c5cff95 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-if.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +if (true) { + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-if-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..c8129cd835 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-if.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +if (true) { + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..806234f20e --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-if.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +if (true) { + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..c05a1bfbb3 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-circular.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-if.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +if (true) { + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..38f0a23a9c --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-if-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-if.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +if (true) { + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +} diff --git a/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..def11447ed --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-labeled-block.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested labeled block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +{ + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..0c80635125 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-labeled-block.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested labeled block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +{ + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..62fac9d811 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,59 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-labeled-block.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested labeled block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +{ + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..b05107a793 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-circular.js @@ -0,0 +1,48 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-labeled-block.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested labeled block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +{ + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..2d0b57272a --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-labeled-block-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-labeled-block.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested labeled block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +{ + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-while-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..804e0de637 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/nested-while.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +let x = 0; +while (!x) { + x++; + import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-while-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..7d81ffe055 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,40 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/nested-while.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +let x = 0; +while (!x) { + x++; + import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..425ee8abec --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,61 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/nested-while.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +let x = 0; +while (!x) { + x++; + import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..ddabf88a5f --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-circular.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/nested-while.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +let x = 0; +while (!x) { + x++; + import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..5af4559a2f --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-nested-while-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/nested-while.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +let x = 0; +while (!x) { + x++; + import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + + }).then($DONE, $DONE); +}; diff --git a/test/language/module-code/dynamic-import/catch-top-level-import-catch-eval-rqstd-abrupt-typeerror.js b/test/language/module-code/dynamic-import/catch-top-level-import-catch-eval-rqstd-abrupt-typeerror.js new file mode 100644 index 0000000000..2ba7b3d398 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-top-level-import-catch-eval-rqstd-abrupt-typeerror.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-typeerror.case +// - src/dynamic-import/catch/top-level.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +import('./eval-rqstd-abrupt-err-type_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'TypeError'); + +}).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/catch-top-level-import-catch-eval-rqstd-abrupt-urierror.js b/test/language/module-code/dynamic-import/catch-top-level-import-catch-eval-rqstd-abrupt-urierror.js new file mode 100644 index 0000000000..ee7e0324b1 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-top-level-import-catch-eval-rqstd-abrupt-urierror.js @@ -0,0 +1,36 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-rqstd-abrupt-urierror.case +// - src/dynamic-import/catch/top-level.template +/*--- +description: Abrupt completion during module evaluation precludes further evaluation (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 6. For each String required that is an element of + module.[[RequestedModules]] do, + a. Let requiredModule be ? HostResolveImportedModule(module, required). + b. Perform ? requiredModule.ModuleEvaluation(). + +---*/ + +import('./eval-rqstd-abrupt-err-uri_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'URIError'); + +}).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-ambiguous-import.js b/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-ambiguous-import.js new file mode 100644 index 0000000000..fd005b2a7e --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-ambiguous-import.js @@ -0,0 +1,57 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-ambiguous-import.case +// - src/dynamic-import/catch/top-level.template +/*--- +description: IndirectExportEntries validation - ambiguous imported bindings (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + a. Let importedModule be ? HostResolveImportedModule(module, + e.[[ModuleRequest]]). + b. Let resolution be ? importedModule.ResolveExport(exportName, + resolveSet, exportStarSet). + c. If resolution is "ambiguous", return "ambiguous". + d. If resolution is not null, then + i. If starResolution is null, let starResolution be resolution. + ii. Else, + 1. Assert: there is more than one * import that includes the + requested name. + 2. If resolution.[[Module]] and starResolution.[[Module]] are + not the same Module Record or + SameValue(resolution.[[BindingName]], + starResolution.[[BindingName]]) is false, return "ambiguous". + +---*/ + +import('./instn-iee-err-ambiguous-export.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + +}).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-circular.js b/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-circular.js new file mode 100644 index 0000000000..b49b91aa79 --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-circular.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-circular.case +// - src/dynamic-import/catch/top-level.template +/*--- +description: IndirectExportEntries validation - circular imported bindings (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 2. For each Record {[[Module]], [[ExportName]]} r in resolveSet, do: + a. If module and r.[[Module]] are the same Module Record and + SameValue(exportName, r.[[ExportName]]) is true, then + i. Assert: this is a circular import request. + ii. Return null. + +---*/ + +import('./instn-iee-err-circular-1_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + +}).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-not-found.js b/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-not-found.js new file mode 100644 index 0000000000..3b2687a4ad --- /dev/null +++ b/test/language/module-code/dynamic-import/catch-top-level-import-catch-instn-iee-err-not-found.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/instn-iee-err-not-found.case +// - src/dynamic-import/catch/top-level.template +/*--- +description: IndirectExportEntries validation - undefined imported bindings (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + [...] + 9. For each ExportEntry Record e in module.[[IndirectExportEntries]], do + a. Let resolution be ? module.ResolveExport(e.[[ExportName]], « », « »). + b. If resolution is null or resolution is "ambiguous", throw a + SyntaxError exception. + [...] + + 15.2.1.16.3 ResolveExport + + [...] + 9. Let starResolution be null. + 10. For each ExportEntry Record e in module.[[StarExportEntries]], do + [...] + 11. Return starResolution. + +---*/ + +import('./instn-iee-err-not-found-empty_FIXTURE.js').catch(error => { + + assert.sameValue(error.name, 'SyntaxError'); + +}).then($DONE, $DONE); diff --git a/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..545e981884 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-arrow-assignment-expression.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let f = () => import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + +}); + + +f().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..c9f6e65b04 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-arrow-assignment-expression.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let f = () => import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + +}); + + +f().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..cb20f04e07 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-eval-gtbndng-indirect-update.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-arrow-assignment-expression.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let f = () => import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + +}); + + +f().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-returns-promise.js b/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-returns-promise.js new file mode 100644 index 0000000000..eda3df1e63 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-arrow-assignment-expression-returns-promise.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-arrow-assignment-expression.template +/*--- +description: Dynamic import() returns a Promise object. (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +let f = () => import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + +}); + + +f().then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..b7003ab322 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-arrow.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let f = () => { + return import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +}; + +f(); + diff --git a/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..a0bc4f6118 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-arrow.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let f = () => { + return import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +}; + +f(); + diff --git a/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..a628f0fe23 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-arrow-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-arrow.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let f = () => { + return import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +}; + +f(); + diff --git a/test/language/module-code/dynamic-import/nested-arrow-import-then-returns-promise.js b/test/language/module-code/dynamic-import/nested-arrow-import-then-returns-promise.js new file mode 100644 index 0000000000..c493f161ec --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-arrow-import-then-returns-promise.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-arrow.template +/*--- +description: Dynamic import() returns a Promise object. (nested arrow) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +let f = () => { + return import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +}; + +f(); + diff --git a/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..7bd542f035 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-async-function-await.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + await import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..221652668d --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-async-function-await.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + await import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..29ba474181 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-await-eval-gtbndng-indirect-update.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-async-function-await.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + await import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/nested-async-function-await-returns-promise.js b/test/language/module-code/dynamic-import/nested-async-function-await-returns-promise.js new file mode 100644 index 0000000000..f33fe9e1c3 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-await-returns-promise.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-async-function-await.template +/*--- +description: Dynamic import() returns a Promise object. (nested in async function, awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +async function f() { + await import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/nested-async-function-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-async-function-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..2e1aee6414 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-async-function.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/nested-async-function-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-async-function-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..c630118a38 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,47 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-async-function.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/nested-async-function-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-async-function-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..7ae650320d --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-eval-gtbndng-indirect-update.js @@ -0,0 +1,55 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-async-function.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..13eaf7fcad --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-async-function-return-await.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + return await import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..59a9c9f9c2 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-async-function-return-await.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + return await import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..bc5a0a2492 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-return-await-eval-gtbndng-indirect-update.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-async-function-return-await.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +async function f() { + return await import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/nested-async-function-return-await-returns-promise.js b/test/language/module-code/dynamic-import/nested-async-function-return-await-returns-promise.js new file mode 100644 index 0000000000..e45fa91f82 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-return-await-returns-promise.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-async-function-return-await.template +/*--- +description: Dynamic import() returns a Promise object. (nested in async function, returns awaited) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +async function f() { + return await import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); diff --git a/test/language/module-code/dynamic-import/nested-async-function-returns-promise.js b/test/language/module-code/dynamic-import/nested-async-function-returns-promise.js new file mode 100644 index 0000000000..82e89546b8 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-async-function-returns-promise.js @@ -0,0 +1,34 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-async-function.template +/*--- +description: Dynamic import() returns a Promise object. (nested in async function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +async function f() { + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +} + +f(); + diff --git a/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..c6c01eee0b --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-block.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +{ + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..44c507e253 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-block.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +{ + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..1af6e52282 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-block-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-block.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +{ + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-block-import-then-returns-promise.js b/test/language/module-code/dynamic-import/nested-block-import-then-returns-promise.js new file mode 100644 index 0000000000..1f8a6d5acc --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-block-import-then-returns-promise.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-block.template +/*--- +description: Dynamic import() returns a Promise object. (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +{ + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..927946f27e --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-do.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let x = 0; +do { + x++; + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..2c1f465f1e --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-do.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let x = 0; +do { + x++; + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..688af7d713 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-do-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-do.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let x = 0; +do { + x++; + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/nested-do-import-then-returns-promise.js b/test/language/module-code/dynamic-import/nested-do-import-then-returns-promise.js new file mode 100644 index 0000000000..29de981dc1 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-do-import-then-returns-promise.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-do.template +/*--- +description: Dynamic import() returns a Promise object. (nested do) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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; +do { + x++; + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +} while (!x); diff --git a/test/language/module-code/dynamic-import/nested-do-while-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-do-while-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..7c49a9ca28 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-do-while-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-do-while.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +do { + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/nested-do-while-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-do-while-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..5621b275ae --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-do-while-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-do-while.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +do { + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/nested-do-while-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-do-while-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..be36ad03c2 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-do-while-eval-gtbndng-indirect-update.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-do-while.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +do { + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/nested-do-while-returns-promise.js b/test/language/module-code/dynamic-import/nested-do-while-returns-promise.js new file mode 100644 index 0000000000..ea2e9f4751 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-do-while-returns-promise.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-do-while.template +/*--- +description: Dynamic import() returns a Promise object. (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +do { + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +} while (false); diff --git a/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..352c027354 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-else.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (false) { + +} else { + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..9e6e6f35fb --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-else.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (false) { + +} else { + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..e6e717cbd6 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-else-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-else.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (false) { + +} else { + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/test/language/module-code/dynamic-import/nested-else-import-then-returns-promise.js b/test/language/module-code/dynamic-import/nested-else-import-then-returns-promise.js new file mode 100644 index 0000000000..e075b80da8 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-else-import-then-returns-promise.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-else.template +/*--- +description: Dynamic import() returns a Promise object. (nested else) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +if (false) { + +} else { + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..059dd785ea --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-function.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +function f() { + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..0620c5a58b --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,45 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-function.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +function f() { + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..7c87e1c5d9 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-function-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-function.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +function f() { + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/nested-function-import-then-returns-promise.js b/test/language/module-code/dynamic-import/nested-function-import-then-returns-promise.js new file mode 100644 index 0000000000..4f4812175e --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-function-import-then-returns-promise.js @@ -0,0 +1,32 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-function.template +/*--- +description: Dynamic import() returns a Promise object. (nested function) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +function f() { + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +} +f(); diff --git a/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..99e03782de --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-if-braceless.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (true) import('./eval-gtbndng-indirect-update-as_FIXTURE.js'); diff --git a/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..e874558a68 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-if-braceless.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (true) import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js'); diff --git a/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..8954567c94 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-if-braceless-eval-gtbndng-indirect-update.js @@ -0,0 +1,38 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-if-braceless.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (true) import('./eval-gtbndng-indirect-update_FIXTURE.js'); diff --git a/test/language/module-code/dynamic-import/nested-if-braceless-returns-promise.js b/test/language/module-code/dynamic-import/nested-if-braceless-returns-promise.js new file mode 100644 index 0000000000..96ba15ffda --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-if-braceless-returns-promise.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-if-braceless.template +/*--- +description: Dynamic import() returns a Promise object. (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +if (true) import('./dynamic-import-module_FIXTURE.js'); diff --git a/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..b81e32fc01 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-if.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (true) { + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..bcd0e6785e --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-if.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (true) { + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..4e12e893e8 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-if-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-if.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +if (true) { + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/test/language/module-code/dynamic-import/nested-if-import-then-returns-promise.js b/test/language/module-code/dynamic-import/nested-if-import-then-returns-promise.js new file mode 100644 index 0000000000..1e645800f6 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-if-import-then-returns-promise.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-if.template +/*--- +description: Dynamic import() returns a Promise object. (nested if) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +if (true) { + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +} diff --git a/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..355e4b14f2 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-labeled-block.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +{ + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..290cb94175 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-labeled-block.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +{ + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..f63f23bc37 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-labeled-block-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-labeled-block.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +{ + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-labeled-block-import-then-returns-promise.js b/test/language/module-code/dynamic-import/nested-labeled-block-import-then-returns-promise.js new file mode 100644 index 0000000000..b8a8900ff8 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-labeled-block-import-then-returns-promise.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-labeled-block.template +/*--- +description: Dynamic import() returns a Promise object. (nested block) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +{ + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..ede671bde4 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,53 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-while.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let x = 0; +while (!x) { + x++; + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..1f8199b850 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,46 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-while.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let x = 0; +while (!x) { + x++; + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..5c3cc2f883 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-while-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,54 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-while.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +let x = 0; +while (!x) { + x++; + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/nested-while-import-then-returns-promise.js b/test/language/module-code/dynamic-import/nested-while-import-then-returns-promise.js new file mode 100644 index 0000000000..3450da3be0 --- /dev/null +++ b/test/language/module-code/dynamic-import/nested-while-import-then-returns-promise.js @@ -0,0 +1,33 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-while.template +/*--- +description: Dynamic import() returns a Promise object. (nested while) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +let x = 0; +while (!x) { + x++; + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-arrow-assignment-expression-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-arrow-assignment-expression-empty-args-early-error.js new file mode 100644 index 0000000000..5c06738522 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-arrow-assignment-expression-empty-args-early-error.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-arrow-assignment-expression.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +let f = () => import(); + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-arrow-assignment-expression-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-arrow-assignment-expression-empty-str-arg.js new file mode 100644 index 0000000000..ce0b581a7a --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-arrow-assignment-expression-empty-str-arg.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-arrow-assignment-expression.template +/*--- +description: Calling import('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); diff --git a/test/language/module-code/dynamic-import/syntax-nested-arrow-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-arrow-empty-args-early-error.js new file mode 100644 index 0000000000..fbc44c0d83 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-arrow-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-arrow.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +let f = () => { + import(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-arrow-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-arrow-empty-str-arg.js new file mode 100644 index 0000000000..8c5e9602ce --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-arrow-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-arrow.template +/*--- +description: Calling import('') (nested arrow syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-block-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-block-empty-args-early-error.js new file mode 100644 index 0000000000..60aba8f023 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-block-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-block.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +{ + import(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-block-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-block-empty-str-arg.js new file mode 100644 index 0000000000..2a705227c7 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-block-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-block.template +/*--- +description: Calling import('') (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-block-labeled-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-empty-args-early-error.js new file mode 100644 index 0000000000..256e77e20e --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-block-labeled.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +label: { + import(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-block-labeled-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-empty-str-arg.js new file mode 100644 index 0000000000..804da47269 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-block-labeled.template +/*--- +description: Calling import('') (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..dd5670458e --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,51 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/nested-block-labeled.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +label: { + import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..f005fa354a --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/nested-block-labeled.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +label: { + import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..5120fee1ef --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-eval-gtbndng-indirect-update.js @@ -0,0 +1,52 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/nested-block-labeled.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +label: { + import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-block-labeled-returns-promise.js b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-returns-promise.js new file mode 100644 index 0000000000..d71e8bdabc --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-block-labeled-returns-promise.js @@ -0,0 +1,31 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/nested-block-labeled.template +/*--- +description: Dynamic import() returns a Promise object. (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +label: { + import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + }).then($DONE, $DONE).catch($DONE); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-do-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-do-empty-args-early-error.js new file mode 100644 index 0000000000..1e8786cb39 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-do-empty-args-early-error.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-do.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +let x = 0; +do { + x++; + import(); +} while (!x); + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-do-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-do-empty-str-arg.js new file mode 100644 index 0000000000..aba87ff9c3 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-do-empty-str-arg.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-do.template +/*--- +description: Calling import('') (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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; +do { + x++; + import(''); +} while (!x); diff --git a/test/language/module-code/dynamic-import/syntax-nested-do-while-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-do-while-empty-args-early-error.js new file mode 100644 index 0000000000..c5fdf1e304 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-do-while-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-do-while.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +do { + import(); +} while (false); + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-do-while-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-do-while-empty-str-arg.js new file mode 100644 index 0000000000..20302c073f --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-do-while-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-do-while.template +/*--- +description: Calling import('') (nested do syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +do { + import(''); +} while (false); diff --git a/test/language/module-code/dynamic-import/syntax-nested-else-braceless-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-else-braceless-empty-args-early-error.js new file mode 100644 index 0000000000..c8836d6e2f --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-else-braceless-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-else-braceless.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +if (false) { + +} else import(); + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-else-braceless-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-else-braceless-empty-str-arg.js new file mode 100644 index 0000000000..07ffca60ec --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-else-braceless-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-else-braceless.template +/*--- +description: Calling import('') (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); diff --git a/test/language/module-code/dynamic-import/syntax-nested-else-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-else-empty-args-early-error.js new file mode 100644 index 0000000000..7873b82c6e --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-else-empty-args-early-error.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-else.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +if (false) { + +} else { + import(); +} + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-else-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-else-empty-str-arg.js new file mode 100644 index 0000000000..3345d993d2 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-else-empty-str-arg.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-else.template +/*--- +description: Calling import('') (nested else syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +} diff --git a/test/language/module-code/dynamic-import/syntax-nested-function-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-function-empty-args-early-error.js new file mode 100644 index 0000000000..56fcf6eaa6 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-function-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-function.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +function fn() { + import(); +} + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-function-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-function-empty-str-arg.js new file mode 100644 index 0000000000..9d87e7be3c --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-function-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-function.template +/*--- +description: Calling import('') (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +} diff --git a/test/language/module-code/dynamic-import/syntax-nested-function-return-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-function-return-empty-args-early-error.js new file mode 100644 index 0000000000..3bec664567 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-function-return-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-function-return.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +function fn() { + return import(); +} + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-function-return-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-function-return-empty-str-arg.js new file mode 100644 index 0000000000..113adbc955 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-function-return-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-function-return.template +/*--- +description: Calling import('') (nested function syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +} diff --git a/test/language/module-code/dynamic-import/syntax-nested-if-braceless-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-if-braceless-empty-args-early-error.js new file mode 100644 index 0000000000..05f23a2ab0 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-if-braceless-empty-args-early-error.js @@ -0,0 +1,35 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-if-braceless.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +if (true) import(); + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-if-braceless-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-if-braceless-empty-str-arg.js new file mode 100644 index 0000000000..f8ce09ce0d --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-if-braceless-empty-str-arg.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-if-braceless.template +/*--- +description: Calling import('') (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); diff --git a/test/language/module-code/dynamic-import/syntax-nested-if-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-if-empty-args-early-error.js new file mode 100644 index 0000000000..3b8389b0cd --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-if-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-if.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +if (true) { + import(); +} + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-if-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-if-empty-str-arg.js new file mode 100644 index 0000000000..f6845b9ebf --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-if-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-if.template +/*--- +description: Calling import('') (nested if syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +} diff --git a/test/language/module-code/dynamic-import/syntax-nested-labeled-block-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-labeled-block-empty-args-early-error.js new file mode 100644 index 0000000000..f857a4bbfb --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-labeled-block-empty-args-early-error.js @@ -0,0 +1,37 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-labeled.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +{ + import(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-labeled-block-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-labeled-block-empty-str-arg.js new file mode 100644 index 0000000000..6487baceea --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-labeled-block-empty-str-arg.js @@ -0,0 +1,27 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-labeled.template +/*--- +description: Calling import('') (nested block syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +}; diff --git a/test/language/module-code/dynamic-import/syntax-nested-while-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-nested-while-empty-args-early-error.js new file mode 100644 index 0000000000..e85863b54c --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-while-empty-args-early-error.js @@ -0,0 +1,39 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/nested-while.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +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() + +---*/ +throw "Test262: This statement should not be evaluated."; + +let x = 0; +while (!x) { + x++; + import(); +}; + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-nested-while-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-nested-while-empty-str-arg.js new file mode 100644 index 0000000000..e4794eadea --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-nested-while-empty-str-arg.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/nested-while.template +/*--- +description: Calling import('') (nested while syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let 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(''); +}; diff --git a/test/language/module-code/dynamic-import/syntax-top-level-empty-args-early-error.js b/test/language/module-code/dynamic-import/syntax-top-level-empty-args-early-error.js new file mode 100644 index 0000000000..a7b1e70277 --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-top-level-empty-args-early-error.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-args-early-error.case +// - src/dynamic-import/syntax/top-level.template +/*--- +description: It's a SyntaxError if AssignmentExpression is omitted (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +negative: + phase: parse + type: SyntaxError +info: | + ImportCall : + import( AssignmentExpression ) + + + ImportCall : + import() + +---*/ +throw "Test262: This statement should not be evaluated."; + +import(); + +/* The params region intentionally empty */ diff --git a/test/language/module-code/dynamic-import/syntax-top-level-empty-str-arg.js b/test/language/module-code/dynamic-import/syntax-top-level-empty-str-arg.js new file mode 100644 index 0000000000..b0e798aeef --- /dev/null +++ b/test/language/module-code/dynamic-import/syntax-top-level-empty-str-arg.js @@ -0,0 +1,15 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/empty-str-arg.case +// - src/dynamic-import/syntax/top-level.template +/*--- +description: Calling import('') (top level syntax) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, module] +info: | + ImportCall : + import( AssignmentExpression ) + +---*/ + +import(''); diff --git a/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbdng-indirect-update-as.js b/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbdng-indirect-update-as.js new file mode 100644 index 0000000000..5cd4e27f8a --- /dev/null +++ b/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbdng-indirect-update-as.js @@ -0,0 +1,49 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-as.case +// - src/dynamic-import/default/top-level.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +import('./eval-gtbndng-indirect-update-as_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an imported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + +}).then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbdng-indirect-update-dflt.js b/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbdng-indirect-update-dflt.js new file mode 100644 index 0000000000..7bbc280022 --- /dev/null +++ b/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbdng-indirect-update-dflt.js @@ -0,0 +1,42 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbdng-indirect-update-dflt.case +// - src/dynamic-import/default/top-level.template +/*--- +description: Modifications to default binding that occur after dependency has been evaluated are reflected in local binding (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +import('./eval-gtbndng-indirect-update-dflt_FIXTURE.js').then(imported => { + + assert.sameValue(imported.default(), 1); + assert.sameValue(imported.default, 2); + +}).then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbndng-indirect-update.js b/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbndng-indirect-update.js new file mode 100644 index 0000000000..7835b16df8 --- /dev/null +++ b/test/language/module-code/dynamic-import/top-level-import-then-eval-gtbndng-indirect-update.js @@ -0,0 +1,50 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/eval-gtbndng-indirect-update.case +// - src/dynamic-import/default/top-level.template +/*--- +description: Modifications to named bindings that occur after dependency has been evaluated are reflected in local binding (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +includes: [fnGlobalObject.js] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + + + GetBindingValue (N, S) + + [...] + 3. If the binding for N is an indirect binding, then + a. Let M and N2 be the indirection values provided when this binding for + N was created. + b. Let targetEnv be M.[[Environment]]. + c. If targetEnv is undefined, throw a ReferenceError exception. + d. Let targetER be targetEnv's EnvironmentRecord. + e. Return ? targetER.GetBindingValue(N2, S). + +---*/ + +import('./eval-gtbndng-indirect-update_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + + // This function is exposed on the global scope (instead of as an exported + // binding) in order to avoid possible false positives from assuming correct + // behavior of the semantics under test. + fnGlobalObject().test262update(); + + assert.sameValue(imported.x, 2); + + +}).then($DONE, $DONE).catch($DONE); diff --git a/test/language/module-code/dynamic-import/top-level-import-then-returns-promise.js b/test/language/module-code/dynamic-import/top-level-import-then-returns-promise.js new file mode 100644 index 0000000000..e97e89baec --- /dev/null +++ b/test/language/module-code/dynamic-import/top-level-import-then-returns-promise.js @@ -0,0 +1,29 @@ +// This file was procedurally generated from the following sources: +// - src/dynamic-import/returns-promise.case +// - src/dynamic-import/default/top-level.template +/*--- +description: Dynamic import() returns a Promise object. (top level) +esid: sec-import-call-runtime-semantics-evaluation +features: [dynamic-import] +flags: [generated, async, module] +info: | + ImportCall : + import( AssignmentExpression ) + + 1. Let referencingScriptOrModule be ! GetActiveScriptOrModule(). + 2. Assert: referencingScriptOrModule is a Script Record or Module Record (i.e. is not null). + 3. Let argRef be the result of evaluating AssignmentExpression. + 4. Let specifier be ? GetValue(argRef). + 5. Let promiseCapability be ! NewPromiseCapability(%Promise%). + 6. Let specifierString be ToString(specifier). + 7. IfAbruptRejectPromise(specifierString, promiseCapability). + 8. Perform ! HostImportModuleDynamically(referencingScriptOrModule, specifierString, promiseCapability). + 9. Return promiseCapability.[[Promise]]. + +---*/ + +import('./dynamic-import-module_FIXTURE.js').then(imported => { + + assert.sameValue(imported.x, 1); + +}).then($DONE, $DONE).catch($DONE);