From a7e25b812616e1a8a811de281ab73ff55586e4ca Mon Sep 17 00:00:00 2001 From: Geert-Jan Zwiers Date: Thu, 6 Apr 2023 01:46:21 +0200 Subject: fix(ext/node): json encode binary command name (#18596) Fixes https://github.com/denoland/deno/issues/18588 --- ext/node/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ext') 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, ) -> 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() }; -- cgit v1.2.3