forked from tc39/test262
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
369a00a
commit 83d5f09
Showing
39 changed files
with
1,484 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
...anguage/import/import-defer/evaluation-triggers/ignore-exported-then-defineOwnProperty.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
43 changes: 43 additions & 0 deletions
43
test/language/import/import-defer/evaluation-triggers/ignore-exported-then-delete.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
41 changes: 41 additions & 0 deletions
41
test/language/import/import-defer/evaluation-triggers/ignore-exported-then-get.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
41 changes: 41 additions & 0 deletions
41
test/language/import/import-defer/evaluation-triggers/ignore-exported-then-getOwnProperty.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
41 changes: 41 additions & 0 deletions
41
test/language/import/import-defer/evaluation-triggers/ignore-exported-then-hasProperty.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
24 changes: 24 additions & 0 deletions
24
test/language/import/import-defer/evaluation-triggers/ignore-getPrototypeOf.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
24 changes: 24 additions & 0 deletions
24
test/language/import/import-defer/evaluation-triggers/ignore-isExtensible.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
44 changes: 44 additions & 0 deletions
44
...age/import/import-defer/evaluation-triggers/ignore-not-exported-then-defineOwnProperty.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
43 changes: 43 additions & 0 deletions
43
test/language/import/import-defer/evaluation-triggers/ignore-not-exported-then-delete.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); |
Oops, something went wrong.