Skip to content

fix: also use script ID bps if there is a different embeddername #1846

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/adapter/breakpoints/breakpointBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,11 @@ export abstract class Breakpoint {
// prefer to set on script URL for non-anonymous scripts, since url breakpoints
// will survive and be hit on reload. But don't set if the script has
// a source URL, since V8 doesn't resolve these
if (script.url && !script.hasSourceURL) {
if (
script.url &&
!script.hasSourceURL &&
(!script.embedderName || script.embedderName === script.url)
) {
return this._setByUrl(thread, script.url, lineColumn);
} else {
return this._setByScriptId(thread, script, lineColumn);
Expand Down
1 change: 1 addition & 0 deletions src/adapter/source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ export interface IWasmLocationProvider extends ISourceLocationProvider {
export interface ISourceScript {
executionContextId: Cdp.Runtime.ExecutionContextId;
scriptId: Cdp.Runtime.ScriptId;
embedderName?: string;
hasSourceURL: boolean;
url: string;
}
Expand Down
3 changes: 3 additions & 0 deletions src/adapter/threads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1522,6 +1522,7 @@ export class Thread implements IVariableStoreLocationProvider {
prevSource.addScript({
scriptId: event.scriptId,
url: event.url,
embedderName: event.embedderName,
hasSourceURL: !!event.hasSourceURL,
executionContextId: event.executionContextId,
});
Expand Down Expand Up @@ -1573,6 +1574,7 @@ export class Thread implements IVariableStoreLocationProvider {
source.addScript({
scriptId: event.scriptId,
url: event.url,
embedderName: event.embedderName,
hasSourceURL: !!event.hasSourceURL,
executionContextId: event.executionContextId,
});
Expand All @@ -1583,6 +1585,7 @@ export class Thread implements IVariableStoreLocationProvider {
const script: Script = {
url: event.url,
hasSourceURL: !!event.hasSourceURL,
embedderName: event.embedderName,
scriptId: event.scriptId,
executionContextId: event.executionContextId,
source: createSource(),
Expand Down