Skip to content

Commit ade98d2

Browse files
committed
fixing comments
1 parent 46f8f8d commit ade98d2

6 files changed

Lines changed: 42 additions & 47 deletions

test/language/expressions/dynamic-import/export-defer/import-defer-lazy-deferred-namespace-reexport.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-resolveexport
5+
esid: sec-ContinueDynamicImport
66
description: >
77
import.defer() observes lazy `export defer * as ns from` namespace re-export
88
info: |
9-
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ ) — change introduced by deferred-reexports:
9+
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ )
1010
1. ...
1111
1. Let _module_ be _moduleCompletion_.[[Value]].
1212
1. Let _loadPromise_ be _module_.LoadRequestedModules(~all~).
@@ -17,14 +17,9 @@ info: |
1717
1. ...
1818
1. ...
1919
20-
Passing ~all~ to LoadRequestedModules and Link makes them traverse
21-
[[OptionalIndirectExportEntries]] (the slot that records `export
22-
defer ... from` declarations). The deferred dep is loaded and linked
23-
at load time — only its body evaluation is deferred.
24-
2520
[[Get]] ( _P_, _Receiver_ )
2621
1. ...
27-
1. Let _m_ be _obj_.[[Module]].
22+
1. Let _m_ be _O_.[[Module]].
2823
1. If _m_ is a Cyclic Module Record and _m_.GetOptionalIndirectExportsModuleRequests(« _P_ »)
2924
is not empty, then
3025
1. Perform ? EvaluateModuleSync(_m_, « _P_ »).
@@ -46,9 +41,12 @@ info: |
4641
1. If _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~, then
4742
1. Assert: _module_.[[CycleRoot]].[[TopLevelCapability]] is not ~empty~.
4843
1. Let _topLevelPromise_ be _module_.[[CycleRoot]].[[TopLevelCapability]].[[Promise]].
49-
1. Else,
50-
1. ...
5144
1. ...
45+
46+
Passing ~all~ to LoadRequestedModules and Link makes them traverse
47+
[[OptionalIndirectExportEntries]] (the slot that records `export
48+
defer ... from` declarations). The deferred dep is loaded and linked
49+
at load time — only its body evaluation is deferred.
5250
flags: [module, async]
5351
features: [export-defer, import-defer]
5452
includes: [asyncHelpers.js, compareArray.js]

test/language/expressions/dynamic-import/export-defer/import-defer-lazy-deferred-reexport.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-import-call-runtime-semantics-evaluation
5+
esid: sec-ContinueDynamicImport
66
description: >
77
import.defer() of an `export defer` barrel defers both barrel and deferred dep
88
info: |
9-
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ ) — change introduced by deferred-reexports:
9+
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ )
1010
1. ...
1111
1. Let _module_ be _moduleCompletion_.[[Value]].
1212
1. Let _loadPromise_ be _module_.LoadRequestedModules(~all~).
@@ -17,14 +17,9 @@ info: |
1717
1. ...
1818
1. ...
1919
20-
Passing ~all~ to LoadRequestedModules and Link makes them traverse
21-
[[OptionalIndirectExportEntries]] (the slot that records `export
22-
defer ... from` declarations). The deferred dep is loaded and linked
23-
at load time — only its body evaluation is deferred.
24-
2520
[[Get]] ( _P_, _Receiver_ )
2621
1. ...
27-
1. Let _m_ be _obj_.[[Module]].
22+
1. Let _m_ be _O_.[[Module]].
2823
1. If _m_ is a Cyclic Module Record and _m_.GetOptionalIndirectExportsModuleRequests(« _P_ »)
2924
is not empty, then
3025
1. Perform ? EvaluateModuleSync(_m_, « _P_ »).
@@ -46,9 +41,12 @@ info: |
4641
1. If _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~, then
4742
1. Assert: _module_.[[CycleRoot]].[[TopLevelCapability]] is not ~empty~.
4843
1. Let _topLevelPromise_ be _module_.[[CycleRoot]].[[TopLevelCapability]].[[Promise]].
49-
1. Else,
50-
1. ...
5144
1. ...
45+
46+
Passing ~all~ to LoadRequestedModules and Link makes them traverse
47+
[[OptionalIndirectExportEntries]] (the slot that records `export
48+
defer ... from` declarations). The deferred dep is loaded and linked
49+
at load time — only its body evaluation is deferred.
5250
flags: [module, async]
5351
features: [export-defer, import-defer]
5452
includes: [asyncHelpers.js, compareArray.js]

test/language/expressions/dynamic-import/export-defer/import-defer-syntax-error-in-deferred-dep-rejects.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-import-call-runtime-semantics-evaluation
5+
esid: sec-ContinueDynamicImport
66
description: >
77
import.defer() rejects with SyntaxError when the deferred-reexport dep has a parse error
88
info: |
99
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ ) — change introduced by deferred-reexports:
1010
1. ...
1111
1. Let _module_ be _moduleCompletion_.[[Value]].
1212
1. Let _loadPromise_ be _module_.LoadRequestedModules(~all~).
13-
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that performs:
13+
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _promiseCapability_ and performs the following steps when called:
1414
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _reason_ »).
1515
1. ...
1616
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, "", « »).
17-
1. Let _linkAndEvaluateClosure_ be a new Abstract Closure that performs:
17+
1. Let _linkAndEvaluateClosure_ be a new Abstract Closure with no parameters that captures _module_, _promiseCapability_, _phase_ and _onRejected_ and performs the following steps when called:
1818
1. Let _link_ be Completion(_module_.Link(~all~)).
19+
1. If _link_ is an abrupt completion, then
20+
1. Perform ! Call(_promiseCapability_.[[Reject]], undefined, « _link_.[[Value]] »).
1921
1. ...
2022
1. ...
2123
1. Perform PerformPromiseThen(_loadPromise_, _linkAndEvaluate_, _onRejected_).

test/language/expressions/dynamic-import/export-defer/lazy-deferred-namespace-reexport.js

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-resolveexport
5+
esid: sec-ContinueDynamicImport
66
description: >
77
import() observes lazy `export defer * as ns from` namespace re-export
88
info: |
9-
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ ) — change introduced by deferred-reexports:
9+
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ )
1010
1. ...
1111
1. Let _module_ be _moduleCompletion_.[[Value]].
1212
1. Let _loadPromise_ be _module_.LoadRequestedModules(~all~).
@@ -17,14 +17,9 @@ info: |
1717
1. ...
1818
1. ...
1919
20-
Passing ~all~ to LoadRequestedModules and Link makes them traverse
21-
[[OptionalIndirectExportEntries]] (the slot that records `export
22-
defer ... from` declarations). The deferred dep is loaded and linked
23-
at load time — only its body evaluation is deferred.
24-
2520
[[Get]] ( _P_, _Receiver_ )
2621
1. ...
27-
1. Let _m_ be _obj_.[[Module]].
22+
1. Let _m_ be _O_.[[Module]].
2823
1. If _m_ is a Cyclic Module Record and _m_.GetOptionalIndirectExportsModuleRequests(« _P_ »)
2924
is not empty, then
3025
1. Perform ? EvaluateModuleSync(_m_, « _P_ »).
@@ -46,9 +41,12 @@ info: |
4641
1. If _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~, then
4742
1. Assert: _module_.[[CycleRoot]].[[TopLevelCapability]] is not ~empty~.
4843
1. Let _topLevelPromise_ be _module_.[[CycleRoot]].[[TopLevelCapability]].[[Promise]].
49-
1. Else,
50-
1. ...
5144
1. ...
45+
46+
Passing ~all~ to LoadRequestedModules and Link makes them traverse
47+
[[OptionalIndirectExportEntries]] (the slot that records `export
48+
defer ... from` declarations). The deferred dep is loaded and linked
49+
at load time — only its body evaluation is deferred.
5250
flags: [module, async]
5351
features: [export-defer, dynamic-import]
5452
includes: [asyncHelpers.js, compareArray.js]

test/language/expressions/dynamic-import/export-defer/lazy-deferred-reexport.js

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-import-call-runtime-semantics-evaluation
5+
esid: sec-ContinueDynamicImport
66
description: >
77
import() of an `export defer` barrel does not evaluate the deferred dep until access
88
info: |
9-
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ ) — change introduced by deferred-reexports:
9+
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ )
1010
1. ...
1111
1. Let _module_ be _moduleCompletion_.[[Value]].
1212
1. Let _loadPromise_ be _module_.LoadRequestedModules(~all~).
@@ -17,14 +17,9 @@ info: |
1717
1. ...
1818
1. ...
1919
20-
Passing ~all~ to LoadRequestedModules and Link makes them traverse
21-
[[OptionalIndirectExportEntries]] (the slot that records `export
22-
defer ... from` declarations). The deferred dep is loaded and linked
23-
at load time — only its body evaluation is deferred.
24-
2520
[[Get]] ( _P_, _Receiver_ )
2621
1. ...
27-
1. Let _m_ be _obj_.[[Module]].
22+
1. Let _m_ be _O_.[[Module]].
2823
1. If _m_ is a Cyclic Module Record and _m_.GetOptionalIndirectExportsModuleRequests(« _P_ »)
2924
is not empty, then
3025
1. Perform ? EvaluateModuleSync(_m_, « _P_ »).
@@ -46,10 +41,12 @@ info: |
4641
1. If _module_.[[Status]] is either ~evaluating-async~ or ~evaluated~, then
4742
1. Assert: _module_.[[CycleRoot]].[[TopLevelCapability]] is not ~empty~.
4843
1. Let _topLevelPromise_ be _module_.[[CycleRoot]].[[TopLevelCapability]].[[Promise]].
49-
1. Else,
50-
1. ...
5144
1. ...
52-
flags: [module, async]
45+
46+
Passing ~all~ to LoadRequestedModules and Link makes them traverse
47+
[[OptionalIndirectExportEntries]] (the slot that records `export
48+
defer ... from` declarations). The deferred dep is loaded and linked
49+
at load time — only its body evaluation is deferred.flags: [module, async]
5350
features: [export-defer, dynamic-import]
5451
includes: [asyncHelpers.js, compareArray.js]
5552
---*/

test/language/expressions/dynamic-import/export-defer/syntax-error-in-deferred-dep-rejects.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@
22
// This code is governed by the BSD license found in the LICENSE file.
33

44
/*---
5-
esid: sec-import-call-runtime-semantics-evaluation
5+
esid: sec-ContinueDynamicImport
66
description: >
77
import() rejects with SyntaxError when the deferred-reexport dep has a parse error
88
info: |
99
ContinueDynamicImport ( _promiseCapability_, _moduleCompletion_, _phase_ ) — change introduced by deferred-reexports:
1010
1. ...
1111
1. Let _module_ be _moduleCompletion_.[[Value]].
1212
1. Let _loadPromise_ be _module_.LoadRequestedModules(~all~).
13-
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that performs:
13+
1. Let _rejectedClosure_ be a new Abstract Closure with parameters (_reason_) that captures _promiseCapability_ and performs the following steps when called:
1414
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _reason_ »).
1515
1. ...
1616
1. Let _onRejected_ be CreateBuiltinFunction(_rejectedClosure_, 1, "", « »).
17-
1. Let _linkAndEvaluateClosure_ be a new Abstract Closure that performs:
17+
1. Let _linkAndEvaluateClosure_ be a new Abstract Closure with no parameters that captures _module_, _promiseCapability_, _phase_ and _onRejected_ and performs the following steps when called:
1818
1. Let _link_ be Completion(_module_.Link(~all~)).
19+
1. If _link_ is an abrupt completion, then
20+
1. Perform ! Call(_promiseCapability_.[[Reject]], undefined, « _link_.[[Value]] »).
1921
1. ...
2022
1. ...
2123
1. Perform PerformPromiseThen(_loadPromise_, _linkAndEvaluate_, _onRejected_).

0 commit comments

Comments
 (0)