Skip to content

Commit

Permalink
Generate tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Dec 12, 2024
1 parent 369a00a commit 83d5f09
Show file tree
Hide file tree
Showing 39 changed files with 1,484 additions and 0 deletions.
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");
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");
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");
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");
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");
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");
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");
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");
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");
Loading

0 comments on commit 83d5f09

Please sign in to comment.