Commit d057c823 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by Commit Bot

[api] Update v8::Module::Evaluate comment for TLA

With top-level await enabled by default, the behavior of
v8::Module::Evaluate is changed to always return a Promise, and should
be documented.

No-try: true
Change-Id: I8bf41a18d8d98befecd62d6423ab37fdbaac3aad
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2854874Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Auto-Submit: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74238}
parent 7b55cdd4
......@@ -1674,10 +1674,12 @@ class V8_EXPORT Module : public Data {
/**
* Evaluates the module and its dependencies.
*
* If status is kInstantiated, run the module's code. On success, set status
* to kEvaluated and return the completion value; on failure, set status to
* kErrored and propagate the thrown exception (which is then also available
* via |GetException|).
* If status is kInstantiated, run the module's code and return a Promise
* object. On success, set status to kEvaluated and resolve the Promise with
* the completion value; on failure, set status to kErrored and reject the
* Promise with the error.
*
* If IsGraphAsync() is false, the returned Promise is settled.
*/
V8_WARN_UNUSED_RESULT MaybeLocal<Value> Evaluate(Local<Context> context);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment