Update import defer tests for evaluation triggers (#4341)

This commit is contained in:
Nicolò Ribaudo 2025-01-24 10:54:39 +01:00 committed by GitHub
parent 82ebbb4060
commit e7a84b0a09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
71 changed files with 1985 additions and 181 deletions

View File

@ -0,0 +1,20 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-defineownproperty-p-desc
desc: _ [[DefineOwnProperty]]
info: |
[[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. ...
template: trigger-on-possible-export
---*/
//- body
try {
Object.defineProperty(ns, key, { value: "hi" });
} catch (_) {}

View File

@ -0,0 +1,19 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-delete-p
desc: _ [[Delete]]
info: |
[[Delete]] ( _P_ )
1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryDelete(_O_, _P_).
1. Let _exports_ be ? GetModuleExportsList(_O_).
1. ...
template: trigger-on-possible-export
---*/
//- body
try {
delete ns[key];
} catch (_) {}

17
src/import-defer/get.case Normal file
View File

@ -0,0 +1,17 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-get-p-receiver
desc: _ [[Get]]
info: |
[[Get]] ( _P_, _Receiver_ )
1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_).
1. Let _exports_ be ? GetModuleExportsList(_O_).
1. ...
template: trigger-on-possible-export
---*/
//- body
ns[key];

View File

@ -0,0 +1,17 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-getownproperty-p
desc: _ [[GetOwnProperty]]
info: |
[[GetOwnProperty]] ( _P_ )
1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGetOwnProperty(_O_, _P_).
1. Let _exports_ be ? GetModuleExportsList(_O_).
1. ...
template: trigger-on-possible-export
---*/
//- body
Object.getOwnPropertyDescriptor(ns, key);

View File

@ -0,0 +1,15 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-getprototypeof
desc: _ [[GetPrototypeOf]]
info: |
[[GetPrototypeOf]] ( )
1. Return **null**.
template: ignore
---*/
//- body
Object.getPrototypeOf(ns);

View File

@ -0,0 +1,17 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-hasproperty-p
desc: _ [[HasProperty]]
info: |
[[HasProperty]] ( _P_, _Receiver_ )
1. If IsSymbolLikeNamespaceKey(_P_, _O_), return ! OrdinaryGet(_O_, _P_, _Receiver_).
1. Let _exports_ be ? GetModuleExportsList(_O_).
1. ...
template: trigger-on-possible-export
---*/
//- body
key in ns;

View File

@ -0,0 +1,21 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/import/import-defer/evaluation-triggers/ignore-
name: does not trigger execution
esid: sec-module-namespace-exotic-objects
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns from "./dep_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
/*{ body }*/
assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation");

View File

@ -0,0 +1,15 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-isextensible
desc: _ [[IsExtensible]]
info: |
[[IsExtensible]] ( )
1. Return **false**.
template: ignore
---*/
//- body
Object.isExtensible(ns);

View File

@ -0,0 +1,16 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-ownpropertykeys
desc: _ [[OwnPropertyKeys]]
info: |
[[OwnPropertyKeys]] ( )
1. Let _exports_ be ? GetModuleExportsList(_O_).
1. ...
template: trigger
---*/
//- body
Object.getOwnPropertyNames(ns);

View File

@ -0,0 +1,16 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-ownpropertykeys
desc: _ [[OwnPropertyKeys]]
info: |
[[OwnPropertyKeys]] ( )
1. Let _exports_ be ? GetModuleExportsList(_O_).
1. ...
template: trigger
---*/
//- body
Object.getOwnPropertySymbols(ns);

View File

@ -0,0 +1,16 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-ownpropertykeys
desc: _ [[OwnPropertyKeys]]
info: |
[[OwnPropertyKeys]] ( )
1. Let _exports_ be ? GetModuleExportsList(_O_).
1. ...
template: trigger
---*/
//- body
Reflect.ownKeys(ns);

View File

@ -0,0 +1,15 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-preventextensions
desc: _ [[IsExtensible]]
info: |
[[IsExtensible]] ( )
1. Return **false**.
template: ignore
---*/
//- body
Object.preventExtensions(ns);

View File

@ -0,0 +1,17 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-set-p-v-receiver
desc: _ [[Set]] of a string which is an export name
info: |
[[Set]] ( _P_, _V_, _Receiver_ )
1. Return **false**.
template: ignore
---*/
//- body
try {
ns.exported = "hi";
} catch (_) {}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-set-p-v-receiver
desc: _ [[Set]] of a string which is not an export name
info: |
[[Set]] ( _P_, _V_, _Receiver_ )
1. Return **false**.
template: ignore
---*/
//- body
try {
ns.notExported = "hi";
} catch (_) {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-setprototypeof
desc: _ [[PreventExtensions]]
info: |
[[PreventExtensions]] ( )
1. Return **true**.
template: ignore
---*/
//- body
Reflect.setPrototypeOf(ns, null);
Reflect.setPrototypeOf(ns, {});

View File

@ -0,0 +1,35 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/import/import-defer/evaluation-triggers/trigger-exported-string-
name: of a string that is an exported name, triggers execution
esid: sec-module-namespace-exotic-objects
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]].
flags: [module]
features: [import-defer]
---*/
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";
/*{ body }*/
assert(globalThis.evaluations.length > 0, "It triggers evaluation");

View File

@ -0,0 +1,35 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/import/import-defer/evaluation-triggers/trigger-not-exported-string-
name: of a string that is not an exported name, triggers execution
esid: sec-module-namespace-exotic-objects
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]].
flags: [module]
features: [import-defer]
---*/
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";
/*{ body }*/
assert(globalThis.evaluations.length > 0, "It triggers evaluation");

View File

@ -0,0 +1,35 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/import/import-defer/evaluation-triggers/ignore-symbol-other-
name: of a symbol that is not a property of the namespace object, does not trigger execution
esid: sec-module-namespace-exotic-objects
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]].
flags: [module]
features: [import-defer]
---*/
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();
/*{ body }*/
assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation");

View File

@ -0,0 +1,35 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/import/import-defer/evaluation-triggers/ignore-symbol-toStringTag-
name: of Symbol.toStringTag, does not trigger execution
esid: sec-module-namespace-exotic-objects
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]].
flags: [module]
features: [import-defer]
---*/
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;
/*{ body }*/
assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation");

View File

@ -0,0 +1,35 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/import/import-defer/evaluation-triggers/ignore-exported-then-
name: of 'then' when it is an exported name, does not trigger execution
esid: sec-module-namespace-exotic-objects
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]].
flags: [module]
features: [import-defer]
---*/
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";
/*{ body }*/
assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation");

View File

@ -0,0 +1,35 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/import/import-defer/evaluation-triggers/ignore-not-exported-then-
name: of 'then' when it is not an exported name, does not trigger execution
esid: sec-module-namespace-exotic-objects
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]].
flags: [module]
features: [import-defer]
---*/
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";
/*{ body }*/
assert.sameValue(globalThis.evaluations.length, 0, "It does not trigger evaluation");

View File

@ -0,0 +1,21 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/import/import-defer/evaluation-triggers/trigger-
name: triggers execution
esid: sec-module-namespace-exotic-objects
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns from "./dep_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
/*{ body }*/
assert(globalThis.evaluations.length > 0, "It triggers evaluation");

View File

@ -1,28 +0,0 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-get-p-receiver
description: >
[[Get]] of a symbol does not trigger evaluation of the module
info: |
[[Get]] ( _P_, _Receiver_ )
1. If _P_ is a Symbol, then
1. Return ! OrdinaryGet(_O_, _P_, _Receiver_).
1. If _O_.[[Deferred]] is **true**, perform ? EnsureDeferredNamespaceEvaluation(_O_).
1. ...
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns1 from "./dep-1_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
ns1[Symbol.toStringTag];
ns1[Symbol()];
assert.sameValue(globalThis.evaluations.length, 0, "[[Get]] of a symbol does not trigger evaluation");

View File

@ -1,24 +0,0 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-getprototypeof
description: >
[[GetPrototypeOf]] does not trigger evaluation of the module
info: |
[[GetPrototypeOf]] ( )
1. Return **null**.
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns1 from "./dep-1_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
Object.getPrototypeOf(ns1);
assert.sameValue(globalThis.evaluations.length, 0, "[[GetPrototypeOf]] does not trigger evaluation");

View File

@ -1,24 +0,0 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-isextensible
description: >
[[IsExtensible]] does not trigger evaluation of the module
info: |
[[IsExtensible]] ( )
1. Return **false**.
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns1 from "./dep-1_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
Object.isExtensible(ns1);
assert.sameValue(globalThis.evaluations.length, 0, "[[IsExtensible]] does not trigger evaluation");

View File

@ -1,24 +0,0 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-preventextensions
description: >
[[PreventExtensions]] does not trigger evaluation of the module
info: |
[[PreventExtensions]] ( )
1. Return **true**.
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns1 from "./dep-1_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
Object.preventExtensions(ns1);
assert.sameValue(globalThis.evaluations.length, 0, "[[PreventExtensions]] does not trigger evaluation");

View File

@ -1,29 +0,0 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-set-p-v-receiver
description: >
[[Set]] does not trigger evaluation of the module
info: |
[[Set]] ( _P_, _V_, _Receiver_ )
1. Return **false**.
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns1 from "./dep-1_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
try {
ns1.foo = 2;
} catch {}
try {
ns1.ns_1_2 = 3;
} catch {}
assert.sameValue(globalThis.evaluations.length, 0, "[[Set]] of a symbol does not trigger evaluation");

View File

@ -1,25 +0,0 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-setprototypeof-v
description: >
[[SetPrototypeOf]] does not trigger evaluation of the module
info: |
[[SetPrototypeOf]] ( _V_ )
1. Return ! SetImmutablePrototype(_O_, _V_).
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns1 from "./dep-1_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
Reflect.setPrototypeOf(ns1, null);
Reflect.setPrototypeOf(ns1, {});
assert.sameValue(globalThis.evaluations.length, 0, "[[SetPrototypeOf]] does not trigger evaluation");

View File

@ -1,27 +0,0 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-module-namespace-exotic-objects-get-p-receiver
description: >
[[Get]] of a string triggers evaluation of the module
info: |
[[Get]] ( _P_, _Receiver_ )
1. If _P_ is a Symbol, then
1. Return ! OrdinaryGet(_O_, _P_, _Receiver_).
1. If _O_.[[Deferred]] is **true**, perform ? EnsureDeferredNamespaceEvaluation(_O_).
1. ...
flags: [module]
features: [import-defer]
---*/
import "./setup_FIXTURE.js";
import defer * as ns1 from "./dep-1_FIXTURE.js";
assert.sameValue(globalThis.evaluations.length, 0, "import defer does not trigger evaluation");
ns1.foo;
assert(globalThis.evaluations.length > 0, "[[Get]] of a string triggers evaluation");

View File

@ -0,0 +1,6 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
globalThis.evaluations.push("then");
export function then(cb) { cb(); }

View File

@ -0,0 +1,6 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
globalThis.evaluations.push("dep");
export let exported = 3;

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/defineOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/delete.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/get.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/getOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/hasProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,24 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/getPrototypeOf.case
// - src/import-defer/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");

View File

@ -0,0 +1,24 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/isExtensible.case
// - src/import-defer/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");

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/defineOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/delete.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/get.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/getOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/hasProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,24 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/preventExtensions.case
// - src/import-defer/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");

View File

@ -0,0 +1,26 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/set-string-exported.case
// - src/import-defer/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");

View File

@ -0,0 +1,26 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/set-string-not-exported.case
// - src/import-defer/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");

View File

@ -0,0 +1,25 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/setPrototypeOf.case
// - src/import-defer/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");

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/defineOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/delete.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/get.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/getOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/hasProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/defineOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/delete.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/get.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/getOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/hasProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,4 @@
// Copyright (C) 2024 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
globalThis.evaluations = [];

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/defineOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/delete.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/get.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/getOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/hasProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,44 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/defineOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,43 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/delete.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/get.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/getOwnProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,41 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/hasProperty.case
// - src/import-defer/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");

View File

@ -0,0 +1,25 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/ownPropertyKey-names.case
// - src/import-defer/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");

View File

@ -0,0 +1,25 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/ownPropertyKeys-symbols.case
// - src/import-defer/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");

View File

@ -0,0 +1,25 @@
// This file was procedurally generated from the following sources:
// - src/import-defer/ownPropertyKeys.case
// - src/import-defer/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");