(current: HTMLScriptElement, src: string)
| 15 | } |
| 16 | |
| 17 | function replaceScript(current: HTMLScriptElement, src: string): void { |
| 18 | const script = document.createElement('script') |
| 19 | script.src = src |
| 20 | script.defer = true |
| 21 | current.replaceWith(script) |
| 22 | } |
| 23 | |
| 24 | function withCurrentScript(current: HTMLScriptElement, run: () => void): void { |
| 25 | const descriptor = Object.getOwnPropertyDescriptor(Document.prototype, 'currentScript') |
no test coverage detected