1
0
Fork 0
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:
Ryan Dahl 2019-03-27 16:10:31 -04:00 committed by GitHub
parent 8c770c5a90
commit d0b6152f11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View file

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

View 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");

View file

@ -0,0 +1 @@
hello

View file

@ -0,0 +1,2 @@
args: tests/025_reload_js_type_error.js --reload --recompile
output: tests/025_reload_js_type_error.js.out