|
| 1 | +// This file was procedurally generated from the following sources: |
| 2 | +// - src/import-defer/super-property-set-exported.case |
| 3 | +// - src/import-defer/trigger-on-possible-export/then-not-exported.template |
| 4 | +/*--- |
| 5 | +description: _ [[GetOwnProperty]] called on super access (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 | + SuperProperty : super [ Expression ] |
| 24 | + 1. Let _env_ be GetThisEnvironment(). |
| 25 | + 1. Let _actualThis_ be ? _env_.GetThisBinding(). |
| 26 | + 1. Let _propertyNameReference_ be ? Evaluation of |Expression|. |
| 27 | + 1. Let _propertyNameValue_ be ? GetValue(_propertyNameReference_). |
| 28 | + 1. Let _strict_ be IsStrict(this |SuperProperty|). |
| 29 | + 1. Return MakeSuperPropertyReference(_actualThis_, _propertyNameValue_, _strict_). |
| 30 | +
|
| 31 | + MakeSuperPropertyReference ( _actualThis_, _propertyKey_, _strict_ ) |
| 32 | + 1. Let _env_ be GetThisEnvironment(). |
| 33 | + 1. Assert: _env_.HasSuperBinding() is *true*. |
| 34 | + 1. Assert: _env_ is a Function Environment Record. |
| 35 | + 1. Let _baseValue_ be GetSuperBase(_env_). |
| 36 | + 1. Return the Reference Record { [[Base]]: _baseValue_, [[ReferencedName]]: _propertyKey_, [[Strict]]: _strict_, [[ThisValue]]: _actualThis_ }. |
| 37 | +
|
| 38 | + PutValue ( _V_, _W_ ) |
| 39 | + 1. If _V_ is not a Reference Record, throw a *ReferenceError* exception. |
| 40 | + ... |
| 41 | + 1. If IsPropertyReference(_V_) is *true*, then |
| 42 | + 1. Let _baseObj_ be ? ToObject(_V_.[[Base]]). |
| 43 | + ... |
| 44 | + 1. Let _succeeded_ be ? _baseObj_.[[Set]](_V_.[[ReferencedName]], _W_, GetThisValue(_V_)). |
| 45 | + 1. If _succeeded_ is *false* and _V_.[[Strict]] is *true*, throw a *TypeError* exception. |
| 46 | + 1. Return ~unused~. |
| 47 | + ... |
| 48 | +
|
| 49 | + OrdinarySetWithOwnDescriptor ( _O_, _P_, _V_, _Receiver_, _ownDesc_ ) |
| 50 | + 1. If _ownDesc_ is *undefined*, then |
| 51 | + 1. Let _parent_ be ? _O_.[[GetPrototypeOf]](). |
| 52 | + 1. If _parent_ is not *null*, return ? _parent_.[[Set]](_P_, _V_, _Receiver_). |
| 53 | + 1. Set _ownDesc_ to the PropertyDescriptor { [[Value]]: *undefined*, [[Writable]]: *true*, [[Enumerable]]: *true*, [[Configurable]]: *true* }. |
| 54 | + 1. If IsDataDescriptor(_ownDesc_) is *true*, then |
| 55 | + 1. If _ownDesc_.[[Writable]] is *false*, return *false*. |
| 56 | + 1. If _Receiver_ is not an Object, return *false*. |
| 57 | + 1. Let _existingDescriptor_ be ? _Receiver_.[[GetOwnProperty]](_P_). |
| 58 | + 1. If _existingDescriptor_ is *undefined*, then |
| 59 | + 1. Assert: _Receiver_ does not currently have a property _P_. |
| 60 | + 1. Return ? CreateDataProperty(_Receiver_, _P_, _V_). |
| 61 | + 1. If IsAccessorDescriptor(_existingDescriptor_) is *true*, return *false*. |
| 62 | + 1. If _existingDescriptor_.[[Writable]] is *false*, return *false*. |
| 63 | + 1. Let _valueDesc_ be the PropertyDescriptor { [[Value]]: _V_ }. |
| 64 | + 1. Return ? _Receiver_.[[DefineOwnProperty]](_P_, _valueDesc_). |
| 65 | + ... |
| 66 | +
|
| 67 | +---*/ |
| 68 | + |
| 69 | + |
| 70 | +import "./setup_FIXTURE.js"; |
| 71 | + |
| 72 | +import defer * as ns from "./dep_FIXTURE.js"; |
| 73 | + |
| 74 | +assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation"); |
| 75 | + |
| 76 | +var key = "then"; |
| 77 | + |
| 78 | +class A { constructor() { return ns; } }; |
| 79 | +class B extends A { |
| 80 | + constructor() { |
| 81 | + super(); |
| 82 | + super[key] = 14; |
| 83 | + } |
| 84 | +}; |
| 85 | + |
| 86 | +try { |
| 87 | + new B(); |
| 88 | +} catch (_) {} |
| 89 | + |
| 90 | +assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation"); |
0 commit comments