diff options
author | Geert-Jan Zwiers <geertjanzwiers@protonmail.com> | 2023-04-06 01:46:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-06 01:46:21 +0200 |
commit | a7e25b812616e1a8a811de281ab73ff55586e4ca (patch) | |
tree | dce27de90ed190a284c04b89dcfcfe2ba863defd /ext/node/lib.rs | |
parent | 36e8c8dfd759458aa735f79f5cc7cd346c727914 (diff) |
fix(ext/node): json encode binary command name (#18596)
Fixes https://github.com/denoland/deno/issues/18588
Diffstat (limited to 'ext/node/lib.rs')
-rw-r--r-- | ext/node/lib.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/node/lib.rs b/ext/node/lib.rs index 7bf721f0a..12d7b0b1e 100644 --- a/ext/node/lib.rs +++ b/ext/node/lib.rs @@ -3,6 +3,7 @@ use deno_core::error::AnyError; use deno_core::located_script_name; use deno_core::op; +use deno_core::serde_json; use deno_core::JsRuntime; use once_cell::sync::Lazy; use std::collections::HashSet; @@ -430,7 +431,7 @@ pub fn initialize_runtime( maybe_binary_command_name: Option<String>, ) -> Result<(), AnyError> { let argv0 = if let Some(binary_command_name) = maybe_binary_command_name { - format!("\"{}\"", binary_command_name) + serde_json::to_string(binary_command_name.as_str())? } else { "undefined".to_string() }; |