Source code
Revision control
Copy as Markdown
Other Tools
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
import { createLocation } from "../../../utils/location";
export function mockPendingBreakpoint(overrides = {}) {
const { sourceUrl, line, column, condition, disabled, hidden } = overrides;
return {
location: {
line: line || 5,
column: column || 1,
},
generatedLocation: {
line: line || 5,
column: column || 1,
},
astLocation: {
name: undefined,
offset: {
line: line || 5,
},
index: 0,
},
options: {
condition: condition || null,
hidden: hidden || false,
},
disabled: disabled || false,
};
}
export function generateBreakpoint(filename, line = 5, column = 0) {
return {
id: "breakpoint",
originalText: "",
text: "",
location: createLocation({
},
sourceId: filename,
line,
column,
}),
generatedLocation: createLocation({
},
sourceId: filename,
line,
column,
}),
astLocation: undefined,
options: {
condition: "",
hidden: false,
},
disabled: false,
};
}