| 849 | } |
| 850 | |
| 851 | function clearBreakpoint(url, line) { |
| 852 | const breakpoint = ArrayPrototypeFind(knownBreakpoints, ({ location }) => { |
| 853 | if (!location) return false; |
| 854 | const script = knownScripts[location.scriptId]; |
| 855 | if (!script) return false; |
| 856 | return ( |
| 857 | StringPrototypeIncludes(script.url, url) && |
| 858 | (location.lineNumber + 1) === line |
| 859 | ); |
| 860 | }); |
| 861 | if (!breakpoint) { |
| 862 | print(`Could not find breakpoint at ${url}:${line}`); |
| 863 | return PromiseResolve(); |
| 864 | } |
| 865 | return PromisePrototypeThen( |
| 866 | Debugger.removeBreakpoint({ breakpointId: breakpoint.breakpointId }), |
| 867 | () => { |
| 868 | const idx = ArrayPrototypeIndexOf(knownBreakpoints, breakpoint); |
| 869 | ArrayPrototypeSplice(knownBreakpoints, idx, 1); |
| 870 | }); |
| 871 | } |
| 872 | |
| 873 | function restoreBreakpoints() { |
| 874 | const lastBreakpoints = ArrayPrototypeSplice(knownBreakpoints, 0); |