Debian Codegraph @

js/src/tests/test262/language/import/import-defer/evaluation-triggers/trigger-exported-string-delete.js

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