fix(op_crates/web): Use "deno:" URLs for internal script specifiers (#7383)

This commit is contained in:
Nayeem Rahman 2020-09-09 13:23:57 +01:00 committed by GitHub
parent c14436a424
commit b17a5fbcfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 73 additions and 29 deletions

View file

@ -1103,6 +1103,9 @@ impl TsCompiler {
script_name: &str,
) -> Option<Vec<u8>> {
if let Some(module_specifier) = self.try_to_resolve(script_name) {
if module_specifier.as_url().scheme() == "deno" {
return None;
}
return match self.get_source_map_file(&module_specifier) {
Ok(out) => Some(out.source_code.into_bytes()),
Err(_) => {
@ -1848,11 +1851,11 @@ mod tests {
(r#"{ "compilerOptions": { "checkJs": true } } "#, true),
// JSON with comment
(
r#"{
"compilerOptions": {
// force .js file compilation by Deno
"checkJs": true
}
r#"{
"compilerOptions": {
// force .js file compilation by Deno
"checkJs": true
}
}"#,
true,
),