Hi Steve,
Tip of tree for V8 recently turned on the
top-level await feature on by default. Previously it was gated behind the --harmony-top-level-await flag.
With top-level await, Module::Evaluate always returns a Promise object. This Promise is resolved when the module successfully evaluates, and is rejected otherwise. You can use the Promise API to attach then handlers.
If the module graph you're evaluating is not asynchronous and doesn't have any modules with top-level await in, the Promise returned by Module::Evaluate is already settled, and you should be able to pull the result value out without attaching a handler.
Hope this helps,
shu