diff --git a/core/runtime.rs b/core/runtime.rs index c03ee9d6fc..ecac588ca9 100644 --- a/core/runtime.rs +++ b/core/runtime.rs @@ -326,7 +326,9 @@ impl JsRuntime { fn shared_init(&mut self) { if self.needs_init { self.needs_init = false; - self.execute("core.js", include_str!("core.js")).unwrap(); + self + .execute("deno:core/core.js", include_str!("core.js")) + .unwrap(); } } @@ -2584,4 +2586,19 @@ main(); }; }) } + + #[test] + fn test_core_js_stack_frame() { + let mut runtime = JsRuntime::new(RuntimeOptions::default()); + // Call non-existent op so we get error from `core.js` + let error = runtime + .execute( + "core_js_stack_frame.js", + "Deno.core.dispatchByName('non_existent');", + ) + .unwrap_err(); + let error_string = error.to_string(); + // Test that the script specifier is a URL: `deno:`. + assert!(error_string.contains("deno:core/core.js")); + } }