diff options
Diffstat (limited to 'cli/node')
-rw-r--r-- | cli/node/mod.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/cli/node/mod.rs b/cli/node/mod.rs index fc4db33ee..fa6f0bdda 100644 --- a/cli/node/mod.rs +++ b/cli/node/mod.rs @@ -636,17 +636,22 @@ pub fn load_cjs_module_from_ext_node( js_runtime: &mut JsRuntime, module: &str, main: bool, + inspect_brk: bool, ) -> Result<(), AnyError> { fn escape_for_single_quote_string(text: &str) -> String { text.replace('\\', r"\\").replace('\'', r"\'") } let source_code = &format!( - r#"(function loadCjsModule(module) {{ + r#"(function loadCjsModule(module, inspectBrk) {{ + if (inspectBrk) {{ + Deno[Deno.internal].require.setInspectBrk(); + }} Deno[Deno.internal].require.Module._load(module, null, {main}); - }})('{module}');"#, + }})('{module}', {inspect_brk});"#, main = main, module = escape_for_single_quote_string(module), + inspect_brk = inspect_brk, ); js_runtime.execute_script(&located_script_name!(), source_code)?; |