From 83d5f09335b47f81d7a3bc20bdfabf0f65132d3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Thu, 12 Dec 2024 16:32:56 +0100 Subject: [PATCH] Generate tests --- .../ignore-exported-then-defineOwnProperty.js | 44 +++++++++++++++++++ .../ignore-exported-then-delete.js | 43 ++++++++++++++++++ .../ignore-exported-then-get.js | 41 +++++++++++++++++ .../ignore-exported-then-getOwnProperty.js | 41 +++++++++++++++++ .../ignore-exported-then-hasProperty.js | 41 +++++++++++++++++ .../ignore-getPrototypeOf.js | 24 ++++++++++ .../ignore-isExtensible.js | 24 ++++++++++ ...ore-not-exported-then-defineOwnProperty.js | 44 +++++++++++++++++++ .../ignore-not-exported-then-delete.js | 43 ++++++++++++++++++ .../ignore-not-exported-then-get.js | 41 +++++++++++++++++ ...ignore-not-exported-then-getOwnProperty.js | 41 +++++++++++++++++ .../ignore-not-exported-then-hasProperty.js | 41 +++++++++++++++++ .../ignore-preventExtensions.js | 24 ++++++++++ .../ignore-set-string-exported.js | 26 +++++++++++ .../ignore-set-string-not-exported.js | 26 +++++++++++ .../ignore-setPrototypeOf.js | 25 +++++++++++ .../ignore-symbol-other-defineOwnProperty.js | 44 +++++++++++++++++++ .../ignore-symbol-other-delete.js | 43 ++++++++++++++++++ .../ignore-symbol-other-get.js | 41 +++++++++++++++++ .../ignore-symbol-other-getOwnProperty.js | 41 +++++++++++++++++ .../ignore-symbol-other-hasProperty.js | 41 +++++++++++++++++ ...re-symbol-toStringTag-defineOwnProperty.js | 44 +++++++++++++++++++ .../ignore-symbol-toStringTag-delete.js | 43 ++++++++++++++++++ .../ignore-symbol-toStringTag-get.js | 41 +++++++++++++++++ ...gnore-symbol-toStringTag-getOwnProperty.js | 41 +++++++++++++++++ .../ignore-symbol-toStringTag-hasProperty.js | 41 +++++++++++++++++ ...igger-exported-string-defineOwnProperty.js | 44 +++++++++++++++++++ .../trigger-exported-string-delete.js | 43 ++++++++++++++++++ .../trigger-exported-string-get.js | 41 +++++++++++++++++ .../trigger-exported-string-getOwnProperty.js | 41 +++++++++++++++++ .../trigger-exported-string-hasProperty.js | 41 +++++++++++++++++ ...r-not-exported-string-defineOwnProperty.js | 44 +++++++++++++++++++ .../trigger-not-exported-string-delete.js | 43 ++++++++++++++++++ .../trigger-not-exported-string-get.js | 41 +++++++++++++++++ ...gger-not-exported-string-getOwnProperty.js | 41 +++++++++++++++++ ...trigger-not-exported-string-hasProperty.js | 41 +++++++++++++++++ .../trigger-ownPropertyKey-names.js | 25 +++++++++++ .../trigger-ownPropertyKeys-symbols.js | 25 +++++++++++ .../trigger-ownPropertyKeys.js | 25 +++++++++++ 39 files changed, 1484 insertions(+) create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-exported-then-defineOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-exported-then-delete.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-exported-then-get.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-exported-then-getOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-exported-then-hasProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-getPrototypeOf.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-isExtensible.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-defineOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-delete.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-get.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-getOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-hasProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-preventExtensions.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-set-string-exported.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-set-string-not-exported.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-setPrototypeOf.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-defineOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-delete.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-get.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-getOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-hasProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-defineOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-delete.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-get.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-getOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-hasProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-exported-string-defineOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-exported-string-delete.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-exported-string-get.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-exported-string-getOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-exported-string-hasProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-defineOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-delete.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-get.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-getOwnProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-hasProperty.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKey-names.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKeys-symbols.js create mode 100644 test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKeys.js diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-defineOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-defineOwnProperty.js new file mode 100644 index 0000000000..1180bc9e21 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-defineOwnProperty.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/defineOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-exported.template +/*--- +description: _ [[DefineOwnProperty]] (of 'then' when it is an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[DefineOwnProperty]] ( _P_, _Desc_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDefineOwnProperty(_O_, _Desc_). + 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). + 1. NOTE: If _O_.[[Deferred]] is *true*, the step above will ensure that the module is evaluated. + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep-then_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +try { + Object.defineProperty(ns, key, { value: "hi" }); +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-delete.js b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-delete.js new file mode 100644 index 0000000000..8829b3b13b --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-delete.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/delete.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-exported.template +/*--- +description: _ [[Delete]] (of 'then' when it is an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Delete]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDelete(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep-then_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +try { + delete ns[key]; +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-get.js b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-get.js new file mode 100644 index 0000000000..8faec40153 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-get.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/get.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-exported.template +/*--- +description: _ [[Get]] (of 'then' when it is an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Get]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep-then_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +ns[key]; + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-getOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-getOwnProperty.js new file mode 100644 index 0000000000..a876431833 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-getOwnProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/getOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-exported.template +/*--- +description: _ [[GetOwnProperty]] (of 'then' when it is an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[GetOwnProperty]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGetOwnProperty(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep-then_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +Object.getOwnPropertyDescriptor(ns, key); + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-hasProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-hasProperty.js new file mode 100644 index 0000000000..8a5bf70fb5 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-exported-then-hasProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/hasProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-exported.template +/*--- +description: _ [[HasProperty]] (of 'then' when it is an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[HasProperty]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep-then_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +key in ns; + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-getPrototypeOf.js b/test/language/import/import-defer/evaluation-triggers/ignore-getPrototypeOf.js new file mode 100644 index 0000000000..2dee455823 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-getPrototypeOf.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/getPrototypeOf.case +// - ./src/import-defer/evaluation-triggers/ignore/ignore.template +/*--- +description: _ [[GetPrototypeOf]] (does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[GetPrototypeOf]] ( ) + 1. Return **null**. + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +Object.getPrototypeOf(ns); + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-isExtensible.js b/test/language/import/import-defer/evaluation-triggers/ignore-isExtensible.js new file mode 100644 index 0000000000..2e196619a8 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-isExtensible.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/isExtensible.case +// - ./src/import-defer/evaluation-triggers/ignore/ignore.template +/*--- +description: _ [[IsExtensible]] (does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[IsExtensible]] ( ) + 1. Return **false**. + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +Object.isExtensible(ns); + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-defineOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-defineOwnProperty.js new file mode 100644 index 0000000000..620bb0de4d --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-defineOwnProperty.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/defineOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-not-exported.template +/*--- +description: _ [[DefineOwnProperty]] (of 'then' when it is not an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[DefineOwnProperty]] ( _P_, _Desc_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDefineOwnProperty(_O_, _Desc_). + 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). + 1. NOTE: If _O_.[[Deferred]] is *true*, the step above will ensure that the module is evaluated. + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +try { + Object.defineProperty(ns, key, { value: "hi" }); +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-delete.js b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-delete.js new file mode 100644 index 0000000000..1085e4bdbd --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-delete.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/delete.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-not-exported.template +/*--- +description: _ [[Delete]] (of 'then' when it is not an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Delete]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDelete(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +try { + delete ns[key]; +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-get.js b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-get.js new file mode 100644 index 0000000000..f7da3a107d --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-get.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/get.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-not-exported.template +/*--- +description: _ [[Get]] (of 'then' when it is not an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Get]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +ns[key]; + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-getOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-getOwnProperty.js new file mode 100644 index 0000000000..93a15f56d4 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-getOwnProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/getOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-not-exported.template +/*--- +description: _ [[GetOwnProperty]] (of 'then' when it is not an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[GetOwnProperty]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGetOwnProperty(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +Object.getOwnPropertyDescriptor(ns, key); + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-hasProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-hasProperty.js new file mode 100644 index 0000000000..54208d026f --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-hasProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/hasProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-not-exported.template +/*--- +description: _ [[HasProperty]] (of 'then' when it is not an exported name, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[HasProperty]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "then"; + +key in ns; + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-preventExtensions.js b/test/language/import/import-defer/evaluation-triggers/ignore-preventExtensions.js new file mode 100644 index 0000000000..6defd03890 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-preventExtensions.js @@ -0,0 +1,24 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/preventExtensions.case +// - ./src/import-defer/evaluation-triggers/ignore/ignore.template +/*--- +description: _ [[IsExtensible]] (does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[IsExtensible]] ( ) + 1. Return **false**. + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +Object.preventExtensions(ns); + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-set-string-exported.js b/test/language/import/import-defer/evaluation-triggers/ignore-set-string-exported.js new file mode 100644 index 0000000000..bd525cebc2 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-set-string-exported.js @@ -0,0 +1,26 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/set-string-exported.case +// - ./src/import-defer/evaluation-triggers/ignore/ignore.template +/*--- +description: _ [[Set]] of a string which is an export name (does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[Set]] ( _P_, _V_, _Receiver_ ) + 1. Return **false**. + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +try { + ns.exported = "hi"; +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-set-string-not-exported.js b/test/language/import/import-defer/evaluation-triggers/ignore-set-string-not-exported.js new file mode 100644 index 0000000000..0f22ab440a --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-set-string-not-exported.js @@ -0,0 +1,26 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/set-string-not-exported.case +// - ./src/import-defer/evaluation-triggers/ignore/ignore.template +/*--- +description: _ [[Set]] of a string which is not an export name (does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[Set]] ( _P_, _V_, _Receiver_ ) + 1. Return **false**. + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +try { + ns.notExported = "hi"; +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-setPrototypeOf.js b/test/language/import/import-defer/evaluation-triggers/ignore-setPrototypeOf.js new file mode 100644 index 0000000000..9f6d3af68d --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-setPrototypeOf.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/setPrototypeOf.case +// - ./src/import-defer/evaluation-triggers/ignore/ignore.template +/*--- +description: _ [[PreventExtensions]] (does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[PreventExtensions]] ( ) + 1. Return **true**. + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +Reflect.setPrototypeOf(ns, null); +Reflect.setPrototypeOf(ns, {}); + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-defineOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-defineOwnProperty.js new file mode 100644 index 0000000000..bef8562813 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-defineOwnProperty.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/defineOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-other.template +/*--- +description: _ [[DefineOwnProperty]] (of a symbol that is not a property of the namespace object, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[DefineOwnProperty]] ( _P_, _Desc_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDefineOwnProperty(_O_, _Desc_). + 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). + 1. NOTE: If _O_.[[Deferred]] is *true*, the step above will ensure that the module is evaluated. + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol(); + +try { + Object.defineProperty(ns, key, { value: "hi" }); +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-delete.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-delete.js new file mode 100644 index 0000000000..bf3a6321bd --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-delete.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/delete.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-other.template +/*--- +description: _ [[Delete]] (of a symbol that is not a property of the namespace object, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Delete]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDelete(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol(); + +try { + delete ns[key]; +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-get.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-get.js new file mode 100644 index 0000000000..4434741b6f --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-get.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/get.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-other.template +/*--- +description: _ [[Get]] (of a symbol that is not a property of the namespace object, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Get]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol(); + +ns[key]; + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-getOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-getOwnProperty.js new file mode 100644 index 0000000000..b2d4ba30c3 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-getOwnProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/getOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-other.template +/*--- +description: _ [[GetOwnProperty]] (of a symbol that is not a property of the namespace object, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[GetOwnProperty]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGetOwnProperty(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol(); + +Object.getOwnPropertyDescriptor(ns, key); + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-hasProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-hasProperty.js new file mode 100644 index 0000000000..91c0081502 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-other-hasProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/hasProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-other.template +/*--- +description: _ [[HasProperty]] (of a symbol that is not a property of the namespace object, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[HasProperty]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol(); + +key in ns; + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-defineOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-defineOwnProperty.js new file mode 100644 index 0000000000..c8de696c90 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-defineOwnProperty.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/defineOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-toStringTag.template +/*--- +description: _ [[DefineOwnProperty]] (of Symbol.toStringTag, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[DefineOwnProperty]] ( _P_, _Desc_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDefineOwnProperty(_O_, _Desc_). + 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). + 1. NOTE: If _O_.[[Deferred]] is *true*, the step above will ensure that the module is evaluated. + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol.toStringTag; + +try { + Object.defineProperty(ns, key, { value: "hi" }); +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-delete.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-delete.js new file mode 100644 index 0000000000..321a6fa091 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-delete.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/delete.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-toStringTag.template +/*--- +description: _ [[Delete]] (of Symbol.toStringTag, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Delete]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDelete(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol.toStringTag; + +try { + delete ns[key]; +} catch (_) {} + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-get.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-get.js new file mode 100644 index 0000000000..0b8c38e57b --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-get.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/get.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-toStringTag.template +/*--- +description: _ [[Get]] (of Symbol.toStringTag, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Get]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol.toStringTag; + +ns[key]; + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-getOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-getOwnProperty.js new file mode 100644 index 0000000000..110982cf3e --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-getOwnProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/getOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-toStringTag.template +/*--- +description: _ [[GetOwnProperty]] (of Symbol.toStringTag, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[GetOwnProperty]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGetOwnProperty(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol.toStringTag; + +Object.getOwnPropertyDescriptor(ns, key); + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-hasProperty.js b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-hasProperty.js new file mode 100644 index 0000000000..b8bc070053 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-hasProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/hasProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/symbol-toStringTag.template +/*--- +description: _ [[HasProperty]] (of Symbol.toStringTag, does not trigger execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[HasProperty]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = Symbol.toStringTag; + +key in ns; + +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); \ No newline at end of file diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-defineOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-defineOwnProperty.js new file mode 100644 index 0000000000..53b7af9cd8 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-defineOwnProperty.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/defineOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-exported.template +/*--- +description: _ [[DefineOwnProperty]] (of a string that is an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[DefineOwnProperty]] ( _P_, _Desc_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDefineOwnProperty(_O_, _Desc_). + 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). + 1. NOTE: If _O_.[[Deferred]] is *true*, the step above will ensure that the module is evaluated. + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "exported"; + +try { + Object.defineProperty(ns, key, { value: "hi" }); +} catch (_) {} + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-delete.js b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-delete.js new file mode 100644 index 0000000000..9b75739017 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-delete.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/delete.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-exported.template +/*--- +description: _ [[Delete]] (of a string that is an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Delete]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDelete(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "exported"; + +try { + delete ns[key]; +} catch (_) {} + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-get.js b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-get.js new file mode 100644 index 0000000000..2b45be6a73 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-get.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/get.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-exported.template +/*--- +description: _ [[Get]] (of a string that is an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Get]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "exported"; + +ns[key]; + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-getOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-getOwnProperty.js new file mode 100644 index 0000000000..3d1b055d1a --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-getOwnProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/getOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-exported.template +/*--- +description: _ [[GetOwnProperty]] (of a string that is an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[GetOwnProperty]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGetOwnProperty(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "exported"; + +Object.getOwnPropertyDescriptor(ns, key); + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-hasProperty.js b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-hasProperty.js new file mode 100644 index 0000000000..8adcc995c2 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-exported-string-hasProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/hasProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-exported.template +/*--- +description: _ [[HasProperty]] (of a string that is an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[HasProperty]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "exported"; + +key in ns; + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-defineOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-defineOwnProperty.js new file mode 100644 index 0000000000..f916d1ea3c --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-defineOwnProperty.js @@ -0,0 +1,44 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/defineOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-not-exported.template +/*--- +description: _ [[DefineOwnProperty]] (of a string that is not an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[DefineOwnProperty]] ( _P_, _Desc_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDefineOwnProperty(_O_, _Desc_). + 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). + 1. NOTE: If _O_.[[Deferred]] is *true*, the step above will ensure that the module is evaluated. + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "notExported"; + +try { + Object.defineProperty(ns, key, { value: "hi" }); +} catch (_) {} + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-delete.js b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-delete.js new file mode 100644 index 0000000000..8f33c4d72d --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-delete.js @@ -0,0 +1,43 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/delete.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-not-exported.template +/*--- +description: _ [[Delete]] (of a string that is not an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Delete]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDelete(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "notExported"; + +try { + delete ns[key]; +} catch (_) {} + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-get.js b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-get.js new file mode 100644 index 0000000000..7b29d74300 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-get.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/get.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-not-exported.template +/*--- +description: _ [[Get]] (of a string that is not an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[Get]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "notExported"; + +ns[key]; + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-getOwnProperty.js b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-getOwnProperty.js new file mode 100644 index 0000000000..892a0695bd --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-getOwnProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/getOwnProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-not-exported.template +/*--- +description: _ [[GetOwnProperty]] (of a string that is not an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[GetOwnProperty]] ( _P_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGetOwnProperty(_O_, _P_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "notExported"; + +Object.getOwnPropertyDescriptor(ns, key); + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-hasProperty.js b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-hasProperty.js new file mode 100644 index 0000000000..0b5af8c00f --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-not-exported-string-hasProperty.js @@ -0,0 +1,41 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/hasProperty.case +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/string-not-exported.template +/*--- +description: _ [[HasProperty]] (of a string that is not an exported name, triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) + 1. If _P_ is a Symbol, return *true*. + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. + 1. Return *false*. + + GetModuleExportsList ( _O_ ) + 1. If _O_.[[Deferred]] is *true*, then + 1. Let _m_ be _O_.[[Module]]. + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. + 1. Perform ? EvaluateSync(_m_). + 1. Return _O_.[[Exports]]. + + + [[HasProperty]] ( _P_, _Receiver_ ) + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_). + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +var key = "notExported"; + +key in ns; + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKey-names.js b/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKey-names.js new file mode 100644 index 0000000000..f232522f6e --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKey-names.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/ownPropertyKey-names.case +// - ./src/import-defer/evaluation-triggers/trigger/trigger.template +/*--- +description: _ [[OwnPropertyKeys]] (triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[OwnPropertyKeys]] ( ) + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +Object.getOwnPropertyNames(ns); + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKeys-symbols.js b/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKeys-symbols.js new file mode 100644 index 0000000000..8054f7c4b6 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKeys-symbols.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/ownPropertyKeys-symbols.case +// - ./src/import-defer/evaluation-triggers/trigger/trigger.template +/*--- +description: _ [[OwnPropertyKeys]] (triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[OwnPropertyKeys]] ( ) + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +Object.getOwnPropertySymbols(ns); + +assert(globalThis.evaluations.length > 0, "It triggers evaluation"); diff --git a/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKeys.js b/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKeys.js new file mode 100644 index 0000000000..cade15da44 --- /dev/null +++ b/test/language/import/import-defer/evaluation-triggers/trigger-ownPropertyKeys.js @@ -0,0 +1,25 @@ +// This file was procedurally generated from the following sources: +// - ./src/import-defer/evaluation-triggers/ownPropertyKeys.case +// - ./src/import-defer/evaluation-triggers/trigger/trigger.template +/*--- +description: _ [[OwnPropertyKeys]] (triggers execution) +esid: sec-module-namespace-exotic-objects +features: [import-defer] +flags: [generated, module] +info: | + [[OwnPropertyKeys]] ( ) + 1. Let _exports_ be ? GetModuleExportsList(_O_). + 1. ... + +---*/ + + +import "./setup_FIXTURE.js"; + +import defer * as ns from "./dep_FIXTURE.js"; + +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); + +Reflect.ownKeys(ns); + +assert(globalThis.evaluations.length > 0, "It triggers evaluation");