diff options
author | Christian Dürr <102963075+cd-work@users.noreply.github.com> | 2022-06-20 12:40:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-20 14:40:57 +0200 |
commit | 94d369ebc65a55bd9fbf378a765c8ed88a4efe2c (patch) | |
tree | fe92d71f9dcffe1244fb2fbf6bc28adbeff7524a /core/runtime.rs | |
parent | 4cbb2567b502445ef6c13acac64b5f93218db4ba (diff) |
docs: Improve `mod_evaluate` documentation (#14827)
Diffstat (limited to 'core/runtime.rs')
-rw-r--r-- | core/runtime.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/runtime.rs b/core/runtime.rs index 6cc638122..4ca1247f6 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -1190,10 +1190,11 @@ impl JsRuntime { /// Evaluates an already instantiated ES module. /// /// Returns a receiver handle that resolves when module promise resolves. - /// Implementors must manually call `run_event_loop()` to drive module - /// evaluation future. + /// Implementors must manually call [`JsRuntime::run_event_loop`] to drive + /// module evaluation future. /// - /// `Error` can usually be downcast to `JsError`. + /// `Error` can usually be downcast to `JsError` and should be awaited and + /// checked after [`JsRuntime::run_event_loop`] completion. /// /// This function panics if module has not been instantiated. pub fn mod_evaluate( @@ -1550,7 +1551,7 @@ impl JsRuntime { /// The module will be marked as "main", and because of that /// "import.meta.main" will return true when checked inside that module. /// - /// User must call `JsRuntime::mod_evaluate` with returned `ModuleId` + /// User must call [`JsRuntime::mod_evaluate`] with returned `ModuleId` /// manually after load is finished. pub async fn load_main_module( &mut self, @@ -1609,7 +1610,7 @@ impl JsRuntime { /// This method is meant to be used when loading some utility code that /// might be later imported by the main module (ie. an entry point module). /// - /// User must call `JsRuntime::mod_evaluate` with returned `ModuleId` + /// User must call [`JsRuntime::mod_evaluate`] with returned `ModuleId` /// manually after load is finished. pub async fn load_side_module( &mut self, |