@sentry/wasm 10.24.0 → 10.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { patchWebAssembly } from './patchWebAssembly';\nimport { getImage, getImages } from './registry';\n\nconst INTEGRATION_NAME = 'Wasm';\n\nconst _wasmIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n patchWebAssembly();\n },\n processEvent(event: Event): Event {\n let hasAtLeastOneWasmFrameWithImage = false;\n\n if (event.exception?.values) {\n event.exception.values.forEach(exception => {\n if (exception.stacktrace?.frames) {\n hasAtLeastOneWasmFrameWithImage =\n hasAtLeastOneWasmFrameWithImage || patchFrames(exception.stacktrace.frames);\n }\n });\n }\n\n if (hasAtLeastOneWasmFrameWithImage) {\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = [...(event.debug_meta.images || []), ...getImages()];\n }\n\n return event;\n },\n };\n}) satisfies IntegrationFn;\n\nexport const wasmIntegration = defineIntegration(_wasmIntegration);\n\nconst PARSER_REGEX = /^(.*?):wasm-function\\[\\d+\\]:(0x[a-fA-F0-9]+)$/;\n\n/**\n * Patches a list of stackframes with wasm data needed for server-side symbolication\n * if applicable. Returns true if the provided list of stack frames had at least one\n * matching registered image.\n */\n// Only exported for tests\nexport function patchFrames(frames: Array<StackFrame>): boolean {\n let hasAtLeastOneWasmFrameWithImage = false;\n frames.forEach(frame => {\n if (!frame.filename) {\n return;\n }\n\n const split = frame.filename.split('(');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const lastSplit = split[split.length - 1]!;\n\n // Let's call this first match a \"messy match\".\n // The browser stacktrace parser spits out frames that have a filename like this: \"int) const (http://localhost:8001/main.wasm:wasm-function[190]:0x5aeb\"\n // It contains some leftover mess because wasm stack frames are more complicated than our parser can handle: \"at MyClass::bar(int) const (http://localhost:8001/main.wasm:wasm-function[190]:0x5aeb)\"\n // This first match simply tries to mitigate the mess up until the first opening parens.\n // The match afterwards is a sensible fallback\n let match = lastSplit.match(PARSER_REGEX) as null | [string, string, string];\n\n if (!match) {\n match = frame.filename.match(PARSER_REGEX) as null | [string, string, string];\n }\n\n if (match) {\n const index = getImage(match[1]);\n frame.instruction_addr = match[2];\n frame.filename = match[1];\n frame.platform = 'native';\n\n if (index >= 0) {\n frame.addr_mode = `rel:${index}`;\n hasAtLeastOneWasmFrameWithImage = true;\n }\n }\n });\n\n return hasAtLeastOneWasmFrameWithImage;\n}\n"],"names":["patchWebAssembly","getImages","defineIntegration","getImage"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,MAAM;;AAE/B,MAAM,gBAAA,IAAoB,MAAM;AAChC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAMA,iCAAgB,EAAE;AACxB,KAAK;AACL,IAAI,YAAY,CAAC,KAAK,EAAgB;AACtC,MAAM,IAAI,+BAAA,GAAkC,KAAK;;AAEjD,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE;AACnC,QAAQ,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,SAAA,IAAa;AACpD,UAAU,IAAI,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE;AAC5C,YAAY,+BAAA;AACZ,cAAc,+BAAA,IAAmC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;AACzF;AACA,SAAS,CAAC;AACV;;AAEA,MAAM,IAAI,+BAA+B,EAAE;AAC3C,QAAQ,KAAK,CAAC,UAAA,GAAa,KAAK,CAAC,UAAA,IAAc,EAAE;AACjD,QAAQ,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,MAAA,IAAU,EAAE,CAA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OAAA,+BAAA;AACA;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { patchWebAssembly } from './patchWebAssembly';\nimport { getImage, getImages } from './registry';\n\nconst INTEGRATION_NAME = 'Wasm';\n\nconst _wasmIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n patchWebAssembly();\n },\n processEvent(event: Event): Event {\n let hasAtLeastOneWasmFrameWithImage = false;\n\n if (event.exception?.values) {\n event.exception.values.forEach(exception => {\n if (exception.stacktrace?.frames) {\n hasAtLeastOneWasmFrameWithImage =\n hasAtLeastOneWasmFrameWithImage || patchFrames(exception.stacktrace.frames);\n }\n });\n }\n\n if (hasAtLeastOneWasmFrameWithImage) {\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = [...(event.debug_meta.images || []), ...getImages()];\n }\n\n return event;\n },\n };\n}) satisfies IntegrationFn;\n\nexport const wasmIntegration = defineIntegration(_wasmIntegration);\n\nconst PARSER_REGEX = /^(.*?):wasm-function\\[\\d+\\]:(0x[a-fA-F0-9]+)$/;\n\n/**\n * Patches a list of stackframes with wasm data needed for server-side symbolication\n * if applicable. Returns true if the provided list of stack frames had at least one\n * matching registered image.\n */\n// Only exported for tests\nexport function patchFrames(frames: Array<StackFrame>): boolean {\n let hasAtLeastOneWasmFrameWithImage = false;\n frames.forEach(frame => {\n if (!frame.filename) {\n return;\n }\n\n const split = frame.filename.split('(');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const lastSplit = split[split.length - 1]!;\n\n // Let's call this first match a \"messy match\".\n // The browser stacktrace parser spits out frames that have a filename like this: \"int) const (http://localhost:8001/main.wasm:wasm-function[190]:0x5aeb\"\n // It contains some leftover mess because wasm stack frames are more complicated than our parser can handle: \"at MyClass::bar(int) const (http://localhost:8001/main.wasm:wasm-function[190]:0x5aeb)\"\n // This first match simply tries to mitigate the mess up until the first opening parens.\n // The match afterwards is a sensible fallback\n let match = lastSplit.match(PARSER_REGEX) as null | [string, string, string];\n\n if (!match) {\n match = frame.filename.match(PARSER_REGEX) as null | [string, string, string];\n }\n\n if (match) {\n const index = getImage(match[1]);\n frame.instruction_addr = match[2];\n frame.filename = match[1];\n frame.platform = 'native';\n\n if (index >= 0) {\n frame.addr_mode = `rel:${index}`;\n hasAtLeastOneWasmFrameWithImage = true;\n }\n }\n });\n\n return hasAtLeastOneWasmFrameWithImage;\n}\n"],"names":["patchWebAssembly","getImages","defineIntegration","getImage"],"mappings":";;;;;;AAKA,MAAM,gBAAA,GAAmB,MAAM;;AAE/B,MAAM,gBAAA,IAAoB,MAAM;AAChC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAMA,iCAAgB,EAAE;AACxB,IAAI,CAAC;AACL,IAAI,YAAY,CAAC,KAAK,EAAgB;AACtC,MAAM,IAAI,+BAAA,GAAkC,KAAK;;AAEjD,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE;AACnC,QAAQ,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,SAAA,IAAa;AACpD,UAAU,IAAI,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE;AAC5C,YAAY,+BAAA;AACZ,cAAc,+BAAA,IAAmC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;AACzF,UAAU;AACV,QAAQ,CAAC,CAAC;AACV,MAAM;;AAEN,MAAM,IAAI,+BAA+B,EAAE;AAC3C,QAAQ,KAAK,CAAC,UAAA,GAAa,KAAK,CAAC,UAAA,IAAc,EAAE;AACjD,QAAQ,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,MAAA,IAAU,EAAE,CAAC,EAAE,GAAGC,kBAAS,EAAE,CAAC;AACtF,MAAM;;AAEN,MAAM,OAAO,KAAK;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@ -1 +1 @@
1
- {"version":3,"file":"patchWebAssembly.js","sources":["../../../src/patchWebAssembly.ts"],"sourcesContent":["import { registerModule } from './registry';\n\n/**\n * Patches the web assembly runtime.\n */\nexport function patchWebAssembly(): void {\n if ('instantiateStreaming' in WebAssembly) {\n const origInstantiateStreaming = WebAssembly.instantiateStreaming;\n WebAssembly.instantiateStreaming = function instantiateStreaming(\n response: Response | PromiseLike<Response>,\n importObject: WebAssembly.Imports,\n ): Promise<WebAssembly.Module> {\n return Promise.resolve(response).then(response => {\n return origInstantiateStreaming(response, importObject).then(rv => {\n if (response.url) {\n registerModule(rv.module, response.url);\n }\n return rv;\n });\n });\n } as typeof WebAssembly.instantiateStreaming;\n }\n\n if ('compileStreaming' in WebAssembly) {\n const origCompileStreaming = WebAssembly.compileStreaming;\n WebAssembly.compileStreaming = function compileStreaming(\n source: Response | Promise<Response>,\n ): Promise<WebAssembly.Module> {\n return Promise.resolve(source).then(response => {\n return origCompileStreaming(response).then(module => {\n if (response.url) {\n registerModule(module, response.url);\n }\n return module;\n });\n });\n } as typeof WebAssembly.compileStreaming;\n }\n}\n"],"names":["registerModule"],"mappings":";;;;AAEA;AACA;AACA;AACO,SAAS,gBAAgB,GAAS;AACzC,EAAE,IAAI,sBAAA,IAA0B,WAAW,EAAE;AAC7C,IAAI,MAAM,wBAAA,GAA2B,WAAW,CAAC,oBAAoB;AACrE,IAAI,WAAW,CAAC,oBAAA,GAAuB,SAAS,oBAAoB;AACpE,MAAM,QAAQ;AACd,MAAM,YAAY;AAClB,MAAmC;AACnC,MAAM,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAA,IAAY;AACxD,QAAQ,OAAO,wBAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,EAAA,IAAM;AAC3E,UAAU,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC5B,YAAYA,uBAAc,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;AACnD;AACA,UAAU,OAAO,EAAE;AACnB,SAAS,CAAC;AACV,OAAO,CAAC;AACR,KAAI;AACJ;;AAEA,EAAE,IAAI,kBAAA,IAAsB,WAAW,EAAE;AACzC,IAAI,MAAM,oBAAA,GAAuB,WAAW,CAAC,gBAAgB;AAC7D,IAAI,WAAW,CAAC,gBAAA,GAAmB,SAAS,gBAAgB;AAC5D,MAAM,MAAM;AACZ,MAAmC;AACnC,MAAM,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAA,IAAY;AACtD,QAAQ,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAA,IAAU;AAC7D,UAAU,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC5B,YAAYA,uBAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;AAChD;AACA,UAAU,OAAO,MAAM;AACvB,SAAS,CAAC;AACV,OAAO,CAAC;AACR,KAAI;AACJ;AACA;;;;"}
1
+ {"version":3,"file":"patchWebAssembly.js","sources":["../../../src/patchWebAssembly.ts"],"sourcesContent":["import { registerModule } from './registry';\n\n/**\n * Patches the web assembly runtime.\n */\nexport function patchWebAssembly(): void {\n if ('instantiateStreaming' in WebAssembly) {\n const origInstantiateStreaming = WebAssembly.instantiateStreaming;\n WebAssembly.instantiateStreaming = function instantiateStreaming(\n response: Response | PromiseLike<Response>,\n importObject: WebAssembly.Imports,\n ): Promise<WebAssembly.Module> {\n return Promise.resolve(response).then(response => {\n return origInstantiateStreaming(response, importObject).then(rv => {\n if (response.url) {\n registerModule(rv.module, response.url);\n }\n return rv;\n });\n });\n } as typeof WebAssembly.instantiateStreaming;\n }\n\n if ('compileStreaming' in WebAssembly) {\n const origCompileStreaming = WebAssembly.compileStreaming;\n WebAssembly.compileStreaming = function compileStreaming(\n source: Response | Promise<Response>,\n ): Promise<WebAssembly.Module> {\n return Promise.resolve(source).then(response => {\n return origCompileStreaming(response).then(module => {\n if (response.url) {\n registerModule(module, response.url);\n }\n return module;\n });\n });\n } as typeof WebAssembly.compileStreaming;\n }\n}\n"],"names":["registerModule"],"mappings":";;;;AAEA;AACA;AACA;AACO,SAAS,gBAAgB,GAAS;AACzC,EAAE,IAAI,sBAAA,IAA0B,WAAW,EAAE;AAC7C,IAAI,MAAM,wBAAA,GAA2B,WAAW,CAAC,oBAAoB;AACrE,IAAI,WAAW,CAAC,oBAAA,GAAuB,SAAS,oBAAoB;AACpE,MAAM,QAAQ;AACd,MAAM,YAAY;AAClB,MAAmC;AACnC,MAAM,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAA,IAAY;AACxD,QAAQ,OAAO,wBAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,EAAA,IAAM;AAC3E,UAAU,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC5B,YAAYA,uBAAc,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;AACnD,UAAU;AACV,UAAU,OAAO,EAAE;AACnB,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC,CAAC;AACR,IAAI,CAAA;AACJ,EAAE;;AAEF,EAAE,IAAI,kBAAA,IAAsB,WAAW,EAAE;AACzC,IAAI,MAAM,oBAAA,GAAuB,WAAW,CAAC,gBAAgB;AAC7D,IAAI,WAAW,CAAC,gBAAA,GAAmB,SAAS,gBAAgB;AAC5D,MAAM,MAAM;AACZ,MAAmC;AACnC,MAAM,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAA,IAAY;AACtD,QAAQ,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAA,IAAU;AAC7D,UAAU,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC5B,YAAYA,uBAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;AAChD,UAAU;AACV,UAAU,OAAO,MAAM;AACvB,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC,CAAC;AACR,IAAI,CAAA;AACJ,EAAE;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sources":["../../../src/registry.ts"],"sourcesContent":["import type { DebugImage } from '@sentry/core';\n\nexport const IMAGES: Array<DebugImage> = [];\n\nexport interface ModuleInfo {\n buildId: string | null;\n debugFile: string | null;\n}\n\n/**\n * Returns the extracted meta information from a web assembly module that\n * Sentry uses to identify debug images.\n *\n * @param module\n */\nexport function getModuleInfo(module: WebAssembly.Module): ModuleInfo {\n const buildIds = WebAssembly.Module.customSections(module, 'build_id');\n let buildId = null;\n let debugFile = null;\n\n const buildId0 = buildIds[0];\n if (buildId0) {\n const firstBuildId = new Uint8Array(buildId0);\n buildId = Array.from(firstBuildId).reduce((acc, x) => {\n return acc + x.toString(16).padStart(2, '0');\n }, '');\n }\n\n const externalDebugInfo = WebAssembly.Module.customSections(module, 'external_debug_info');\n const externalDebugInfo0 = externalDebugInfo[0];\n if (externalDebugInfo0) {\n const firstExternalDebugInfo = new Uint8Array(externalDebugInfo0);\n const decoder = new TextDecoder('utf-8');\n debugFile = decoder.decode(firstExternalDebugInfo);\n }\n\n return { buildId, debugFile };\n}\n\n/**\n * Records a module\n */\nexport function registerModule(module: WebAssembly.Module, url: string): void {\n const { buildId, debugFile } = getModuleInfo(module);\n if (buildId) {\n const oldIdx = getImage(url);\n if (oldIdx >= 0) {\n IMAGES.splice(oldIdx, 1);\n }\n\n let debugFileUrl = null;\n if (debugFile) {\n try {\n debugFileUrl = new URL(debugFile, url).href;\n } catch {\n // debugFile could be a blob URL which causes the URL constructor to throw\n // for now we just ignore this case\n }\n }\n\n IMAGES.push({\n type: 'wasm',\n code_id: buildId,\n code_file: url,\n debug_file: debugFileUrl,\n debug_id: `${buildId.padEnd(32, '0').slice(0, 32)}0`,\n });\n }\n}\n\n/**\n * Returns all known images.\n */\nexport function getImages(): Array<DebugImage> {\n return IMAGES;\n}\n\n/**\n * Looks up an image by URL.\n *\n * @param url the URL of the WebAssembly module.\n */\nexport function getImage(url: string): number {\n return IMAGES.findIndex(image => {\n return image.type === 'wasm' && image.code_file === url;\n });\n}\n"],"names":[],"mappings":";;AAEO,MAAM,MAAM,GAAsB;;AAOzC;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,MAAM,EAAkC;AACtE,EAAE,MAAM,QAAA,GAAW,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC;AACxE,EAAE,IAAI,OAAA,GAAU,IAAI;AACpB,EAAE,IAAI,SAAA,GAAY,IAAI;;AAEtB,EAAE,MAAM,QAAA,GAAW,QAAQ,CAAC,CAAC,CAAC;AAC9B,EAAE,IAAI,QAAQ,EAAE;AAChB,IAAI,MAAM,YAAA,GAAe,IAAI,UAAU,CAAC,QAAQ,CAAC;AACjD,IAAI,UAAU,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK;AAC1D,MAAM,OAAO,GAAA,GAAM,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;AAClD,KAAK,EAAE,EAAE,CAAC;AACV;;AAEA,EAAE,MAAM,iBAAA,GAAoB,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,qBAAqB,CAAC;AAC5F,EAAE,MAAM,kBAAA,GAAqB,iBAAiB,CAAC,CAAC,CAAC;AACjD,EAAE,IAAI,kBAAkB,EAAE;AAC1B,IAAI,MAAM,sBAAA,GAAyB,IAAI,UAAU,CAAC,kBAAkB,CAAC;AACrE,IAAI,MAAM,OAAA,GAAU,IAAI,WAAW,CAAC,OAAO,CAAC;AAC5C,IAAI,YAAY,OAAO,CAAC,MAAM,CAAC,sBAAsB,CAAC;AACtD;;AAEA,EAAE,OAAO,EAAE,O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"sourcesContent":["import type { DebugImage } from '@sentry/core';\n\nexport const IMAGES: Array<DebugImage> = [];\n\nexport interface ModuleInfo {\n buildId: string | null;\n debugFile: string | null;\n}\n\n/**\n * Returns the extracted meta information from a web assembly module that\n * Sentry uses to identify debug images.\n *\n * @param module\n */\nexport function getModuleInfo(module: WebAssembly.Module): ModuleInfo {\n const buildIds = WebAssembly.Module.customSections(module, 'build_id');\n let buildId = null;\n let debugFile = null;\n\n const buildId0 = buildIds[0];\n if (buildId0) {\n const firstBuildId = new Uint8Array(buildId0);\n buildId = Array.from(firstBuildId).reduce((acc, x) => {\n return acc + x.toString(16).padStart(2, '0');\n }, '');\n }\n\n const externalDebugInfo = WebAssembly.Module.customSections(module, 'external_debug_info');\n const externalDebugInfo0 = externalDebugInfo[0];\n if (externalDebugInfo0) {\n const firstExternalDebugInfo = new Uint8Array(externalDebugInfo0);\n const decoder = new TextDecoder('utf-8');\n debugFile = decoder.decode(firstExternalDebugInfo);\n }\n\n return { buildId, debugFile };\n}\n\n/**\n * Records a module\n */\nexport function registerModule(module: WebAssembly.Module, url: string): void {\n const { buildId, debugFile } = getModuleInfo(module);\n if (buildId) {\n const oldIdx = getImage(url);\n if (oldIdx >= 0) {\n IMAGES.splice(oldIdx, 1);\n }\n\n let debugFileUrl = null;\n if (debugFile) {\n try {\n debugFileUrl = new URL(debugFile, url).href;\n } catch {\n // debugFile could be a blob URL which causes the URL constructor to throw\n // for now we just ignore this case\n }\n }\n\n IMAGES.push({\n type: 'wasm',\n code_id: buildId,\n code_file: url,\n debug_file: debugFileUrl,\n debug_id: `${buildId.padEnd(32, '0').slice(0, 32)}0`,\n });\n }\n}\n\n/**\n * Returns all known images.\n */\nexport function getImages(): Array<DebugImage> {\n return IMAGES;\n}\n\n/**\n * Looks up an image by URL.\n *\n * @param url the URL of the WebAssembly module.\n */\nexport function getImage(url: string): number {\n return IMAGES.findIndex(image => {\n return image.type === 'wasm' && image.code_file === url;\n });\n}\n"],"names":[],"mappings":";;AAE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M,CAAC;AACtD,EAAE,IAAI,OAAO,EAAE;AACf,IAAI,MAAM,MAAA,GAAS,QAAQ,CAAC,GAAG,CAAC;AAChC,IAAI,IAAI,MAAA,IAAU,CAAC,EAAE;AACrB,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,IAAI;;AAEJ,IAAI,IAAI,YAAA,GAAe,IAAI;AAC3B,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,IAAI;AACV,QAAQ,YAAA,GAAe,IAAI,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI;AACnD,MAAM,EAAE,MAAM;AACd;AACA;AACA,MAAM;AACN,IAAI;;AAEJ,IAAI,MAAM,CAAC,IAAI,CAAC;AAChB,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,OAAO;AACtB,MAAM,SAAS,EAAE,GAAG;AACpB,MAAM,UAAU,EAAE,YAAY;AAC9B,MAAM,QAAQ,EAAE,CAAC,EAAA,OAAA,CAAA,MAAA,CAAA,EAAA,EAAA,GAAA,CAAA,CAAA,KAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA,EAAA;AACA;;AAEA;AACA;AACA;AACA,SAAA,SAAA,GAAA;AACA,EAAA,OAAA,MAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,MAAA,CAAA,SAAA,CAAA,KAAA,IAAA;AACA,IAAA,OAAA,KAAA,CAAA,IAAA,KAAA,MAAA,IAAA,KAAA,CAAA,SAAA,KAAA,GAAA;AACA,EAAA,CAAA,CAAA;AACA;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { patchWebAssembly } from './patchWebAssembly';\nimport { getImage, getImages } from './registry';\n\nconst INTEGRATION_NAME = 'Wasm';\n\nconst _wasmIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n patchWebAssembly();\n },\n processEvent(event: Event): Event {\n let hasAtLeastOneWasmFrameWithImage = false;\n\n if (event.exception?.values) {\n event.exception.values.forEach(exception => {\n if (exception.stacktrace?.frames) {\n hasAtLeastOneWasmFrameWithImage =\n hasAtLeastOneWasmFrameWithImage || patchFrames(exception.stacktrace.frames);\n }\n });\n }\n\n if (hasAtLeastOneWasmFrameWithImage) {\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = [...(event.debug_meta.images || []), ...getImages()];\n }\n\n return event;\n },\n };\n}) satisfies IntegrationFn;\n\nexport const wasmIntegration = defineIntegration(_wasmIntegration);\n\nconst PARSER_REGEX = /^(.*?):wasm-function\\[\\d+\\]:(0x[a-fA-F0-9]+)$/;\n\n/**\n * Patches a list of stackframes with wasm data needed for server-side symbolication\n * if applicable. Returns true if the provided list of stack frames had at least one\n * matching registered image.\n */\n// Only exported for tests\nexport function patchFrames(frames: Array<StackFrame>): boolean {\n let hasAtLeastOneWasmFrameWithImage = false;\n frames.forEach(frame => {\n if (!frame.filename) {\n return;\n }\n\n const split = frame.filename.split('(');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const lastSplit = split[split.length - 1]!;\n\n // Let's call this first match a \"messy match\".\n // The browser stacktrace parser spits out frames that have a filename like this: \"int) const (http://localhost:8001/main.wasm:wasm-function[190]:0x5aeb\"\n // It contains some leftover mess because wasm stack frames are more complicated than our parser can handle: \"at MyClass::bar(int) const (http://localhost:8001/main.wasm:wasm-function[190]:0x5aeb)\"\n // This first match simply tries to mitigate the mess up until the first opening parens.\n // The match afterwards is a sensible fallback\n let match = lastSplit.match(PARSER_REGEX) as null | [string, string, string];\n\n if (!match) {\n match = frame.filename.match(PARSER_REGEX) as null | [string, string, string];\n }\n\n if (match) {\n const index = getImage(match[1]);\n frame.instruction_addr = match[2];\n frame.filename = match[1];\n frame.platform = 'native';\n\n if (index >= 0) {\n frame.addr_mode = `rel:${index}`;\n hasAtLeastOneWasmFrameWithImage = true;\n }\n }\n });\n\n return hasAtLeastOneWasmFrameWithImage;\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,gBAAA,GAAmB,MAAM;;AAE/B,MAAM,gBAAA,IAAoB,MAAM;AAChC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,gBAAgB;AAC1B,IAAI,SAAS,GAAG;AAChB,MAAM,gBAAgB,EAAE;AACxB,KAAK;AACL,IAAI,YAAY,CAAC,KAAK,EAAgB;AACtC,MAAM,IAAI,+BAAA,GAAkC,KAAK;;AAEjD,MAAM,IAAI,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE;AACnC,QAAQ,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,SAAA,IAAa;AACpD,UAAU,IAAI,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE;AAC5C,YAAY,+BAAA;AACZ,cAAc,+BAAA,IAAmC,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC;AACzF;AACA,SAAS,CAAC;AACV;;AAEA,MAAM,IAAI,+BAA+B,EAAE;AAC3C,QAAQ,KAAK,CAAC,UAAA,GAAa,KAAK,CAAC,UAAA,IAAc,EAAE;AACjD,QAAQ,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,MAAA,IAAU,EAAE,CAAC,EAAE,GAAG,SAAS,EAAE,CAAC;AACtF;;AAEA,MAAM,OAAO,KAAK;AAClB,KAAK;AACL,GAAG;AACH,CAAC,CAAA;;MAEY,eAAA,GAAkB,iBAAiB,CAAC,gBAAgB;;AAEjE,MAAM,YAAA,GAAe,+CAA+C;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,WAAW,CAAC,MAAM,EAA8B;AAChE,EAAE,IAAI,+BAAA,GAAkC,KAAK;AAC7C,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS;AAC1B,IAAI,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;AACzB,MAAM;AACN;;AAEA,IAAI,MAAM,KAAA,GAAQ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC;AAC3C;AACA,IAAI,MAAM,SAAA,GAAY,KAAK,CAAC,KAAK,CAAC,MAAA,GAAS,CAAC,CAAC;;AAE7C;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,QAAQ,SAAS,CAAC,KAAK,CAAC,YAAY,CAAA;;AAE5C,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,MAAM,KAAA,GAAQ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAA;AAC/C;;AAEA,IAAI,IAAI,KAAK,EAAE;AACf,MAAM,MAAM,QAAQ,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,KAAK,CAAC,gBAAA,GAAmB,KAAK,CAAC,CAAC,CAAC;AACvC,MAAM,KAAK,CAAC,QAAA,GAAW,KAAK,CAAC,CAAC,CAAC;AAC/B,MAAM,KAAK,CAAC,QAAA,GAAW,QAAQ;;AAE/B,MAAM,IAAI,KAAA,IAAS,CAAC,EAAE;AACtB,QAAQ,KAAK,CAAC,SAAA,GAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACA,QAAA,+BAAA,GAAA,IAAA;AACA;AACA;AACA,GAAA,CAAA;;AAEA,EAAA,OAAA,+BAAA;AACA;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["import type { Event, IntegrationFn, StackFrame } from '@sentry/core';\nimport { defineIntegration } from '@sentry/core';\nimport { patchWebAssembly } from './patchWebAssembly';\nimport { getImage, getImages } from './registry';\n\nconst INTEGRATION_NAME = 'Wasm';\n\nconst _wasmIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n patchWebAssembly();\n },\n processEvent(event: Event): Event {\n let hasAtLeastOneWasmFrameWithImage = false;\n\n if (event.exception?.values) {\n event.exception.values.forEach(exception => {\n if (exception.stacktrace?.frames) {\n hasAtLeastOneWasmFrameWithImage =\n hasAtLeastOneWasmFrameWithImage || patchFrames(exception.stacktrace.frames);\n }\n });\n }\n\n if (hasAtLeastOneWasmFrameWithImage) {\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = [...(event.debug_meta.images || []), ...getImages()];\n }\n\n return event;\n },\n };\n}) satisfies IntegrationFn;\n\nexport const wasmIntegration = defineIntegration(_wasmIntegration);\n\nconst PARSER_REGEX = /^(.*?):wasm-function\\[\\d+\\]:(0x[a-fA-F0-9]+)$/;\n\n/**\n * Patches a list of stackframes with wasm data needed for server-side symbolication\n * if applicable. Returns true if the provided list of stack frames had at least one\n * matching registered image.\n */\n// Only exported for tests\nexport function patchFrames(frames: Array<StackFrame>): boolean {\n let hasAtLeastOneWasmFrameWithImage = false;\n frames.forEach(frame => {\n if (!frame.filename) {\n return;\n }\n\n const split = frame.filename.split('(');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const lastSplit = split[split.length - 1]!;\n\n // Let's call this first match a \"messy match\".\n // The browser stacktrace parser spits out frames that have a filename like this: \"int) const (http://localhost:8001/main.wasm:wasm-function[190]:0x5aeb\"\n // It contains some leftover mess because wasm stack frames are more complicated than our parser can handle: \"at MyClass::bar(int) const (http://localhost:8001/main.wasm:wasm-function[190]:0x5aeb)\"\n // This first match simply tries to mitigate the mess up until the first opening parens.\n // The match afterwards is a sensible fallback\n let match = lastSplit.match(PARSER_REGEX) as null | [string, string, string];\n\n if (!match) {\n match = frame.filename.match(PARSER_REGEX) as null | [string, string, string];\n }\n\n if (match) {\n const index = getImage(match[1]);\n frame.instruction_addr = match[2];\n frame.filename = match[1];\n frame.platform = 'native';\n\n if (index >= 0) {\n frame.addr_mode = `rel:${index}`;\n hasAtLeastOneWasmFrameWithImage = true;\n }\n }\n });\n\n return hasAtLeastOneWasmFrameWithIm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AI;;AAEJ,IAAI,MAAM,KAAA,GAAQ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC;AAC3C;AACA,IAAI,MAAM,SAAA,GAAY,KAAK,CAAC,KAAK,CAAC,MAAA,GAAS,CAAC,CAAC;;AAE7C;AACA;AACA;AACA;AACA;AACA,IAAI,IAAI,QAAQ,SAAS,CAAC,KAAK,CAAC,YAAY,CAAA;;AAE5C,IAAI,IAAI,CAAC,KAAK,EAAE;AAChB,MAAM,KAAA,GAAQ,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAA;AAC/C,IAAI;;AAEJ,IAAI,IAAI,KAAK,EAAE;AACf,MAAM,MAAM,QAAQ,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACtC,MAAM,KAAK,CAAC,gBAAA,GAAmB,KAAK,CAAC,CAAC,CAAC;AACvC,MAAM,KAAK,CAAC,QAAA,GAAW,KAAK,CAAC,CAAC,CAAC;AAC/B,MAAM,KAAK,CAAC,QAAA,GAAW,QAAQ;;AAE/B,MAAM,IAAI,KAAA,IAAS,CAAC,EAAE;AACtB,QAAQ,KAAK,CAAC,SAAA,GAAY,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACA,QAAA,+BAAA,GAAA,IAAA;AACA,MAAA;AACA,IAAA;AACA,EAAA,CAAA,CAAA;;AAEA,EAAA,OAAA,+BAAA;AACA;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"10.24.0","sideEffects":false}
1
+ {"type":"module","version":"10.25.0","sideEffects":false}
@@ -1 +1 @@
1
- {"version":3,"file":"patchWebAssembly.js","sources":["../../../src/patchWebAssembly.ts"],"sourcesContent":["import { registerModule } from './registry';\n\n/**\n * Patches the web assembly runtime.\n */\nexport function patchWebAssembly(): void {\n if ('instantiateStreaming' in WebAssembly) {\n const origInstantiateStreaming = WebAssembly.instantiateStreaming;\n WebAssembly.instantiateStreaming = function instantiateStreaming(\n response: Response | PromiseLike<Response>,\n importObject: WebAssembly.Imports,\n ): Promise<WebAssembly.Module> {\n return Promise.resolve(response).then(response => {\n return origInstantiateStreaming(response, importObject).then(rv => {\n if (response.url) {\n registerModule(rv.module, response.url);\n }\n return rv;\n });\n });\n } as typeof WebAssembly.instantiateStreaming;\n }\n\n if ('compileStreaming' in WebAssembly) {\n const origCompileStreaming = WebAssembly.compileStreaming;\n WebAssembly.compileStreaming = function compileStreaming(\n source: Response | Promise<Response>,\n ): Promise<WebAssembly.Module> {\n return Promise.resolve(source).then(response => {\n return origCompileStreaming(response).then(module => {\n if (response.url) {\n registerModule(module, response.url);\n }\n return module;\n });\n });\n } as typeof WebAssembly.compileStreaming;\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACO,SAAS,gBAAgB,GAAS;AACzC,EAAE,IAAI,sBAAA,IAA0B,WAAW,EAAE;AAC7C,IAAI,MAAM,wBAAA,GAA2B,WAAW,CAAC,oBAAoB;AACrE,IAAI,WAAW,CAAC,oBAAA,GAAuB,SAAS,oBAAoB;AACpE,MAAM,QAAQ;AACd,MAAM,YAAY;AAClB,MAAmC;AACnC,MAAM,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAA,IAAY;AACxD,QAAQ,OAAO,wBAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,EAAA,IAAM;AAC3E,UAAU,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC5B,YAAY,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;AACnD;AACA,UAAU,OAAO,EAAE;AACnB,SAAS,CAAC;AACV,OAAO,CAAC;AACR,KAAI;AACJ;;AAEA,EAAE,IAAI,kBAAA,IAAsB,WAAW,EAAE;AACzC,IAAI,MAAM,oBAAA,GAAuB,WAAW,CAAC,gBAAgB;AAC7D,IAAI,WAAW,CAAC,gBAAA,GAAmB,SAAS,gBAAgB;AAC5D,MAAM,MAAM;AACZ,MAAmC;AACnC,MAAM,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAA,IAAY;AACtD,QAAQ,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAA,IAAU;AAC7D,UAAU,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC5B,YAAY,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;AAChD;AACA,UAAU,OAAO,MAAM;AACvB,SAAS,CAAC;AACV,OAAO,CAAC;AACR,KAAI;AACJ;AACA;;;;"}
1
+ {"version":3,"file":"patchWebAssembly.js","sources":["../../../src/patchWebAssembly.ts"],"sourcesContent":["import { registerModule } from './registry';\n\n/**\n * Patches the web assembly runtime.\n */\nexport function patchWebAssembly(): void {\n if ('instantiateStreaming' in WebAssembly) {\n const origInstantiateStreaming = WebAssembly.instantiateStreaming;\n WebAssembly.instantiateStreaming = function instantiateStreaming(\n response: Response | PromiseLike<Response>,\n importObject: WebAssembly.Imports,\n ): Promise<WebAssembly.Module> {\n return Promise.resolve(response).then(response => {\n return origInstantiateStreaming(response, importObject).then(rv => {\n if (response.url) {\n registerModule(rv.module, response.url);\n }\n return rv;\n });\n });\n } as typeof WebAssembly.instantiateStreaming;\n }\n\n if ('compileStreaming' in WebAssembly) {\n const origCompileStreaming = WebAssembly.compileStreaming;\n WebAssembly.compileStreaming = function compileStreaming(\n source: Response | Promise<Response>,\n ): Promise<WebAssembly.Module> {\n return Promise.resolve(source).then(response => {\n return origCompileStreaming(response).then(module => {\n if (response.url) {\n registerModule(module, response.url);\n }\n return module;\n });\n });\n } as typeof WebAssembly.compileStreaming;\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACO,SAAS,gBAAgB,GAAS;AACzC,EAAE,IAAI,sBAAA,IAA0B,WAAW,EAAE;AAC7C,IAAI,MAAM,wBAAA,GAA2B,WAAW,CAAC,oBAAoB;AACrE,IAAI,WAAW,CAAC,oBAAA,GAAuB,SAAS,oBAAoB;AACpE,MAAM,QAAQ;AACd,MAAM,YAAY;AAClB,MAAmC;AACnC,MAAM,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,QAAA,IAAY;AACxD,QAAQ,OAAO,wBAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,EAAA,IAAM;AAC3E,UAAU,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC5B,YAAY,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;AACnD,UAAU;AACV,UAAU,OAAO,EAAE;AACnB,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC,CAAC;AACR,IAAI,CAAA;AACJ,EAAE;;AAEF,EAAE,IAAI,kBAAA,IAAsB,WAAW,EAAE;AACzC,IAAI,MAAM,oBAAA,GAAuB,WAAW,CAAC,gBAAgB;AAC7D,IAAI,WAAW,CAAC,gBAAA,GAAmB,SAAS,gBAAgB;AAC5D,MAAM,MAAM;AACZ,MAAmC;AACnC,MAAM,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,QAAA,IAAY;AACtD,QAAQ,OAAO,oBAAoB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAA,IAAU;AAC7D,UAAU,IAAI,QAAQ,CAAC,GAAG,EAAE;AAC5B,YAAY,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;AAChD,UAAU;AACV,UAAU,OAAO,MAAM;AACvB,QAAQ,CAAC,CAAC;AACV,MAAM,CAAC,CAAC;AACR,IAAI,CAAA;AACJ,EAAE;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sources":["../../../src/registry.ts"],"sourcesContent":["import type { DebugImage } from '@sentry/core';\n\nexport const IMAGES: Array<DebugImage> = [];\n\nexport interface ModuleInfo {\n buildId: string | null;\n debugFile: string | null;\n}\n\n/**\n * Returns the extracted meta information from a web assembly module that\n * Sentry uses to identify debug images.\n *\n * @param module\n */\nexport function getModuleInfo(module: WebAssembly.Module): ModuleInfo {\n const buildIds = WebAssembly.Module.customSections(module, 'build_id');\n let buildId = null;\n let debugFile = null;\n\n const buildId0 = buildIds[0];\n if (buildId0) {\n const firstBuildId = new Uint8Array(buildId0);\n buildId = Array.from(firstBuildId).reduce((acc, x) => {\n return acc + x.toString(16).padStart(2, '0');\n }, '');\n }\n\n const externalDebugInfo = WebAssembly.Module.customSections(module, 'external_debug_info');\n const externalDebugInfo0 = externalDebugInfo[0];\n if (externalDebugInfo0) {\n const firstExternalDebugInfo = new Uint8Array(externalDebugInfo0);\n const decoder = new TextDecoder('utf-8');\n debugFile = decoder.decode(firstExternalDebugInfo);\n }\n\n return { buildId, debugFile };\n}\n\n/**\n * Records a module\n */\nexport function registerModule(module: WebAssembly.Module, url: string): void {\n const { buildId, debugFile } = getModuleInfo(module);\n if (buildId) {\n const oldIdx = getImage(url);\n if (oldIdx >= 0) {\n IMAGES.splice(oldIdx, 1);\n }\n\n let debugFileUrl = null;\n if (debugFile) {\n try {\n debugFileUrl = new URL(debugFile, url).href;\n } catch {\n // debugFile could be a blob URL which causes the URL constructor to throw\n // for now we just ignore this case\n }\n }\n\n IMAGES.push({\n type: 'wasm',\n code_id: buildId,\n code_file: url,\n debug_file: debugFileUrl,\n debug_id: `${buildId.padEnd(32, '0').slice(0, 32)}0`,\n });\n }\n}\n\n/**\n * Returns all known images.\n */\nexport function getImages(): Array<DebugImage> {\n return IMAGES;\n}\n\n/**\n * Looks up an image by URL.\n *\n * @param url the URL of the WebAssembly module.\n */\nexport function getImage(url: string): number {\n return IMAGES.findIndex(image => {\n return image.type === 'wasm' && image.code_file === url;\n });\n}\n"],"names":[],"mappings":"AAEO,MAAM,MAAM,GAAsB;;AAOzC;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,MAAM,EAAkC;AACtE,EAAE,MAAM,QAAA,GAAW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rB,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B;;AAEA,IAAI,IAAI,YAAA,GAAe,IAAI;AAC3B,IAAI,IAAI,SAAS,EAAE;AACnB,MAAM,IAAI;AACV,QAAQ,YAAA,GAAe,IAAI,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI;AACnD,QAAQ,MAAM;AACd;AACA;AACA;AACA;;AAEA,IAAI,MAAM,CAAC,IAAI,CAAC;AAChB,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,OAAO;AACtB,MAAM,SAAS,EAAE,GAAG;AACpB,MAAM,UAAU,EAAE,YAAY;AAC9B,MAAM,QAAQ,EAAE,CAAC,EAAA,OAAA,CAAA,MAAA,CAAA,EAAA,EAAA,GAAA,CAAA,CAAA,KAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAA,SAAA,GAAA;AACA,EAAA,OAAA,MAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,MAAA,CAAA,SAAA,CAAA,KAAA,IAAA;AACA,IAAA,OAAA,KAAA,CAAA,IAAA,KAAA,MAAA,IAAA,KAAA,CAAA,SAAA,KAAA,GAAA;AACA,GAAA,CAAA;AACA;;;;"}
1
+ {"version":3,"file":"registry.js","sources":["../../../src/registry.ts"],"sourcesContent":["import type { DebugImage } from '@sentry/core';\n\nexport const IMAGES: Array<DebugImage> = [];\n\nexport interface ModuleInfo {\n buildId: string | null;\n debugFile: string | null;\n}\n\n/**\n * Returns the extracted meta information from a web assembly module that\n * Sentry uses to identify debug images.\n *\n * @param module\n */\nexport function getModuleInfo(module: WebAssembly.Module): ModuleInfo {\n const buildIds = WebAssembly.Module.customSections(module, 'build_id');\n let buildId = null;\n let debugFile = null;\n\n const buildId0 = buildIds[0];\n if (buildId0) {\n const firstBuildId = new Uint8Array(buildId0);\n buildId = Array.from(firstBuildId).reduce((acc, x) => {\n return acc + x.toString(16).padStart(2, '0');\n }, '');\n }\n\n const externalDebugInfo = WebAssembly.Module.customSections(module, 'external_debug_info');\n const externalDebugInfo0 = externalDebugInfo[0];\n if (externalDebugInfo0) {\n const firstExternalDebugInfo = new Uint8Array(externalDebugInfo0);\n const decoder = new TextDecoder('utf-8');\n debugFile = decoder.decode(firstExternalDebugInfo);\n }\n\n return { buildId, debugFile };\n}\n\n/**\n * Records a module\n */\nexport function registerModule(module: WebAssembly.Module, url: string): void {\n const { buildId, debugFile } = getModuleInfo(module);\n if (buildId) {\n const oldIdx = getImage(url);\n if (oldIdx >= 0) {\n IMAGES.splice(oldIdx, 1);\n }\n\n let debugFileUrl = null;\n if (debugFile) {\n try {\n debugFileUrl = new URL(debugFile, url).href;\n } catch {\n // debugFile could be a blob URL which causes the URL constructor to throw\n // for now we just ignore this case\n }\n }\n\n IMAGES.push({\n type: 'wasm',\n code_id: buildId,\n code_file: url,\n debug_file: debugFileUrl,\n debug_id: `${buildId.padEnd(32, '0').slice(0, 32)}0`,\n });\n }\n}\n\n/**\n * Returns all known images.\n */\nexport function getImages(): Array<DebugImage> {\n return IMAGES;\n}\n\n/**\n * Looks up an image by URL.\n *\n * @param url the URL of the WebAssembly module.\n */\nexport function getImage(url: string): number {\n return IMAGES.findIndex(image => {\n return image.type === 'wasm' && image.code_file === url;\n });\n}\n"],"names":[],"mappings":"AAEO,MAAM,MAAM,GAAsB;;AAOzC;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,aAAa,CAAC,MAAM,EAAkC;AACtE,EAAE,MAAM,QAAA,GAAW,WAAW,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,UAAU,CAAC;AACxE,EAAE,IAAI,OAAA,GAAU,IAAI;AACpB,EAAE,IAAI,SAAA,GAAY,IAAI;;AAEtB,EAAE,MAAM,QAAA,GAAW,QAAQ,CAAC,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V,QAAQ,YAAA,GAAe,IAAI,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI;AACnD,MAAM,EAAE,MAAM;AACd;AACA;AACA,MAAM;AACN,IAAI;;AAEJ,IAAI,MAAM,CAAC,IAAI,CAAC;AAChB,MAAM,IAAI,EAAE,MAAM;AAClB,MAAM,OAAO,EAAE,OAAO;AACtB,MAAM,SAAS,EAAE,GAAG;AACpB,MAAM,UAAU,EAAE,YAAY;AAC9B,MAAM,QAAQ,EAAE,CAAC,EAAA,OAAA,CAAA,MAAA,CAAA,EAAA,EAAA,GAAA,CAAA,CAAA,KAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;AACA,KAAA,CAAA;AACA,EAAA;AACA;;AAEA;AACA;AACA;AACA,SAAA,SAAA,GAAA;AACA,EAAA,OAAA,MAAA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAA,QAAA,CAAA,GAAA,EAAA;AACA,EAAA,OAAA,MAAA,CAAA,SAAA,CAAA,KAAA,IAAA;AACA,IAAA,OAAA,KAAA,CAAA,IAAA,KAAA,MAAA,IAAA,KAAA,CAAA,SAAA,KAAA,GAAA;AACA,EAAA,CAAA,CAAA;AACA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/wasm",
3
- "version": "10.24.0",
3
+ "version": "10.25.0",
4
4
  "description": "Support for WASM.",
5
5
  "repository": "git://github.com/getsentry/sentry-javascript.git",
6
6
  "homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/wasm",
@@ -39,8 +39,8 @@
39
39
  "access": "public"
40
40
  },
41
41
  "dependencies": {
42
- "@sentry/browser": "10.24.0",
43
- "@sentry/core": "10.24.0"
42
+ "@sentry/browser": "10.25.0",
43
+ "@sentry/core": "10.25.0"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "run-p build:transpile build:bundle build:types",