mirror of
https://github.com/denoland/deno.git
synced 2025-01-18 11:53:59 -05:00
Upgrade V8 for top-level-await (#3015)
This commit is contained in:
parent
726f08694b
commit
a497f87b59
7 changed files with 23 additions and 6 deletions
|
@ -427,6 +427,7 @@ itest!(error_013_missing_script {
|
||||||
itest!(error_014_catch_dynamic_import_error {
|
itest!(error_014_catch_dynamic_import_error {
|
||||||
args: "error_014_catch_dynamic_import_error.js --reload --allow-read",
|
args: "error_014_catch_dynamic_import_error.js --reload --allow-read",
|
||||||
output: "error_014_catch_dynamic_import_error.js.out",
|
output: "error_014_catch_dynamic_import_error.js.out",
|
||||||
|
exit_code: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
itest!(error_015_dynamic_import_permissions {
|
itest!(error_015_dynamic_import_permissions {
|
||||||
|
@ -549,3 +550,8 @@ itest!(wasm_async {
|
||||||
args: "wasm_async.js",
|
args: "wasm_async.js",
|
||||||
output: "wasm_async.out",
|
output: "wasm_async.out",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
itest!(top_level_await {
|
||||||
|
args: "--allow-read top_level_await.js",
|
||||||
|
output: "top_level_await.out",
|
||||||
|
});
|
||||||
|
|
3
cli/tests/top_level_await.js
Normal file
3
cli/tests/top_level_await.js
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
const buf = await Deno.readFile("hello.txt");
|
||||||
|
const n = await Deno.stdout.write(buf);
|
||||||
|
console.log(`\n\nwrite ${n}`);
|
3
cli/tests/top_level_await.out
Normal file
3
cli/tests/top_level_await.out
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Hello world!
|
||||||
|
|
||||||
|
write 12
|
|
@ -120,8 +120,9 @@ void deno_init() {
|
||||||
// remove this to make it work asynchronously too. But that requires getting
|
// remove this to make it work asynchronously too. But that requires getting
|
||||||
// PumpMessageLoop and RunMicrotasks setup correctly.
|
// PumpMessageLoop and RunMicrotasks setup correctly.
|
||||||
// See https://github.com/denoland/deno/issues/2544
|
// See https://github.com/denoland/deno/issues/2544
|
||||||
const char* argv[2] = {"", "--no-wasm-async-compilation"};
|
const char* argv[3] = {"", "--no-wasm-async-compilation",
|
||||||
int argc = 2;
|
"--harmony-top-level-await"};
|
||||||
|
int argc = 3;
|
||||||
v8::V8::SetFlagsFromCommandLine(&argc, const_cast<char**>(argv), false);
|
v8::V8::SetFlagsFromCommandLine(&argc, const_cast<char**>(argv), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,8 +147,12 @@ void deno_mod_evaluate(Deno* d_, void* user_data, deno_mod id) {
|
||||||
if (status == Module::kInstantiated) {
|
if (status == Module::kInstantiated) {
|
||||||
bool ok = !module->Evaluate(context).IsEmpty();
|
bool ok = !module->Evaluate(context).IsEmpty();
|
||||||
status = module->GetStatus(); // Update status after evaluating.
|
status = module->GetStatus(); // Update status after evaluating.
|
||||||
CHECK_IMPLIES(ok, status == Module::kEvaluated);
|
if (ok) {
|
||||||
CHECK_IMPLIES(!ok, status == Module::kErrored);
|
// 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) {
|
switch (status) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||||
solutions = [
|
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',
|
'name': 'v8',
|
||||||
'deps_file': 'DEPS',
|
'deps_file': 'DEPS',
|
||||||
'custom_deps': {
|
'custom_deps': {
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 86f683ab4a58e1c20995d08c3b57c3aba227dbe2
|
Subproject commit 1cceee1f4e315eaeee1bd4d1fe4cfbe7162fc4fb
|
Loading…
Add table
Reference in a new issue