diff --git a/front_end/core/sdk/DebuggerModel.ts b/front_end/core/sdk/DebuggerModel.ts index a749e3b86d..cc1d79b946 100644 --- a/front_end/core/sdk/DebuggerModel.ts +++ b/front_end/core/sdk/DebuggerModel.ts @@ -471,17 +471,11 @@ export class DebuggerModel extends SDKModel { } async setBreakpointInAnonymousScript( - scriptId: Protocol.Runtime.ScriptId, scriptHash: string, lineNumber: number, columnNumber?: number, - condition?: string): Promise { + scriptHash: string, lineNumber: number, columnNumber?: number, condition?: string): Promise { const response = await this.agent.invoke_setBreakpointByUrl( {lineNumber: lineNumber, scriptHash: scriptHash, columnNumber: columnNumber, condition: condition}); - const error = response.getError(); - if (error) { - // Old V8 backend doesn't support scriptHash argument. - if (error !== 'Either url or urlRegex must be specified.') { - return {locations: [], breakpointId: null}; - } - return this.setBreakpointBySourceId(scriptId, lineNumber, columnNumber, condition); + if (response.getError()) { + return {locations: [], breakpointId: null}; } let locations: Location[] = []; if (response.locations) { @@ -490,22 +484,6 @@ export class DebuggerModel extends SDKModel { return {locations, breakpointId: response.breakpointId}; } - private async setBreakpointBySourceId( - scriptId: Protocol.Runtime.ScriptId, lineNumber: number, columnNumber?: number, - condition?: string): Promise { - // This method is required for backward compatibility with V8 before 6.3.275. - const response = await this.agent.invoke_setBreakpoint( - {location: {scriptId: scriptId, lineNumber: lineNumber, columnNumber: columnNumber}, condition: condition}); - if (response.getError()) { - return {breakpointId: null, locations: []}; - } - let actualLocation: Location[] = []; - if (response.actualLocation) { - actualLocation = [Location.fromPayload(this, response.actualLocation)]; - } - return {locations: actualLocation, breakpointId: response.breakpointId}; - } - async removeBreakpoint(breakpointId: Protocol.Debugger.BreakpointId): Promise { const response = await this.agent.invoke_removeBreakpoint({breakpointId}); if (response.getError()) { diff --git a/front_end/models/bindings/BreakpointManager.ts b/front_end/models/bindings/BreakpointManager.ts index 61b7b7184a..a34b15c712 100644 --- a/front_end/models/bindings/BreakpointManager.ts +++ b/front_end/models/bindings/BreakpointManager.ts @@ -793,7 +793,6 @@ export class ModelBreakpoint { const script = loc.script() as SDK.Script.Script; return { url: script.sourceURL, - scriptId: script.scriptId, scriptHash: script.hash, lineNumber: loc.lineNumber, columnNumber: loc.columnNumber, @@ -811,7 +810,6 @@ export class ModelBreakpoint { // really resolved. const position = { url: this.#breakpoint.url(), - scriptId: '' as Protocol.Runtime.ScriptId, scriptHash: '', lineNumber, columnNumber, @@ -894,7 +892,7 @@ export class ModelBreakpoint { return this.#debuggerModel.setBreakpointByURL(pos.url, pos.lineNumber, pos.columnNumber, condition); } return this.#debuggerModel.setBreakpointInAnonymousScript( - pos.scriptId, pos.scriptHash as string, pos.lineNumber, pos.columnNumber, condition); + pos.scriptHash as string, pos.lineNumber, pos.columnNumber, condition); })); const breakpointIds: Protocol.Debugger.BreakpointId[] = []; let locations: SDK.DebuggerModel.Location[] = []; @@ -983,7 +981,6 @@ export class ModelBreakpoint { interface Position { url: Platform.DevToolsPath.UrlString; - scriptId: Protocol.Runtime.ScriptId; scriptHash: string; lineNumber: number; columnNumber?: number; @@ -1015,9 +1012,6 @@ export namespace Breakpoint { if (positionA.url !== positionB.url) { return false; } - if (positionA.scriptId !== positionB.scriptId) { - return false; - } if (positionA.scriptHash !== positionB.scriptHash) { return false; } diff --git a/test/unittests/front_end/models/bindings/BreakpointManager_test.ts b/test/unittests/front_end/models/bindings/BreakpointManager_test.ts index f3164b77af..1c8ba836ed 100644 --- a/test/unittests/front_end/models/bindings/BreakpointManager_test.ts +++ b/test/unittests/front_end/models/bindings/BreakpointManager_test.ts @@ -158,7 +158,7 @@ describeWithRealConnection('BreakpointManager', () => { await breakpointManager.restoreBreakpointsForScript(script); assertNotNullOrUndefined(modelBreakpoint.currentState); assert.lengthOf(modelBreakpoint.currentState.positions, 1); - assert.strictEqual(modelBreakpoint.currentState.positions[0].scriptId, SCRIPT_ID); + assert.strictEqual(modelBreakpoint.currentState.positions[0].url, URL); // Clean up. await breakpoint.remove(false); @@ -228,7 +228,7 @@ describeWithRealConnection('BreakpointManager', () => { await breakpointManager.restoreBreakpointsForScript(script); assertNotNullOrUndefined(modelBreakpoint.currentState); assert.lengthOf(modelBreakpoint.currentState.positions, 1); - assert.strictEqual(modelBreakpoint.currentState.positions[0].scriptId, SCRIPT_ID); + assert.strictEqual(modelBreakpoint.currentState.positions[0].url, URL); // Clean up. await breakpoint.remove(false);