mirror of
https://github.com/denoland/deno.git
synced 2024-12-27 01:29:14 -05:00
refactor(core): change script name for core.js (#8650)
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
This commit is contained in:
parent
5eedcb6b8d
commit
02762824e6
1 changed files with 18 additions and 1 deletions
|
@ -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"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue