|
1 | | -import { flagEnabled } from "../../shared"; |
| 1 | +import { config, flagEnabled } from "../../shared"; |
2 | 2 | import { SCRAMJETCLIENT, SCRAMJETCLIENTNAME } from "../../symbols"; |
3 | 3 | import { ProxyCtx, ScramjetClient } from "../client"; |
4 | 4 |
|
@@ -185,20 +185,16 @@ export const enabled = (client: ScramjetClient) => |
185 | 185 |
|
186 | 186 | export default function (client: ScramjetClient, self: Self) { |
187 | 187 | // every script will push a sourcemap |
188 | | - Object.defineProperty( |
189 | | - self, |
190 | | - globalThis.$scramjet.config.globals.pushsourcemapfn, |
191 | | - { |
192 | | - value: (buf: Array<number>, tag: string) => { |
193 | | - const before = performance.now(); |
194 | | - registerRewrites(buf, tag); |
195 | | - dbg.time(client.meta, before, `scramtag parse for ${tag}`); |
196 | | - }, |
197 | | - enumerable: false, |
198 | | - writable: false, |
199 | | - configurable: false, |
200 | | - } |
201 | | - ); |
| 188 | + Object.defineProperty(self, config.globals.pushsourcemapfn, { |
| 189 | + value: (buf: Array<number>, tag: string) => { |
| 190 | + const before = performance.now(); |
| 191 | + registerRewrites(buf, tag); |
| 192 | + dbg.time(client.meta, before, `scramtag parse for ${tag}`); |
| 193 | + }, |
| 194 | + enumerable: false, |
| 195 | + writable: false, |
| 196 | + configurable: false, |
| 197 | + }); |
202 | 198 |
|
203 | 199 | // when we rewrite javascript it will make function.toString leak internals |
204 | 200 | // this can lead to double rewrites which is bad |
|
0 commit comments