diff --git a/cli/isolate.rs b/cli/isolate.rs index fad1f5ab50..bc88190aee 100644 --- a/cli/isolate.rs +++ b/cli/isolate.rs @@ -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); diff --git a/tests/025_reload_js_type_error.js b/tests/025_reload_js_type_error.js new file mode 100644 index 0000000000..e19275daac --- /dev/null +++ b/tests/025_reload_js_type_error.js @@ -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"); diff --git a/tests/025_reload_js_type_error.js.out b/tests/025_reload_js_type_error.js.out new file mode 100644 index 0000000000..ce01362503 --- /dev/null +++ b/tests/025_reload_js_type_error.js.out @@ -0,0 +1 @@ +hello diff --git a/tests/025_reload_js_type_error.test b/tests/025_reload_js_type_error.test new file mode 100644 index 0000000000..dba89cea81 --- /dev/null +++ b/tests/025_reload_js_type_error.test @@ -0,0 +1,2 @@ +args: tests/025_reload_js_type_error.js --reload --recompile +output: tests/025_reload_js_type_error.js.out