summaryrefslogtreecommitdiff
path: root/cli/global_state.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-05-11 23:48:36 +0200
committerGitHub <noreply@github.com>2020-05-11 23:48:36 +0200
commitd062ffc1baeccca8bf168dc1ce4e94b929478142 (patch)
tree17992f7781840b619ce528d70b80c9c798d9ce61 /cli/global_state.rs
parent73d8fa74c656841703b51bf8d52d46acf3b97cc9 (diff)
fix: source maps in inspector (#5223)
This commit fixes problems with source maps in Chrome Devtools by substituting source map URL generated by TS compiler with actual file URL pointing to DENO_DIR. Dummy value of "source_map_url" has been removed from "ScriptOrigin". Also fixes lock file which used compiled source code to generate lock hash; it now uses source code of the file that is being compiled.
Diffstat (limited to 'cli/global_state.rs')
-rw-r--r--cli/global_state.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/global_state.rs b/cli/global_state.rs
index 4e9bdbb99..50c306a44 100644
--- a/cli/global_state.rs
+++ b/cli/global_state.rs
@@ -139,13 +139,13 @@ impl GlobalState {
};
Ok(CompiledModule {
- code: String::from_utf8(out.source_code)?,
+ code: String::from_utf8(out.source_code.clone())?,
name: out.url.to_string(),
})
}
}
_ => Ok(CompiledModule {
- code: String::from_utf8(out.source_code)?,
+ code: String::from_utf8(out.source_code.clone())?,
name: out.url.to_string(),
}),
}?;
@@ -154,9 +154,9 @@ impl GlobalState {
if let Some(ref lockfile) = state2.lockfile {
let mut g = lockfile.lock().unwrap();
if state2.flags.lock_write {
- g.insert(&compiled_module);
+ g.insert(&out.url, out.source_code);
} else {
- let check = match g.check(&compiled_module) {
+ let check = match g.check(&out.url, out.source_code) {
Err(e) => return Err(ErrBox::from(e)),
Ok(v) => v,
};