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

Side by Side Diff: src/inspector/v8-console.cc

Issue 2391323002: [inspector] command line api debug and monitor works with bound functions (Closed)
Patch Set: addressed comments 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/inspector/debugger/command-line-api-with-bound-function.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/inspector/v8-console.h" 5 #include "src/inspector/v8-console.h"
6 6
7 #include "src/base/macros.h" 7 #include "src/base/macros.h"
8 #include "src/inspector/injected-script.h" 8 #include "src/inspector/injected-script.h"
9 #include "src/inspector/inspected-context.h" 9 #include "src/inspector/inspected-context.h"
10 #include "src/inspector/string-util.h" 10 #include "src/inspector/string-util.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 v8::MaybeLocal<v8::Object> firstArgAsObject() { 133 v8::MaybeLocal<v8::Object> firstArgAsObject() {
134 if (m_info.Length() < 1 || !m_info[0]->IsObject()) 134 if (m_info.Length() < 1 || !m_info[0]->IsObject())
135 return v8::MaybeLocal<v8::Object>(); 135 return v8::MaybeLocal<v8::Object>();
136 return m_info[0].As<v8::Object>(); 136 return m_info[0].As<v8::Object>();
137 } 137 }
138 138
139 v8::MaybeLocal<v8::Function> firstArgAsFunction() { 139 v8::MaybeLocal<v8::Function> firstArgAsFunction() {
140 if (m_info.Length() < 1 || !m_info[0]->IsFunction()) 140 if (m_info.Length() < 1 || !m_info[0]->IsFunction())
141 return v8::MaybeLocal<v8::Function>(); 141 return v8::MaybeLocal<v8::Function>();
142 return m_info[0].As<v8::Function>(); 142 v8::Local<v8::Function> func = m_info[0].As<v8::Function>();
143 while (func->GetBoundFunction()->IsFunction())
144 func = func->GetBoundFunction().As<v8::Function>();
145 return func;
143 } 146 }
144 147
145 v8::MaybeLocal<v8::Map> privateMap(const char* name) { 148 v8::MaybeLocal<v8::Map> privateMap(const char* name) {
146 v8::Local<v8::Object> console = ensureConsole(); 149 v8::Local<v8::Object> console = ensureConsole();
147 v8::Local<v8::Private> privateKey = 150 v8::Local<v8::Private> privateKey =
148 v8::Private::ForApi(m_isolate, toV8StringInternalized(m_isolate, name)); 151 v8::Private::ForApi(m_isolate, toV8StringInternalized(m_isolate, name));
149 v8::Local<v8::Value> mapValue; 152 v8::Local<v8::Value> mapValue;
150 if (!console->GetPrivate(m_context, privateKey).ToLocal(&mapValue)) 153 if (!console->GetPrivate(m_context, privateKey).ToLocal(&mapValue))
151 return v8::MaybeLocal<v8::Map>(); 154 return v8::MaybeLocal<v8::Map>();
152 if (mapValue->IsUndefined()) { 155 if (mapValue->IsUndefined()) {
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 ->GetOwnPropertyDescriptor( 913 ->GetOwnPropertyDescriptor(
911 m_context, v8::Local<v8::String>::Cast(name)) 914 m_context, v8::Local<v8::String>::Cast(name))
912 .ToLocal(&descriptor); 915 .ToLocal(&descriptor);
913 DCHECK(success); 916 DCHECK(success);
914 USE(success); 917 USE(success);
915 } 918 }
916 } 919 }
917 } 920 }
918 921
919 } // namespace v8_inspector 922 } // namespace v8_inspector
OLDNEW
« no previous file with comments | « no previous file | test/inspector/debugger/command-line-api-with-bound-function.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698