From 27e1b4cb5ac81c5ac2ca5adf78c91fdbef9409e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Thu, 8 Jul 2021 18:56:53 +0200 Subject: 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 is used so consumers don't have to pass scope themselves. --- cli/lsp/tsc.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs index 130e025ae..aed1dda9d 100644 --- a/cli/lsp/tsc.rs +++ b/cli/lsp/tsc.rs @@ -2265,7 +2265,8 @@ fn start( let init_config = json!({ "debug": debug, "rootUri": root_uri }); let init_src = format!("globalThis.serverInit({});", init_config); - runtime.execute_script(&located_script_name!(), &init_src) + runtime.execute_script(&located_script_name!(), &init_src)?; + Ok(()) } #[derive(Debug, Serialize)] -- cgit v1.2.3