|
| 1 | +// This file was procedurally generated from the following sources: |
| 2 | +// - ./src/import-defer/evaluation-triggers/defineOwnProperty.case |
| 3 | +// - ./src/import-defer/evaluation-triggers/trigger-on-possible-export/then-not-exported.template |
| 4 | +/*--- |
| 5 | +description: _ [[DefineOwnProperty]] (of 'then' when it is not an exported name, does not trigger execution) |
| 6 | +esid: sec-module-namespace-exotic-objects |
| 7 | +features: [import-defer] |
| 8 | +flags: [generated, module] |
| 9 | +info: | |
| 10 | + IsSymbolLikeNamespaceKey ( _P_, _O_ ) |
| 11 | + 1. If _P_ is a Symbol, return *true*. |
| 12 | + 1. If _ns_.[[Deferred]] is *true* and _P_ is "then", return *true*. |
| 13 | + 1. Return *false*. |
| 14 | +
|
| 15 | + GetModuleExportsList ( _O_ ) |
| 16 | + 1. If _O_.[[Deferred]] is *true*, then |
| 17 | + 1. Let _m_ be _O_.[[Module]]. |
| 18 | + 1. If _m_ is a Cyclic Module Record, _m_.[[Status]] is not ~evaluated~, and ReadyForSyncExecution(_m_) is *false*, throw a *TypeError* exception. |
| 19 | + 1. Perform ? EvaluateSync(_m_). |
| 20 | + 1. Return _O_.[[Exports]]. |
| 21 | +
|
| 22 | +
|
| 23 | + [[DefineOwnProperty]] ( _P_, _Desc_ ) |
| 24 | + 1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDefineOwnProperty(_O_, _Desc_). |
| 25 | + 1. Let _current_ be ? _O_.[[GetOwnProperty]](_P_). |
| 26 | + 1. NOTE: If _O_.[[Deferred]] is *true*, the step above will ensure that the module is evaluated. |
| 27 | + 1. ... |
| 28 | +
|
| 29 | +---*/ |
| 30 | + |
| 31 | + |
| 32 | +import "./setup_FIXTURE.js"; |
| 33 | + |
| 34 | +import defer * as ns from "./dep_FIXTURE.js"; |
| 35 | + |
| 36 | +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); |
| 37 | + |
| 38 | +var key = "then"; |
| 39 | + |
| 40 | +try { |
| 41 | + Object.defineProperty(ns, key, { value: "hi" }); |
| 42 | +} catch (_) {} |
| 43 | + |
| 44 | +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); |
0 commit comments