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

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

Issue 1950303004: [DevTools] Add additional accessor check in InjectedScriptSource.js (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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/V8InjectedScriptHost.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
index b15db44c21703288b4e6047b7c00da5fb2eee47f..b81bdbfd0bf3f3e534474ceb3bd79433c0cd55ee 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/V8InjectedScriptHost.cpp
@@ -69,9 +69,12 @@ void V8InjectedScriptHost::internalConstructorNameCallback(const v8::FunctionCal
void V8InjectedScriptHost::formatAccessorsAsProperties(const v8::FunctionCallbackInfo<v8::Value>& info)
{
- if (info.Length() < 1)
+ ASSERT(info.Length() == 2);
+ info.GetReturnValue().Set(false);
+ if (!info[1]->IsFunction())
dgozman 2016/05/23 15:53:03 How this could be possible? Why do we return |fals
kozy 2016/05/23 17:05:12 It could be undefined and we don't want to format
+ return;
+ if (info[1].As<v8::Function>()->ScriptId() != v8::UnboundScript::kNoScriptId)
dgozman 2016/05/23 15:53:03 Let's comment that this means user-defined code.
kozy 2016/05/23 17:05:12 Done.
return;
-
info.GetReturnValue().Set(unwrapDebugger(info)->client()->formatAccessorsAsProperties(info[0]));
}

Powered by Google App Engine
This is Rietveld 408576698