mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-27 08:25:20 +08:00
[liveedit] Remove obsolete stack trace result parameters
The CL https://crrev.com/c/3691850 deprecated result parameters of Debugger#setScriptSource and changed the CDP method to always leave them out. This means we no longer have to handle them on the frontend side. Moreover, as live edit can no longer change functions that are on the stack (for now), we don't have to explicitly "step in" to trigger frame restarting. The new version will handle that automatically for us in the backend. R=kimanh@chromium.org Bug: 1334484 Change-Id: I7104a77ea36cdb7eadcbbe022104a78d9eae07f0 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3707818 Reviewed-by: Kim-Anh Tran <kimanh@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org>
This commit is contained in:
committed by
Devtools-frontend LUCI CQ
parent
df43ecd0fb
commit
017eeef5e0
@@ -585,26 +585,7 @@ export class DebuggerModel extends SDKModel<EventTypes> {
|
||||
callback: (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined) => void): void {
|
||||
const script = this.#scriptsInternal.get(scriptId);
|
||||
if (script) {
|
||||
void script.editSource(newSource, this.didEditScriptSource.bind(this, scriptId, newSource, callback));
|
||||
}
|
||||
}
|
||||
|
||||
private didEditScriptSource(
|
||||
scriptId: string, newSource: string,
|
||||
callback: (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined) => void, error: string|null,
|
||||
exceptionDetails?: Protocol.Runtime.ExceptionDetails, callFrames?: Protocol.Debugger.CallFrame[],
|
||||
asyncStackTrace?: Protocol.Runtime.StackTrace, asyncStackTraceId?: Protocol.Runtime.StackTraceId,
|
||||
needsStepIn?: boolean): void {
|
||||
callback(error, exceptionDetails);
|
||||
if (needsStepIn) {
|
||||
void this.stepInto();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!error && callFrames && callFrames.length && this.#debuggerPausedDetailsInternal) {
|
||||
void this.pausedScript(
|
||||
callFrames, this.#debuggerPausedDetailsInternal.reason, this.#debuggerPausedDetailsInternal.auxData,
|
||||
this.#debuggerPausedDetailsInternal.breakpointIds, asyncStackTrace, asyncStackTraceId);
|
||||
void script.editSource(newSource, callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -259,10 +259,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
||||
|
||||
async editSource(
|
||||
newSource: string,
|
||||
callback:
|
||||
(error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined,
|
||||
arg2?: Array<Protocol.Debugger.CallFrame>|undefined, arg3?: Protocol.Runtime.StackTrace|undefined,
|
||||
arg4?: Protocol.Runtime.StackTraceId|undefined, arg5?: boolean|undefined) => void): Promise<void> {
|
||||
callback: (error: string|null, arg1?: Protocol.Runtime.ExceptionDetails|undefined) => void): Promise<void> {
|
||||
newSource = Script.trimSourceURLComment(newSource);
|
||||
// We append correct #sourceURL to script for consistency only. It's not actually needed for things to work correctly.
|
||||
newSource = this.appendSourceURLCommentIfNeeded(newSource);
|
||||
@@ -284,10 +281,7 @@ export class Script implements TextUtils.ContentProvider.ContentProvider, FrameA
|
||||
this.#contentPromise = Promise.resolve({content: newSource, isEncoded: false});
|
||||
}
|
||||
|
||||
const needsStepIn = Boolean(response.stackChanged);
|
||||
callback(
|
||||
response.getError() || null, response.exceptionDetails, response.callFrames, response.asyncStackTrace,
|
||||
response.asyncStackTraceId, needsStepIn);
|
||||
callback(response.getError() || null, response.exceptionDetails);
|
||||
}
|
||||
|
||||
rawLocation(lineNumber: number, columnNumber: number): Location|null {
|
||||
|
||||
Reference in New Issue
Block a user