summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-09-24 18:37:04 -0400
committerGitHub <noreply@github.com>2019-09-24 18:37:04 -0400
commita497f87b59a5271d89cf50063154c46c4e52c523 (patch)
tree589f025bfca66cb96b8ea6ca51440340f4909f53 /core
parent726f08694b4d27a06dee7fbbef3a574a7c2c0053 (diff)
Upgrade V8 for top-level-await (#3015)
Diffstat (limited to 'core')
-rw-r--r--core/libdeno/api.cc5
-rw-r--r--core/libdeno/modules.cc8
2 files changed, 9 insertions, 4 deletions
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) {