summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cli/tests/integration_tests.rs6
-rw-r--r--cli/tests/top_level_await.js3
-rw-r--r--cli/tests/top_level_await.out3
-rw-r--r--core/libdeno/api.cc5
-rw-r--r--core/libdeno/modules.cc8
-rw-r--r--gclient_config.py2
m---------third_party0
7 files changed, 22 insertions, 5 deletions
diff --git a/cli/tests/integration_tests.rs b/cli/tests/integration_tests.rs
index eb315d040..fd5efca18 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 000000000..af6fbd662
--- /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 000000000..4b65d15fe
--- /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 54501f543..18dc1d43e 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<char**>(argv), false);
}
}
diff --git a/core/libdeno/modules.cc b/core/libdeno/modules.cc
index e2915e8b1..5293fc95f 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 dea5af241..e4189f22a 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
-Subproject 86f683ab4a58e1c20995d08c3b57c3aba227dbe
+Subproject 1cceee1f4e315eaeee1bd4d1fe4cfbe7162fc4f