summaryrefslogtreecommitdiff
path: root/core/runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'core/runtime.rs')
-rw-r--r--core/runtime.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/runtime.rs b/core/runtime.rs
index c03ee9d6f..ecac588ca 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:<repo-relative path>`.
+ assert!(error_string.contains("deno:core/core.js"));
+ }
}