(script: Script)
| 489 | const frameIdSymbol = Symbol('frameid'); |
| 490 | |
| 491 | function frameIdForScript(script: Script): Protocol.Page.FrameId|null { |
| 492 | const executionContext = script.executionContext(); |
| 493 | if (executionContext) { |
| 494 | return executionContext.frameId || null; |
| 495 | } |
| 496 | // This is to overcome compilation cache which doesn't get reset. |
| 497 | const resourceTreeModel = script.debuggerModel.target().model(ResourceTreeModel); |
| 498 | if (!resourceTreeModel?.mainFrame) { |
| 499 | return null; |
| 500 | } |
| 501 | return resourceTreeModel.mainFrame.id; |
| 502 | } |
| 503 | |
| 504 | export const sourceURLRegex = /^[\x20\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/; |
| 505 |
no test coverage detected