Chromium Code Reviews| Index: third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp |
| diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp |
| index eb078f98b0c55a89a7c16c1d429e4b0021485820..de3be82f5478bedcee72f78aafb541e32280cce6 100644 |
| --- a/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp |
| +++ b/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp |
| @@ -659,6 +659,8 @@ v8::Local<v8::Object> V8Console::createConsole(InspectedContext* inspectedContex |
| v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); |
| v8::Local<v8::Object> console = v8::Object::New(isolate); |
| + bool success = console->SetPrototype(context, v8::Object::New(isolate)).FromMaybe(false); |
|
pfeldman
2016/08/16 17:07:36
You want 'null', not an object, otherwise I don't
dgozman
2016/08/17 00:58:32
This is a part of console prototype "spec".
|
| + DCHECK(success); |
| createBoundFunctionProperty(context, console, "debug", V8Console::debugCallback); |
| createBoundFunctionProperty(context, console, "error", V8Console::errorCallback); |
| @@ -684,9 +686,6 @@ v8::Local<v8::Object> V8Console::createConsole(InspectedContext* inspectedContex |
| createBoundFunctionProperty(context, console, "timeEnd", V8Console::timeEndCallback); |
| createBoundFunctionProperty(context, console, "timeStamp", V8Console::timeStampCallback); |
| - bool success = console->SetPrototype(context, v8::Object::New(isolate)).FromMaybe(false); |
| - DCHECK(success); |
| - |
| if (hasMemoryAttribute) |
| console->SetAccessorProperty(toV8StringInternalized(isolate, "memory"), V8_FUNCTION_NEW_REMOVE_PROTOTYPE(context, V8Console::memoryGetterCallback, console, 0).ToLocalChecked(), V8_FUNCTION_NEW_REMOVE_PROTOTYPE(context, V8Console::memorySetterCallback, v8::Local<v8::Value>(), 0).ToLocalChecked(), static_cast<v8::PropertyAttribute>(v8::None), v8::DEFAULT); |
| @@ -707,6 +706,8 @@ v8::Local<v8::Object> V8Console::createCommandLineAPI(InspectedContext* inspecte |
| v8::MicrotasksScope microtasksScope(isolate, v8::MicrotasksScope::kDoNotRunMicrotasks); |
| v8::Local<v8::Object> commandLineAPI = v8::Object::New(isolate); |
| + bool success = commandLineAPI->SetPrototype(context, v8::Null(isolate)).FromMaybe(false); |
|
pfeldman
2016/08/16 17:07:36
Since these are configurable, user will re-define
dgozman
2016/08/17 00:58:32
Right, but this helps a bit.
|
| + DCHECK(success); |
| createBoundFunctionProperty(context, commandLineAPI, "dir", V8Console::dirCallback, "function dir(value) { [Command Line API] }"); |
| createBoundFunctionProperty(context, commandLineAPI, "dirxml", V8Console::dirxmlCallback, "function dirxml(value) { [Command Line API] }"); |