* Sets the breakpoint in the provided thread and marks the "enabled" bit.
(thread: Thread)
| 154 | * Sets the breakpoint in the provided thread and marks the "enabled" bit. |
| 155 | */ |
| 156 | public async enable(thread: Thread): Promise<void> { |
| 157 | if (this.isEnabled) { |
| 158 | return; |
| 159 | } |
| 160 | |
| 161 | this.isEnabled = true; |
| 162 | const promises: Promise<void>[] = [this._setPredicted(thread)]; |
| 163 | const source = this._manager._sourceContainer.source(this.source); |
| 164 | if (!source || !(source instanceof SourceFromMap)) { |
| 165 | promises.push( |
| 166 | // For breakpoints set before launch, we don't know whether they are in a compiled or |
| 167 | // a source map source. To make them work, we always set by url to not miss compiled. |
| 168 | // Additionally, if we have two sources with the same url, but different path (or no path), |
| 169 | // this will make breakpoint work in all of them. |
| 170 | this._setByPath(thread, this.originalPosition), |
| 171 | ); |
| 172 | } |
| 173 | |
| 174 | if (source) { |
| 175 | const uiLocations = this._manager._sourceContainer.currentSiblingUiLocations({ |
| 176 | lineNumber: this.originalPosition.lineNumber, |
| 177 | columnNumber: this.originalPosition.columnNumber, |
| 178 | source, |
| 179 | }); |
| 180 | promises.push(...uiLocations.map(uiLocation => this._setByUiLocation(thread, uiLocation))); |
| 181 | } |
| 182 | |
| 183 | await Promise.all(promises); |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Updates the breakpoint's locations in the UI. Should be called whenever |
nothing calls this directly
no test coverage detected