summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2021-07-08 18:56:53 +0200
committerGitHub <noreply@github.com>2021-07-08 18:56:53 +0200
commit27e1b4cb5ac81c5ac2ca5adf78c91fdbef9409e8 (patch)
treee5dc9610d551663926eceb34a0e4a31b8624b487 /runtime/worker.rs
parent91fe137d7da3cbd1ab1c2cfd963962d964571526 (diff)
feat(core): return v8::Value from JsRuntime::execute_script (#11129)
This commit changes return type of JsRuntime::execute_script to include v8::Value returned from evaluation. When embedding deno_core it is sometimes useful to be able to inspect script evaluation value without the hoops of adding ops to store the value on the OpState. v8::Global<v8::Value> is used so consumers don't have to pass scope themselves.
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index 04c294146..543eae6f6 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -191,7 +191,8 @@ impl MainWorker {
name: &str,
source_code: &str,
) -> Result<(), AnyError> {
- self.js_runtime.execute_script(name, source_code)
+ self.js_runtime.execute_script(name, source_code)?;
+ Ok(())
}
/// Loads and instantiates specified JavaScript module.