mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
Fix error when JS is executed with --recompile (#2007)
test case from @afinch7
This commit is contained in:
parent
8c770c5a90
commit
d0b6152f11
4 changed files with 10 additions and 3 deletions
|
@ -184,9 +184,8 @@ fn fetch_module_meta_data_and_maybe_compile_async(
|
|||
.dir
|
||||
.fetch_module_meta_data_async(&specifier, &referrer)
|
||||
.and_then(move |mut out| {
|
||||
if (out.media_type == msg::MediaType::TypeScript
|
||||
&& out.maybe_output_code.is_none())
|
||||
|| state_.flags.recompile
|
||||
if out.media_type == msg::MediaType::TypeScript
|
||||
&& (out.maybe_output_code.is_none() || state_.flags.recompile)
|
||||
{
|
||||
debug!(">>>>> compile_sync START");
|
||||
out = compile_sync(state_.clone(), &specifier, &referrer, &out);
|
||||
|
|
5
tests/025_reload_js_type_error.js
Normal file
5
tests/025_reload_js_type_error.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
// There was a bug where if this was executed with --recompile it would throw a
|
||||
// type error.
|
||||
window.test = null;
|
||||
test = console;
|
||||
test.log("hello");
|
1
tests/025_reload_js_type_error.js.out
Normal file
1
tests/025_reload_js_type_error.js.out
Normal file
|
@ -0,0 +1 @@
|
|||
hello
|
2
tests/025_reload_js_type_error.test
Normal file
2
tests/025_reload_js_type_error.test
Normal file
|
@ -0,0 +1,2 @@
|
|||
args: tests/025_reload_js_type_error.js --reload --recompile
|
||||
output: tests/025_reload_js_type_error.js.out
|
Loading…
Reference in a new issue