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

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

Issue 1653053002: Devtools: parse variables scopes and sourcemap them (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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/JavaScriptCallFrame.cpp
diff --git a/third_party/WebKit/Source/platform/v8_inspector/JavaScriptCallFrame.cpp b/third_party/WebKit/Source/platform/v8_inspector/JavaScriptCallFrame.cpp
index f5bfdd4a632601e699f7935234199949989b8f17..3a4068127f041b70057c8a51e7e662cd0a493ccf 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/JavaScriptCallFrame.cpp
+++ b/third_party/WebKit/Source/platform/v8_inspector/JavaScriptCallFrame.cpp
@@ -149,6 +149,24 @@ v8::Local<v8::String> JavaScriptCallFrame::scopeName(int scopeIndex) const
return scopeType->Get(scopeIndex)->ToString();
}
+v8::Local<v8::Value> JavaScriptCallFrame::scopeStartLocation(int scopeIndex) const
+{
+ return callScopeLocationFunction("scopeStartLocation", scopeIndex);
+}
+
+v8::Local<v8::Value> JavaScriptCallFrame::scopeEndLocation(int scopeIndex) const
+{
+ return callScopeLocationFunction("scopeEndLocation", scopeIndex);
+}
+
+v8::Local<v8::Value> JavaScriptCallFrame::callScopeLocationFunction(const char* name, int scopeIndex) const
+{
+ v8::Local<v8::Object> callFrame = v8::Local<v8::Object>::New(m_isolate, m_callFrame);
+ v8::Local<v8::Function> func = v8::Local<v8::Function>::Cast(callFrame->Get(toV8StringInternalized(m_isolate, name)));
+ v8::Local<v8::Array> locations = v8::Local<v8::Array>::Cast(m_client->callInternalFunction(func, callFrame, 0, 0).ToLocalChecked());
dgozman 2016/02/22 17:24:57 0, nullptr
sergeyv 2016/02/22 21:42:54 Done.
+ return locations->Get(scopeIndex);
+}
+
v8::Local<v8::Value> JavaScriptCallFrame::thisObject() const
{
return v8::Local<v8::Object>::New(m_isolate, m_callFrame)->Get(toV8StringInternalized(m_isolate, "thisObject"));

Powered by Google App Engine
This is Rietveld 408576698