1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

Upgrade v8 to 7.7.200 (#2624)

This commit is contained in:
Ryan Dahl 2019-07-09 14:03:06 -04:00 committed by GitHub
parent d641782c82
commit 52c0764e4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 25 deletions

1
.gn
View file

@ -48,6 +48,7 @@ default_args = {
v8_deprecation_warnings = false v8_deprecation_warnings = false
v8_enable_gdbjit = false v8_enable_gdbjit = false
v8_enable_i18n_support = false v8_enable_i18n_support = false
v8_enable_shared_ro_heap = false # See #2624
v8_experimental_extra_library_files = [] v8_experimental_extra_library_files = []
v8_extra_library_files = [] v8_extra_library_files = []
v8_imminent_deprecation_warnings = false v8_imminent_deprecation_warnings = false

View file

@ -400,18 +400,21 @@ void EvalContext(const v8::FunctionCallbackInfo<v8::Value>& args) {
auto script = v8::Script::Compile(context, source, &origin); auto script = v8::Script::Compile(context, source, &origin);
if (script.IsEmpty()) { if (script.IsEmpty()) {
DCHECK(try_catch.HasCaught()); CHECK(try_catch.HasCaught());
auto exception = try_catch.Exception(); auto exception = try_catch.Exception();
output->Set(0, v8::Null(isolate)); CHECK(output->Set(context, 0, v8::Null(isolate)).FromJust());
auto errinfo_obj = v8::Object::New(isolate); auto errinfo_obj = v8::Object::New(isolate);
errinfo_obj->Set(v8_str("isCompileError"), v8_bool(true)); CHECK(errinfo_obj->Set(context, v8_str("isCompileError"), v8_bool(true))
errinfo_obj->Set(v8_str("isNativeError"), .FromJust());
v8_bool(exception->IsNativeError())); CHECK(errinfo_obj
errinfo_obj->Set(v8_str("thrown"), exception); ->Set(context, v8_str("isNativeError"),
v8_bool(exception->IsNativeError()))
.FromJust());
CHECK(errinfo_obj->Set(context, v8_str("thrown"), exception).FromJust());
output->Set(1, errinfo_obj); CHECK(output->Set(context, 1, errinfo_obj).FromJust());
args.GetReturnValue().Set(output); args.GetReturnValue().Set(output);
return; return;
@ -420,25 +423,28 @@ void EvalContext(const v8::FunctionCallbackInfo<v8::Value>& args) {
auto result = script.ToLocalChecked()->Run(context); auto result = script.ToLocalChecked()->Run(context);
if (result.IsEmpty()) { if (result.IsEmpty()) {
DCHECK(try_catch.HasCaught()); CHECK(try_catch.HasCaught());
auto exception = try_catch.Exception(); auto exception = try_catch.Exception();
output->Set(0, v8::Null(isolate)); CHECK(output->Set(context, 0, v8::Null(isolate)).FromJust());
auto errinfo_obj = v8::Object::New(isolate); auto errinfo_obj = v8::Object::New(isolate);
errinfo_obj->Set(v8_str("isCompileError"), v8_bool(false)); CHECK(errinfo_obj->Set(context, v8_str("isCompileError"), v8_bool(false))
errinfo_obj->Set(v8_str("isNativeError"), .FromJust());
v8_bool(exception->IsNativeError())); CHECK(errinfo_obj
errinfo_obj->Set(v8_str("thrown"), exception); ->Set(context, v8_str("isNativeError"),
v8_bool(exception->IsNativeError()))
.FromJust());
CHECK(errinfo_obj->Set(context, v8_str("thrown"), exception).FromJust());
output->Set(1, errinfo_obj); CHECK(output->Set(context, 1, errinfo_obj).FromJust());
args.GetReturnValue().Set(output); args.GetReturnValue().Set(output);
return; return;
} }
output->Set(0, result.ToLocalChecked()); CHECK(output->Set(context, 0, result.ToLocalChecked()).FromJust());
output->Set(1, v8::Null(isolate)); CHECK(output->Set(context, 1, v8::Null(isolate)).FromJust());
args.GetReturnValue().Set(output); args.GetReturnValue().Set(output);
} }

View file

@ -90,9 +90,12 @@ v8::Local<v8::Object> EncodeMessageAsObject(v8::Local<v8::Context> context,
auto column = v8::Integer::New(isolate, frame->GetColumn()); auto column = v8::Integer::New(isolate, frame->GetColumn());
CHECK(frame_obj->Set(context, v8_str("line"), line).FromJust()); CHECK(frame_obj->Set(context, v8_str("line"), line).FromJust());
CHECK(frame_obj->Set(context, v8_str("column"), column).FromJust()); CHECK(frame_obj->Set(context, v8_str("column"), column).FromJust());
CHECK(frame_obj
->Set(context, v8_str("functionName"), frame->GetFunctionName()) auto function_name = frame->GetFunctionName();
.FromJust()); if (!function_name.IsEmpty()) {
CHECK(frame_obj->Set(context, v8_str("functionName"), function_name)
.FromJust());
}
// scriptName can be empty in special conditions e.g. eval // scriptName can be empty in special conditions e.g. eval
auto scriptName = frame->GetScriptNameOrSourceURL(); auto scriptName = frame->GetScriptNameOrSourceURL();
if (scriptName.IsEmpty()) { if (scriptName.IsEmpty()) {

View file

@ -115,7 +115,8 @@ TEST(LibDenoTest, GlobalErrorHandling) {
"\"lineNumber\":3,\"startPosition\":3,\"endPosition\":4,\"errorLevel\":8," "\"lineNumber\":3,\"startPosition\":3,\"endPosition\":4,\"errorLevel\":8,"
"\"startColumn\":1,\"endColumn\":2,\"isSharedCrossOrigin\":false," "\"startColumn\":1,\"endColumn\":2,\"isSharedCrossOrigin\":false,"
"\"isOpaque\":false,\"frames\":[{\"line\":3,\"column\":2," "\"isOpaque\":false,\"frames\":[{\"line\":3,\"column\":2,"
"\"functionName\":\"\",\"scriptName\":\"helloworld.js\",\"isEval\":true," "\"functionName\":\"eval\",\"scriptName\":\"helloworld.js\",\"isEval\":"
"true,"
"\"isConstructor\":false,\"isWasm\":false},"; "\"isConstructor\":false,\"isWasm\":false},";
std::string actual(deno_last_exception(d), 0, expected.length()); std::string actual(deno_last_exception(d), 0, expected.length());
EXPECT_STREQ(expected.c_str(), actual.c_str()); EXPECT_STREQ(expected.c_str(), actual.c_str());
@ -177,7 +178,7 @@ TEST(LibDenoTest, LastException) {
"3,\"startPosition\":8,\"endPosition\":9,\"errorLevel\":8," "3,\"startPosition\":8,\"endPosition\":9,\"errorLevel\":8,"
"\"startColumn\":6,\"endColumn\":7,\"isSharedCrossOrigin\":" "\"startColumn\":6,\"endColumn\":7,\"isSharedCrossOrigin\":"
"false,\"isOpaque\":false,\"frames\":[{\"line\":3,\"column\":7," "false,\"isOpaque\":false,\"frames\":[{\"line\":3,\"column\":7,"
"\"functionName\":\"\",\"scriptName\":\"a.js\",\"isEval\":false," "\"scriptName\":\"a.js\",\"isEval\":false,"
"\"isConstructor\":false,\"isWasm\":false}]}"); "\"isConstructor\":false,\"isWasm\":false}]}");
deno_delete(d); deno_delete(d);
} }
@ -192,9 +193,9 @@ TEST(LibDenoTest, EncodeErrorBug) {
"defined\",\"sourceLine\":\"a\",\"lineNumber\":1,\"startPosition\":0," "defined\",\"sourceLine\":\"a\",\"lineNumber\":1,\"startPosition\":0,"
"\"endPosition\":1,\"errorLevel\":8,\"startColumn\":0,\"endColumn\":1," "\"endPosition\":1,\"errorLevel\":8,\"startColumn\":0,\"endColumn\":1,"
"\"isSharedCrossOrigin\":false,\"isOpaque\":false,\"frames\":[{\"line\":" "\"isSharedCrossOrigin\":false,\"isOpaque\":false,\"frames\":[{\"line\":"
"1,\"column\":1,\"functionName\":\"\",\"scriptName\":\"<unknown>\"," "1,\"column\":1,\"functionName\":\"eval\",\"scriptName\":\"<unknown>\","
"\"isEval\":true,\"isConstructor\":false,\"isWasm\":false},{\"line\":1," "\"isEval\":true,\"isConstructor\":false,\"isWasm\":false},{\"line\":1,"
"\"column\":1,\"functionName\":\"\",\"scriptName\":\"a.js\",\"isEval\":" "\"column\":1,\"scriptName\":\"a.js\",\"isEval\":"
"false,\"isConstructor\":false,\"isWasm\":false}]}"); "false,\"isConstructor\":false,\"isWasm\":false}]}");
deno_delete(d); deno_delete(d);
} }

View file

@ -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': 'url':
'https://chromium.googlesource.com/v8/v8.git@7.7.37', 'https://chromium.googlesource.com/v8/v8.git@7.7.200',
'name': 'v8', 'name': 'v8',
'deps_file': 'DEPS', 'deps_file': 'DEPS',
'custom_deps': { 'custom_deps': {

@ -1 +1 @@
Subproject commit 159c954ab0e11f655c7cb2a36302c0261c3e121b Subproject commit e319136a1744710ffd3c2ea372a7dfc1d462f120