Skip to content

Instantly share code, notes, and snippets.

@jasonLaster
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jasonLaster/b602891d475ce985dd9f to your computer and use it in GitHub Desktop.
Save jasonLaster/b602891d475ce985dd9f to your computer and use it in GitHub Desktop.
commit 0ba6485625bce590128413de4aab4835ee9a9102
Author: Jason Laster <jason.laster.11@gmail.com>
Date: Wed Mar 4 20:31:16 2015 -0500
Add arguments field
diff --git a/Source/core/inspector/InjectedScriptSource.js b/Source/core/inspector/InjectedScriptSource.js
index c8b224c..9173521 100644
--- a/Source/core/inspector/InjectedScriptSource.js
+++ b/Source/core/inspector/InjectedScriptSource.js
@@ -1531,6 +1531,8 @@ InjectedScript.CallFrameProxy = function(ordinal, callFrame, asyncOrdinal)
this.location = { scriptId: toString(callFrame.sourceID), lineNumber: callFrame.line, columnNumber: callFrame.column, __proto__: null };
this.scopeChain = this._wrapScopeChain(callFrame);
this.this = injectedScript._wrapObject(callFrame.thisObject, "backtrace");
+ this.arguments = injectedScript._wrapObject(callFrame.argumentsObject, "backtrace");
+
if (callFrame.isAtReturn)
this.returnValue = injectedScript._wrapObject(callFrame.returnValue, "backtrace");
}
diff --git a/Source/core/inspector/JavaScriptCallFrame.cpp b/Source/core/inspector/JavaScriptCallFrame.cpp
index 617e42a..74b778f 100644
--- a/Source/core/inspector/JavaScriptCallFrame.cpp
+++ b/Source/core/inspector/JavaScriptCallFrame.cpp
@@ -134,6 +134,11 @@ v8::Local<v8::Value> JavaScriptCallFrame::thisObject() const
return m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "thisObject"));
}
+v8::Local<v8::Value> JavaScriptCallFrame::argumentsObject() const
+{
+ return m_callFrame.newLocal(m_isolate)->Get(v8AtomicString(m_isolate, "argumentsObject (maybe...)"));
+}
+
String JavaScriptCallFrame::stepInPositions() const
{
return callV8FunctionReturnString("stepInPositions");
diff --git a/Source/core/inspector/JavaScriptCallFrame.h b/Source/core/inspector/JavaScriptCallFrame.h
index 727a6d7..0284613 100644
--- a/Source/core/inspector/JavaScriptCallFrame.h
+++ b/Source/core/inspector/JavaScriptCallFrame.h
@@ -64,6 +64,7 @@ public:
v8::Local<v8::Value> scopeChain() const;
int scopeType(int scopeIndex) const;
v8::Local<v8::Value> thisObject() const;
+ v8::Local<v8::Value> argumentsObject() const;
String stepInPositions() const;
bool isAtReturn() const;
v8::Local<v8::Value> returnValue() const;
diff --git a/Source/core/inspector/JavaScriptCallFrame.idl b/Source/core/inspector/JavaScriptCallFrame.idl
index b17fd29..3091e50 100644
--- a/Source/core/inspector/JavaScriptCallFrame.idl
+++ b/Source/core/inspector/JavaScriptCallFrame.idl
@@ -49,6 +49,7 @@
[Custom=Getter] readonly attribute object[] scopeChain;
[Custom] unsigned short scopeType(long scopeIndex);
[Custom=Getter] readonly attribute object thisObject;
+ [Custom=Getter] readonly attribute object argumentsObject;
readonly attribute DOMString stepInPositions;
readonly attribute DOMString functionName;
[Custom=Getter] readonly attribute DOMString type;
diff --git a/Source/devtools/front_end/sdk/DebuggerModel.js b/Source/devtools/front_end/sdk/DebuggerModel.js
index 1ce6ec5..d4eee86 100644
--- a/Source/devtools/front_end/sdk/DebuggerModel.js
+++ b/Source/devtools/front_end/sdk/DebuggerModel.js
@@ -1086,6 +1086,14 @@ WebInspector.DebuggerModel.CallFrame.prototype = {
},
/**
+ * @return {?WebInspector.RemoteObject}
+ */
+ argumentsObject: function()
+ {
+ return this._payload.this ? this.target().runtimeModel.createRemoteObject(this._payload.arguments) : null;
+ },
+
+ /**
* @return {?WebInspector.RemoteObject}
*/
returnValue: function()
diff --git a/Source/devtools/front_end/sources/ScopeChainSidebarPane.js b/Source/devtools/front_end/sources/ScopeChainSidebarPane.js
index 3f15ed5..be89d58 100644
--- a/Source/devtools/front_end/sources/ScopeChainSidebarPane.js
+++ b/Source/devtools/front_end/sources/ScopeChainSidebarPane.js
@@ -83,6 +83,11 @@ WebInspector.ScopeChainSidebarPane.prototype = {
var thisObject = callFrame.thisObject();
if (thisObject)
extraProperties.push(new WebInspector.RemoteObjectProperty("this", thisObject));
+
+ var argumentsObject = callFrame.argumentsObject();
+ if (argumentsObject)
+ extraProperties.push(new WebInspector.RemoteObjectProperty("arguments", argumentsObject));
+
if (i == 0) {
var details = callFrame.target().debuggerModel.debuggerPausedDetails();
if (!callFrame.isAsync()) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment