The abstract operation FinishDynamicImport takes arguments _referencingScriptOrModule_, _specifier_, _promiseCapability_ (a PromiseCapability Record), and _completion_. FinishDynamicImport completes the process of a dynamic import originally started by an `import()` call, resolving or rejecting the promise returned by that call as appropriate according to _completion_. It is performed by host environments as part of HostImportModuleDynamically. It performs the following steps when called:
-
- 1. Let _stepsFulfilled_ be the steps of a CallDynamicImportFulfilled function as specified below.
- 1. Let _onFulfilled_ be CreateBuiltinFunction(_stepsFulfilled_, 0, *""*, « »).
+ FinishDynamicImport ( _referencingScriptOrModule_, _specifier_, _promiseCapability_, _innerPromise_ )
+ The abstract operation FinishDynamicImport takes arguments _referencingScriptOrModule_, _specifier_, _promiseCapability_ (a PromiseCapability Record), and _innerPromise_. FinishDynamicImport completes the process of a dynamic import originally started by an `import()` call, resolving or rejecting the promise returned by that call as appropriate according to _innerPromise_'s resolution. It is performed by host environments as part of HostImportModuleDynamically. It performs the following steps when called:
+
+ 1. Let _stepsFulfilled_ be the steps of a CallDynamicImportResolved function as specified below.
+ 1. Let _onFulfilled_ be CreateBuiltinFunction(_stepsFulfilled_, 0, *""*, « [[ReferencingScriptOrMoule]], [[Specifier]], [[PromiseCapability]] »).
+ 1. Set _onFulfilled_.[[ReferencingScriptOrModule]] to _referencingScriptOrModule_.
+ 1. Set _onFulfilled_.[[Specifier]] to _specifier_.
+ 1. Set _onFulfilled_.[[PromiseCapability]] to _promiseCapability_.
1. Let _stepsRejected_ be the steps of a CallDynamicImportRejected function as specified below.
- 1. Let _onRejected_ be CreateBuiltinFunction(_stepsRejected_, 0, *""*, « »).
- 1. Let _innerPromise_ be *undefined*.
+ 1. Let _onRejected_ be CreateBuiltinFunction(_stepsRejected_, 0, *""*, « [[PromiseCapability]] »).
+ 1. Set _onRejected_.[[PromiseCapability]] to _promiseCapability_.
1. Perform ! PerformPromiseThen(_innerPromise_.[[Promise]], _onFulfilled_, _onRejected_).
- A CallDynamicImportFulfilled function is an anonymous built-in function with no internal slots and has one argument _result_. When a CallDynamicImportFulfilled function is called it performs the following steps:
+ A CallDynamicImportResolved function is an anonymous built-in function with the internal
+ slots [[ReferencingScriptOrModule]], [[Specifier]], and [[PromiseCapability]], and it takes
+ one argument, _result_. When a CallDynamicImportResolved function is called it performs the following steps:
1. Assert: _result_ is *undefined*.
- 1. Let _referencingScriptOrModule_ be *undefined*.
- 1. Let _specifier_ be *undefined*.
- 1. Let _promiseCapability_ be *undefined*.
+ 1. Let _F_ be the active function object.
+ 1. Let _referencingScriptOrModule_ be _F_.[[ReferencingScriptOrModule]].
+ 1. Let _specifier_ be _F_.[[Specifier]].
+ 1. Let _promiseCapability_ be _F_.[[PromiseCapability]].
1. Let _moduleRecord_ be ! HostResolveImportedModule(_referencingScriptOrModule_, _specifier_).
1. Assert: Evaluate has already been invoked on _moduleRecord_ and successfully completed.
1. Let _namespace_ be GetModuleNamespace(_moduleRecord_).
@@ -24428,9 +24434,10 @@ FinishDynamicImport ( _referencingScriptOrModule_, _specifier_, _promiseCapa
1. Else, perform ! Call(_promiseCapability_.[[Resolve]], *undefined*, « _namespace_.[[Value]] »).
- A CallDynamicImportRejected function is an anonymous built-in function with no internal slots and has one argument _error_. When a CallDynamicImportRejected function is called it performs the following steps:
+ A CallDynamicImportRejected function is an anonymous built-in function with one internal slot [[PromiseCapability]] and has one argument _error_. When a CallDynamicImportRejected function is called it performs the following steps:
- 1. Let _promiseCapability_ be *undefined*.
+ 1. Let _F_ be the active function object.
+ 1. Let _promiseCapability_ be _F_.[[PromiseCapability]].
1. Perform ! Call(_promiseCapability_.[[Reject]], *undefined*, « _error_ »).