1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

refactor(core): change script name for core.js (#8650)

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
This commit is contained in:
Bartek Iwańczuk 2020-12-08 00:36:15 +01:00 committed by GitHub
parent 5eedcb6b8d
commit 02762824e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"));
}
}