summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-07-09 14:03:06 -0400
committerGitHub <noreply@github.com>2019-07-09 14:03:06 -0400
commit52c0764e4fd56928fca0b201c9d402b25d3f2145 (patch)
tree5362dc12cbaa5ba84c16ea01297de982009121c7
parentd641782c823317a2d2f64d646a0d5b8b6c22b771 (diff)
Upgrade v8 to 7.7.200 (#2624)
-rw-r--r--.gn1
-rw-r--r--core/libdeno/binding.cc38
-rw-r--r--core/libdeno/exceptions.cc9
-rw-r--r--core/libdeno/libdeno_test.cc9
-rw-r--r--gclient_config.py2
m---------third_party0
6 files changed, 35 insertions, 24 deletions
diff --git a/.gn b/.gn
index 2b19365dd..e0d902808 100644
--- a/.gn
+++ b/.gn
@@ -48,6 +48,7 @@ default_args = {
v8_deprecation_warnings = false
v8_enable_gdbjit = false
v8_enable_i18n_support = false
+ v8_enable_shared_ro_heap = false # See #2624
v8_experimental_extra_library_files = []
v8_extra_library_files = []
v8_imminent_deprecation_warnings = false
diff --git a/core/libdeno/binding.cc b/core/libdeno/binding.cc
index ee379fc5b..da582a3bf 100644
--- a/core/libdeno/binding.cc
+++ b/core/libdeno/binding.cc
@@ -400,18 +400,21 @@ void EvalContext(const v8::FunctionCallbackInfo<v8::Value>& args) {
auto script = v8::Script::Compile(context, source, &origin);
if (script.IsEmpty()) {
- DCHECK(try_catch.HasCaught());
+ CHECK(try_catch.HasCaught());
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);
- errinfo_obj->Set(v8_str("isCompileError"), v8_bool(true));
- errinfo_obj->Set(v8_str("isNativeError"),
- v8_bool(exception->IsNativeError()));
- errinfo_obj->Set(v8_str("thrown"), exception);
+ CHECK(errinfo_obj->Set(context, v8_str("isCompileError"), v8_bool(true))
+ .FromJust());
+ CHECK(errinfo_obj
+ ->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);
return;
@@ -420,25 +423,28 @@ void EvalContext(const v8::FunctionCallbackInfo<v8::Value>& args) {
auto result = script.ToLocalChecked()->Run(context);
if (result.IsEmpty()) {
- DCHECK(try_catch.HasCaught());
+ CHECK(try_catch.HasCaught());
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);
- errinfo_obj->Set(v8_str("isCompileError"), v8_bool(false));
- errinfo_obj->Set(v8_str("isNativeError"),
- v8_bool(exception->IsNativeError()));
- errinfo_obj->Set(v8_str("thrown"), exception);
+ CHECK(errinfo_obj->Set(context, v8_str("isCompileError"), v8_bool(false))
+ .FromJust());
+ CHECK(errinfo_obj
+ ->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);
return;
}
- output->Set(0, result.ToLocalChecked());
- output->Set(1, v8::Null(isolate));
+ CHECK(output->Set(context, 0, result.ToLocalChecked()).FromJust());
+ CHECK(output->Set(context, 1, v8::Null(isolate)).FromJust());
args.GetReturnValue().Set(output);
}
diff --git a/core/libdeno/exceptions.cc b/core/libdeno/exceptions.cc
index 8f5779acd..7484e4eb4 100644
--- a/core/libdeno/exceptions.cc
+++ b/core/libdeno/exceptions.cc
@@ -90,9 +90,12 @@ v8::Local<v8::Object> EncodeMessageAsObject(v8::Local<v8::Context> context,
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("column"), column).FromJust());
- CHECK(frame_obj
- ->Set(context, v8_str("functionName"), frame->GetFunctionName())
- .FromJust());
+
+ auto function_name = frame->GetFunctionName();
+ 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
auto scriptName = frame->GetScriptNameOrSourceURL();
if (scriptName.IsEmpty()) {
diff --git a/core/libdeno/libdeno_test.cc b/core/libdeno/libdeno_test.cc
index c2d76c876..16a4a11f6 100644
--- a/core/libdeno/libdeno_test.cc
+++ b/core/libdeno/libdeno_test.cc
@@ -115,7 +115,8 @@ TEST(LibDenoTest, GlobalErrorHandling) {
"\"lineNumber\":3,\"startPosition\":3,\"endPosition\":4,\"errorLevel\":8,"
"\"startColumn\":1,\"endColumn\":2,\"isSharedCrossOrigin\":false,"
"\"isOpaque\":false,\"frames\":[{\"line\":3,\"column\":2,"
- "\"functionName\":\"\",\"scriptName\":\"helloworld.js\",\"isEval\":true,"
+ "\"functionName\":\"eval\",\"scriptName\":\"helloworld.js\",\"isEval\":"
+ "true,"
"\"isConstructor\":false,\"isWasm\":false},";
std::string actual(deno_last_exception(d), 0, expected.length());
EXPECT_STREQ(expected.c_str(), actual.c_str());
@@ -177,7 +178,7 @@ TEST(LibDenoTest, LastException) {
"3,\"startPosition\":8,\"endPosition\":9,\"errorLevel\":8,"
"\"startColumn\":6,\"endColumn\":7,\"isSharedCrossOrigin\":"
"false,\"isOpaque\":false,\"frames\":[{\"line\":3,\"column\":7,"
- "\"functionName\":\"\",\"scriptName\":\"a.js\",\"isEval\":false,"
+ "\"scriptName\":\"a.js\",\"isEval\":false,"
"\"isConstructor\":false,\"isWasm\":false}]}");
deno_delete(d);
}
@@ -192,9 +193,9 @@ TEST(LibDenoTest, EncodeErrorBug) {
"defined\",\"sourceLine\":\"a\",\"lineNumber\":1,\"startPosition\":0,"
"\"endPosition\":1,\"errorLevel\":8,\"startColumn\":0,\"endColumn\":1,"
"\"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,"
- "\"column\":1,\"functionName\":\"\",\"scriptName\":\"a.js\",\"isEval\":"
+ "\"column\":1,\"scriptName\":\"a.js\",\"isEval\":"
"false,\"isConstructor\":false,\"isWasm\":false}]}");
deno_delete(d);
}
diff --git a/gclient_config.py b/gclient_config.py
index a8ca88c21..f27ff9aed 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.7.37',
+ 'https://chromium.googlesource.com/v8/v8.git@7.7.200',
'name': 'v8',
'deps_file': 'DEPS',
'custom_deps': {
diff --git a/third_party b/third_party
-Subproject 159c954ab0e11f655c7cb2a36302c0261c3e121
+Subproject e319136a1744710ffd3c2ea372a7dfc1d462f12