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

Unified Diff: third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js

Issue 1838683002: [DevTools] Debugger::currentCallFrames returns array instead linked list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wrap-with-corrrect-injected-script
Patch Set: Created 4 years, 9 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/DebuggerScript.js
diff --git a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
index c4992db3f3e740765f6115c99a5f330998a92fc1..cb254827e76943e01dbf0d3a386511d8e6c22c63 100644
--- a/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
+++ b/third_party/WebKit/Source/platform/v8_inspector/DebuggerScript.js
@@ -274,41 +274,15 @@ DebuggerScript.setPauseOnExceptionsState = function(newState)
/**
* @param {!ExecutionState} execState
- * @return {number}
- */
-DebuggerScript.frameCount = function(execState)
-{
- return execState.frameCount();
-}
-
-/**
- * @param {!ExecutionState} execState
- * @return {!JavaScriptCallFrame|undefined}
- */
-DebuggerScript.currentCallFrame = function(execState)
-{
- var frameCount = execState.frameCount();
- var topFrame = undefined;
- for (var i = frameCount - 1; i >= 0; i--) {
- var frameMirror = execState.frame(i);
- topFrame = DebuggerScript._frameMirrorToJSCallFrame(frameMirror, topFrame);
- }
- return topFrame;
-}
-
-/**
- * @param {!ExecutionState} execState
- * @param {number} index
- * @return {!JavaScriptCallFrame|undefined}
+ * @param {number} limit
+ * @return {!Array<!JavaScriptCallFrame>}
*/
-DebuggerScript.currentCallFrameByIndex = function(execState, index)
+DebuggerScript.currentCallFrames = function(execState, limit)
{
- if (index < 0)
- return undefined;
- var frameCount = execState.frameCount();
- if (index >= frameCount)
- return undefined;
- return DebuggerScript._frameMirrorToJSCallFrame(execState.frame(index), undefined);
+ var frames = [];
+ for (var i = 0; i < execState.frameCount() && (!limit || i < limit); ++i)
+ frames.push(DebuggerScript._frameMirrorToJSCallFrame(execState.frame(i)));
+ return frames;
}
/**
@@ -427,10 +401,9 @@ DebuggerScript.getBreakpointNumbers = function(eventData)
// asynchronous call stacks. Thus, when possible, initialize the data lazily.
/**
* @param {!FrameMirror} frameMirror
- * @param {!JavaScriptCallFrame|undefined} callerFrame
* @return {!JavaScriptCallFrame}
*/
-DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
+DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror)
{
// Stuff that can not be initialized lazily (i.e. valid while paused with a valid break_id).
// The frameMirror and scopeMirror can be accessed only while paused on the debugger.
@@ -664,7 +637,6 @@ DebuggerScript._frameMirrorToJSCallFrame = function(frameMirror, callerFrame)
"column": column,
"thisObject": thisObject,
"evaluate": evaluate,
- "caller": callerFrame,
"restart": restart,
"setVariableValue": setVariableValue,
"isAtReturn": isAtReturn,

Powered by Google App Engine
This is Rietveld 408576698