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

Unified Diff: src/inspector/v8-console.cc

Issue 2391323002: [inspector] command line api debug and monitor works with bound functions (Closed)
Patch Set: Created 4 years, 2 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: src/inspector/v8-console.cc
diff --git a/src/inspector/v8-console.cc b/src/inspector/v8-console.cc
index b094de10b0469f213ec118d72992279bed7170c4..58bdaa7db1a0dfcdd1a7b9cd7f255cb4df37f768 100644
--- a/src/inspector/v8-console.cc
+++ b/src/inspector/v8-console.cc
@@ -139,7 +139,13 @@ class ConsoleHelper {
v8::MaybeLocal<v8::Function> firstArgAsFunction() {
if (m_info.Length() < 1 || !m_info[0]->IsFunction())
return v8::MaybeLocal<v8::Function>();
- return m_info[0].As<v8::Function>();
+ v8::Local<v8::Function> func = m_info[0].As<v8::Function>();
+ v8::Local<v8::Value> targetFunction = func->GetBoundFunction();
+ while (targetFunction->IsFunction()) {
dgozman 2016/10/05 17:23:32 while (func->GetBoundFunction()->IsFunction()) f
kozy 2016/10/05 17:33:10 Done.
+ func = targetFunction.As<v8::Function>();
+ targetFunction = targetFunction.As<v8::Function>()->GetBoundFunction();
+ }
+ return func;
}
v8::MaybeLocal<v8::Map> privateMap(const char* name) {

Powered by Google App Engine
This is Rietveld 408576698