diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs index eb315d0409..fd5efca183 100644 --- a/cli/tests/integration_tests.rs +++ b/cli/tests/integration_tests.rs @@ -427,6 +427,7 @@ itest!(error_013_missing_script { itest!(error_014_catch_dynamic_import_error { args: "error_014_catch_dynamic_import_error.js --reload --allow-read", output: "error_014_catch_dynamic_import_error.js.out", + exit_code: 1, }); itest!(error_015_dynamic_import_permissions { @@ -549,3 +550,8 @@ itest!(wasm_async { args: "wasm_async.js", output: "wasm_async.out", }); + +itest!(top_level_await { + args: "--allow-read top_level_await.js", + output: "top_level_await.out", +}); diff --git a/cli/tests/top_level_await.js b/cli/tests/top_level_await.js new file mode 100644 index 0000000000..af6fbd6622 --- /dev/null +++ b/cli/tests/top_level_await.js @@ -0,0 +1,3 @@ +const buf = await Deno.readFile("hello.txt"); +const n = await Deno.stdout.write(buf); +console.log(`\n\nwrite ${n}`); diff --git a/cli/tests/top_level_await.out b/cli/tests/top_level_await.out new file mode 100644 index 0000000000..4b65d15fe3 --- /dev/null +++ b/cli/tests/top_level_await.out @@ -0,0 +1,3 @@ +Hello world! + +write 12 diff --git a/core/libdeno/api.cc b/core/libdeno/api.cc index 54501f543e..18dc1d43e3 100644 --- a/core/libdeno/api.cc +++ b/core/libdeno/api.cc @@ -120,8 +120,9 @@ void deno_init() { // remove this to make it work asynchronously too. But that requires getting // PumpMessageLoop and RunMicrotasks setup correctly. // See https://github.com/denoland/deno/issues/2544 - const char* argv[2] = {"", "--no-wasm-async-compilation"}; - int argc = 2; + const char* argv[3] = {"", "--no-wasm-async-compilation", + "--harmony-top-level-await"}; + int argc = 3; v8::V8::SetFlagsFromCommandLine(&argc, const_cast(argv), false); } } diff --git a/core/libdeno/modules.cc b/core/libdeno/modules.cc index e2915e8b17..5293fc95fb 100644 --- a/core/libdeno/modules.cc +++ b/core/libdeno/modules.cc @@ -147,8 +147,12 @@ void deno_mod_evaluate(Deno* d_, void* user_data, deno_mod id) { if (status == Module::kInstantiated) { bool ok = !module->Evaluate(context).IsEmpty(); status = module->GetStatus(); // Update status after evaluating. - CHECK_IMPLIES(ok, status == Module::kEvaluated); - CHECK_IMPLIES(!ok, status == Module::kErrored); + if (ok) { + // Note status can still be kErrored even if we get ok. + CHECK(status == Module::kEvaluated || status == Module::kErrored); + } else { + CHECK_EQ(status, Module::kErrored); + } } switch (status) { diff --git a/gclient_config.py b/gclient_config.py index dea5af2414..e4189f22ad 100644 --- a/gclient_config.py +++ b/gclient_config.py @@ -1,7 +1,7 @@ # Copyright 2018-2019 the Deno authors. All rights reserved. MIT license. solutions = [ { - 'url': 'https://chromium.googlesource.com/v8/v8.git@7.9.8', + 'url': 'https://chromium.googlesource.com/v8/v8.git@7.9.110', 'name': 'v8', 'deps_file': 'DEPS', 'custom_deps': { diff --git a/third_party b/third_party index 86f683ab4a..1cceee1f4e 160000 --- a/third_party +++ b/third_party @@ -1 +1 @@ -Subproject commit 86f683ab4a58e1c20995d08c3b57c3aba227dbe2 +Subproject commit 1cceee1f4e315eaeee1bd4d1fe4cfbe7162fc4fb