Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1064)

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp

Issue 2269843002: [DevTools] Improve ConsoleAPI functions string description (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reverted set console in InspectedContext Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 73a90e225e11aeac62626e36a217ceaa5b2ecf51..fdcd662b0fceac5f71cb90616b3c414d500617e4 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8Console.cpp
@@ -15,6 +15,7 @@
#include "platform/v8_inspector/V8RuntimeAgentImpl.h"
#include "platform/v8_inspector/V8StackTraceImpl.h"
#include "platform/v8_inspector/V8StringUtil.h"
+#include "platform/v8_inspector/V8ValueCopier.h"
#include "platform/v8_inspector/public/V8InspectorClient.h"
namespace v8_inspector {
@@ -276,10 +277,9 @@ void createBoundFunctionProperty(v8::Local<v8::Context> context, v8::Local<v8::O
v8::Local<v8::String> returnValue = toV8String(context->GetIsolate(), description);
v8::Local<v8::Function> toStringFunction;
if (V8_FUNCTION_NEW_REMOVE_PROTOTYPE(context, returnDataCallback, returnValue, 0).ToLocal(&toStringFunction))
- func->Set(toV8StringInternalized(context->GetIsolate(), "toString"), toStringFunction);
+ createDataProperty(context, func, toV8StringInternalized(context->GetIsolate(), "toString"), toStringFunction);
}
- if (!console->Set(context, funcName, func).FromMaybe(false))
- return;
+ createDataProperty(context, console, funcName, func);
}
} // namespace
@@ -522,8 +522,7 @@ void V8Console::valuesCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
v8::Local<v8::Value> value;
if (!obj->Get(context, key).ToLocal(&value))
continue;
- if (!values->Set(context, i, value).FromMaybe(false))
- continue;
+ createDataProperty(context, values, i, value);
}
info.GetReturnValue().Set(values);
}

Powered by Google App Engine
This is Rietveld 408576698