Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! vm: make vm.Module.evaluate() conditionally synchronous
Co-authored-by: Chengzhong Wu <[email protected]>
  • Loading branch information
joyeecheung and legendecas committed Oct 15, 2025
commit 52ebb46876ab79ca51d5459829a55f61290ea5e7
4 changes: 2 additions & 2 deletions doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ in the ECMAScript specification.
Evaluate the module and its depenendencies. Corresponds to the [Evaluate() concrete method][] field of
[Cyclic Module Record][]s in the ECMAScript specification.

If the module is a `vm.SourceTextModule`,`evaluate()` must be called after the module has been at least linked;
If the module is a `vm.SourceTextModule`, `evaluate()` must be called after the module has been instantiated;
otherwise `evaluate()` will return a rejected promise.

For a `vm.SourceTextModule`, the promise returned by `evaluate()` may be fulfilled either
Expand All @@ -631,7 +631,7 @@ synchronously or asynchronously:
fulfilled _synchronously_ after the module and all its dependencies have been evaluated.
1. If the evaluation succeeds, the promise will be _synchronously_ resolved to `undefined`.
2. If the evaluation results in an exception, the promise will be _synchronously_ rejected with the exception
that causes the evaluation to fail.
`module.error` that causes the evaluation to fail and .
2. If the `vm.SourceTextModule` has top-level `await` in itself or any of its dependencies, the promise will be
fulfilled _asynchronously_ after the module and all its dependencies have been evaluated.
1. If the evaluation succeeds, the promise will be _asynchronously_ resolved to `undefined`.
Expand Down
Loading