Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade V8 and support top-level-await #3015

Merged
merged 3 commits into from
Sep 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cli/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,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 {
Expand Down Expand Up @@ -536,3 +537,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",
});
3 changes: 3 additions & 0 deletions cli/tests/top_level_await.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const buf = await Deno.readFile("hello.txt");
const n = await Deno.stdout.write(buf);
console.log(`\n\nwrite ${n}`);
3 changes: 3 additions & 0 deletions cli/tests/top_level_await.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Hello world!

write 12
5 changes: 3 additions & 2 deletions core/libdeno/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
8 changes: 6 additions & 2 deletions core/libdeno/modules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
ry marked this conversation as resolved.
Show resolved Hide resolved
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) {
Expand Down
2 changes: 1 addition & 1 deletion gclient_config.py
Original file line number Diff line number Diff line change
@@ -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': {
Expand Down
2 changes: 1 addition & 1 deletion third_party
Submodule third_party updated 963 files