diff --git a/.gn b/.gn index 2b19365dd2..e0d902808f 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 ee379fc5b1..da582a3bfa 100644 --- a/core/libdeno/binding.cc +++ b/core/libdeno/binding.cc @@ -400,18 +400,21 @@ void EvalContext(const v8::FunctionCallbackInfo& 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& 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 8f5779acdc..7484e4eb48 100644 --- a/core/libdeno/exceptions.cc +++ b/core/libdeno/exceptions.cc @@ -90,9 +90,12 @@ v8::Local EncodeMessageAsObject(v8::Local 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 c2d76c8764..16a4a11f61 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\":\"\"," + "1,\"column\":1,\"functionName\":\"eval\",\"scriptName\":\"\"," "\"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 a8ca88c21c..f27ff9aedf 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 index 159c954ab0..e319136a17 160000 --- a/third_party +++ b/third_party @@ -1 +1 @@ -Subproject commit 159c954ab0e11f655c7cb2a36302c0261c3e121b +Subproject commit e319136a1744710ffd3c2ea372a7dfc1d462f120