@sentry/wasm 7.0.0-alpha.0 → 7.0.0-beta.1

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.
package/README.md CHANGED
@@ -1,8 +1,7 @@
1
1
  <p align="center">
2
- <a href="https://sentry.io" target="_blank" align="center">
3
- <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" width="280">
2
+ <a href="https://sentry.io/?utm_source=github&utm_medium=logo" target="_blank">
3
+ <img src="https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png" alt="Sentry" width="280" height="84">
4
4
  </a>
5
- <br />
6
5
  </p>
7
6
 
8
7
  # Sentry JavaScript WebAssembly Support
package/cjs/index.js CHANGED
@@ -1,71 +1,77 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- var patchWebAssembly_1 = require("./patchWebAssembly");
3
- var registry_1 = require("./registry");
1
+ var {
2
+ _optionalChain
3
+ } = require('@sentry/utils/cjs/buildPolyfills');
4
+
5
+ Object.defineProperty(exports, '__esModule', { value: true });
6
+
7
+ var patchWebAssembly = require('./patchWebAssembly.js');
8
+ var registry = require('./registry.js');
9
+
4
10
  /** plz don't */
5
11
  function patchFrames(frames) {
6
- var haveWasm = false;
7
- frames.forEach(function (frame) {
8
- if (!frame.filename) {
9
- return;
10
- }
11
- var match = frame.filename.match(/^(.*?):wasm-function\[\d+\]:(0x[a-fA-F0-9]+)$/);
12
- if (match !== null) {
13
- var index = registry_1.getImage(match[1]);
14
- if (index >= 0) {
15
- frame.instruction_addr = match[2];
16
- frame.addr_mode = "rel:" + index;
17
- frame.filename = match[1];
18
- frame.platform = 'native';
19
- haveWasm = true;
20
- }
21
- }
22
- });
23
- return haveWasm;
12
+ let haveWasm = false;
13
+ frames.forEach(frame => {
14
+ if (!frame.filename) {
15
+ return;
16
+ }
17
+ var match = frame.filename.match(/^(.*?):wasm-function\[\d+\]:(0x[a-fA-F0-9]+)$/);
18
+ if (match !== null) {
19
+ var index = registry.getImage(match[1]);
20
+ if (index >= 0) {
21
+ frame.instruction_addr = match[2];
22
+ frame.addr_mode = `rel:${index}`;
23
+ frame.filename = match[1];
24
+ frame.platform = 'native';
25
+ haveWasm = true;
26
+ }
27
+ }
28
+ });
29
+ return haveWasm;
24
30
  }
31
+
25
32
  /**
26
33
  * Process WASM stack traces to support server-side symbolication.
27
34
  *
28
35
  * This also hooks the WebAssembly loading browser API so that module
29
36
  * registraitons are intercepted.
30
37
  */
31
- var Wasm = /** @class */ (function () {
32
- function Wasm() {
33
- /**
34
- * @inheritDoc
35
- */
36
- this.name = Wasm.id;
37
- }
38
- /**
39
- * @inheritDoc
40
- */
41
- Wasm.prototype.setupOnce = function (addGlobalEventProcessor, _getCurrentHub) {
42
- patchWebAssembly_1.patchWebAssembly();
43
- addGlobalEventProcessor(function (event) {
44
- var _a;
45
- var haveWasm = false;
46
- if (event.exception && event.exception.values) {
47
- event.exception.values.forEach(function (exception) {
48
- var _a;
49
- if ((_a = exception === null || exception === void 0 ? void 0 : exception.stacktrace) === null || _a === void 0 ? void 0 : _a.frames) {
50
- haveWasm = haveWasm || patchFrames(exception.stacktrace.frames);
51
- }
52
- });
53
- }
54
- if ((_a = event.stacktrace) === null || _a === void 0 ? void 0 : _a.frames) {
55
- haveWasm = haveWasm || patchFrames(event.stacktrace.frames);
56
- }
57
- if (haveWasm) {
58
- event.debug_meta = event.debug_meta || {};
59
- event.debug_meta.images = registry_1.getImages();
60
- }
61
- return event;
38
+ class Wasm {constructor() { Wasm.prototype.__init.call(this); }
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ static __initStatic() {this.id = 'Wasm';}
43
+
44
+ /**
45
+ * @inheritDoc
46
+ */
47
+ __init() {this.name = Wasm.id;}
48
+
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ setupOnce(addGlobalEventProcessor, _getCurrentHub) {
53
+ patchWebAssembly.patchWebAssembly();
54
+
55
+ addGlobalEventProcessor((event) => {
56
+ let haveWasm = false;
57
+
58
+ if (event.exception && event.exception.values) {
59
+ event.exception.values.forEach(exception => {
60
+ if (_optionalChain([exception, 'optionalAccess', _ => _.stacktrace, 'optionalAccess', _2 => _2.frames])) {
61
+ haveWasm = haveWasm || patchFrames(exception.stacktrace.frames);
62
+ }
62
63
  });
63
- };
64
- /**
65
- * @inheritDoc
66
- */
67
- Wasm.id = 'Wasm';
68
- return Wasm;
69
- }());
64
+ }
65
+
66
+ if (haveWasm) {
67
+ event.debug_meta = event.debug_meta || {};
68
+ event.debug_meta.images = registry.getImages();
69
+ }
70
+
71
+ return event;
72
+ });
73
+ }
74
+ }Wasm.__initStatic();
75
+
70
76
  exports.Wasm = Wasm;
71
- //# sourceMappingURL=index.js.map
77
+ //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":";AAEA,uDAAsD;AACtD,uCAAiD;AAEjD,gBAAgB;AAChB,SAAS,WAAW,CAAC,MAAyB;IAC5C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;QAClB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACnB,OAAO;SACR;QACD,IAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACpF,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,IAAM,KAAK,GAAG,mBAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACjC,IAAI,KAAK,IAAI,CAAC,EAAE;gBACd,KAAK,CAAC,gBAAgB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBAClC,KAAK,CAAC,SAAS,GAAG,SAAO,KAAO,CAAC;gBACjC,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;gBAC1B,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;gBAC1B,QAAQ,GAAG,IAAI,CAAC;aACjB;SACF;IACH,CAAC,CAAC,CAAC;IACH,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;GAKG;AACH;IAAA;QAME;;WAEG;QACI,SAAI,GAAW,IAAI,CAAC,EAAE,CAAC;IA8BhC,CAAC;IA5BC;;OAEG;IACI,wBAAS,GAAhB,UAAiB,uBAA2D,EAAE,cAAyB;QACrG,mCAAgB,EAAE,CAAC;QAEnB,uBAAuB,CAAC,UAAC,KAAY;;YACnC,IAAI,QAAQ,GAAG,KAAK,CAAC;YAErB,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,MAAM,EAAE;gBAC7C,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,UAAA,SAAS;;oBACtC,UAAI,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,UAAU,0CAAE,MAAM,EAAE;wBACjC,QAAQ,GAAG,QAAQ,IAAI,WAAW,CAAC,SAAS,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;qBACjE;gBACH,CAAC,CAAC,CAAC;aACJ;YACD,UAAI,KAAK,CAAC,UAAU,0CAAE,MAAM,EAAE;gBAC5B,QAAQ,GAAG,QAAQ,IAAI,WAAW,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;aAC7D;YAED,IAAI,QAAQ,EAAE;gBACZ,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,EAAE,CAAC;gBAC1C,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,oBAAS,EAAE,CAAC;aACvC;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IArCD;;OAEG;IACW,OAAE,GAAW,MAAM,CAAC;IAmCpC,WAAC;CAAA,AAvCD,IAuCC;AAvCY,oBAAI","sourcesContent":["import { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types';\n\nimport { patchWebAssembly } from './patchWebAssembly';\nimport { getImage, getImages } from './registry';\n\n/** plz don't */\nfunction patchFrames(frames: Array<StackFrame>): boolean {\n let haveWasm = false;\n frames.forEach(frame => {\n if (!frame.filename) {\n return;\n }\n const match = frame.filename.match(/^(.*?):wasm-function\\[\\d+\\]:(0x[a-fA-F0-9]+)$/);\n if (match !== null) {\n const index = getImage(match[1]);\n if (index >= 0) {\n frame.instruction_addr = match[2];\n frame.addr_mode = `rel:${index}`;\n frame.filename = match[1];\n frame.platform = 'native';\n haveWasm = true;\n }\n }\n });\n return haveWasm;\n}\n\n/**\n * Process WASM stack traces to support server-side symbolication.\n *\n * This also hooks the WebAssembly loading browser API so that module\n * registraitons are intercepted.\n */\nexport class Wasm implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Wasm';\n\n /**\n * @inheritDoc\n */\n public name: string = Wasm.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void {\n patchWebAssembly();\n\n addGlobalEventProcessor((event: Event) => {\n let haveWasm = false;\n\n if (event.exception && event.exception.values) {\n event.exception.values.forEach(exception => {\n if (exception?.stacktrace?.frames) {\n haveWasm = haveWasm || patchFrames(exception.stacktrace.frames);\n }\n });\n }\n if (event.stacktrace?.frames) {\n haveWasm = haveWasm || patchFrames(event.stacktrace.frames);\n }\n\n if (haveWasm) {\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = getImages();\n }\n\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["import { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types';\n\nimport { patchWebAssembly } from './patchWebAssembly';\nimport { getImage, getImages } from './registry';\n\n/** plz don't */\nfunction patchFrames(frames: Array<StackFrame>): boolean {\n let haveWasm = false;\n frames.forEach(frame => {\n if (!frame.filename) {\n return;\n }\n const match = frame.filename.match(/^(.*?):wasm-function\\[\\d+\\]:(0x[a-fA-F0-9]+)$/);\n if (match !== null) {\n const index = getImage(match[1]);\n if (index >= 0) {\n frame.instruction_addr = match[2];\n frame.addr_mode = `rel:${index}`;\n frame.filename = match[1];\n frame.platform = 'native';\n haveWasm = true;\n }\n }\n });\n return haveWasm;\n}\n\n/**\n * Process WASM stack traces to support server-side symbolication.\n *\n * This also hooks the WebAssembly loading browser API so that module\n * registraitons are intercepted.\n */\nexport class Wasm implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Wasm';\n\n /**\n * @inheritDoc\n */\n public name: string = Wasm.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void {\n patchWebAssembly();\n\n addGlobalEventProcessor((event: Event) => {\n let haveWasm = false;\n\n if (event.exception && event.exception.values) {\n event.exception.values.forEach(exception => {\n if (exception?.stacktrace?.frames) {\n haveWasm = haveWasm || patchFrames(exception.stacktrace.frames);\n }\n });\n }\n\n if (haveWasm) {\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = getImages();\n }\n\n return event;\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAKA;AACA;;;;;;;;;;;;;;;;;;;AAmBA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;"}
@@ -1,35 +1,44 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- var registry_1 = require("./registry");
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var registry = require('./registry.js');
4
+
3
5
  /**
4
6
  * Patches the web assembly runtime.
5
7
  */
6
8
  function patchWebAssembly() {
7
- if ('instantiateStreaming' in WebAssembly) {
8
- var origInstantiateStreaming_1 = WebAssembly.instantiateStreaming;
9
- WebAssembly.instantiateStreaming = function instantiateStreaming(response, importObject) {
10
- return Promise.resolve(response).then(function (response) {
11
- return origInstantiateStreaming_1(response, importObject).then(function (rv) {
12
- if (response.url) {
13
- registry_1.registerModule(rv.module, response.url);
14
- }
15
- return rv;
16
- });
17
- });
18
- };
19
- }
20
- if ('compileStreaming' in WebAssembly) {
21
- var origCompileStreaming_1 = WebAssembly.compileStreaming;
22
- WebAssembly.compileStreaming = function compileStreaming(source) {
23
- return Promise.resolve(source).then(function (response) {
24
- return origCompileStreaming_1(response).then(function (module) {
25
- if (response.url) {
26
- registry_1.registerModule(module, response.url);
27
- }
28
- return module;
29
- });
30
- });
31
- };
32
- }
9
+ if ('instantiateStreaming' in WebAssembly) {
10
+ var origInstantiateStreaming = WebAssembly.instantiateStreaming;
11
+ WebAssembly.instantiateStreaming = function instantiateStreaming(
12
+ response,
13
+ importObject,
14
+ ) {
15
+ return Promise.resolve(response).then(response => {
16
+ return origInstantiateStreaming(response, importObject).then(rv => {
17
+ if (response.url) {
18
+ registry.registerModule(rv.module, response.url);
19
+ }
20
+ return rv;
21
+ });
22
+ });
23
+ } ;
24
+ }
25
+
26
+ if ('compileStreaming' in WebAssembly) {
27
+ var origCompileStreaming = WebAssembly.compileStreaming;
28
+ WebAssembly.compileStreaming = function compileStreaming(
29
+ source,
30
+ ) {
31
+ return Promise.resolve(source).then(response => {
32
+ return origCompileStreaming(response).then(module => {
33
+ if (response.url) {
34
+ registry.registerModule(module, response.url);
35
+ }
36
+ return module;
37
+ });
38
+ });
39
+ } ;
40
+ }
33
41
  }
42
+
34
43
  exports.patchWebAssembly = patchWebAssembly;
35
- //# sourceMappingURL=patchWebAssembly.js.map
44
+ //# sourceMappingURL=patchWebAssembly.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patchWebAssembly.js","sourceRoot":"","sources":["../../../src/patchWebAssembly.ts"],"names":[],"mappings":";AAAA,uCAA4C;AAE5C;;GAEG;AACH,SAAgB,gBAAgB;IAC9B,IAAI,sBAAsB,IAAI,WAAW,EAAE;QACzC,IAAM,0BAAwB,GAAG,WAAW,CAAC,oBAAoB,CAAC;QAClE,WAAW,CAAC,oBAAoB,GAAG,SAAS,oBAAoB,CAC9D,QAA0C,EAC1C,YAAiC;YAEjC,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAA,QAAQ;gBAC5C,OAAO,0BAAwB,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,UAAA,EAAE;oBAC7D,IAAI,QAAQ,CAAC,GAAG,EAAE;wBAChB,yBAAc,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;qBACzC;oBACD,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAA4C,CAAC;KAC9C;IAED,IAAI,kBAAkB,IAAI,WAAW,EAAE;QACrC,IAAM,sBAAoB,GAAG,WAAW,CAAC,gBAAgB,CAAC;QAC1D,WAAW,CAAC,gBAAgB,GAAG,SAAS,gBAAgB,CACtD,MAAoC;YAEpC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,UAAA,QAAQ;gBAC1C,OAAO,sBAAoB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAA,MAAM;oBAC/C,IAAI,QAAQ,CAAC,GAAG,EAAE;wBAChB,yBAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;qBACtC;oBACD,OAAO,MAAM,CAAC;gBAChB,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAwC,CAAC;KAC1C;AACH,CAAC;AAjCD,4CAiCC","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"]}
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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;"}
package/cjs/registry.js CHANGED
@@ -1,5 +1,7 @@
1
- Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.IMAGES = [];
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var IMAGES = [];
4
+
3
5
  /**
4
6
  * Returns the extracted meta information from a web assembly module that
5
7
  * Sentry uses to identify debug images.
@@ -7,58 +9,66 @@ exports.IMAGES = [];
7
9
  * @param module
8
10
  */
9
11
  function getModuleInfo(module) {
10
- var buildIds = WebAssembly.Module.customSections(module, 'build_id');
11
- var buildId = null;
12
- var debugFile = null;
13
- if (buildIds.length > 0) {
14
- var firstBuildId = new Uint8Array(buildIds[0]);
15
- buildId = Array.from(firstBuildId).reduce(function (acc, x) {
16
- return acc + x.toString(16).padStart(2, '0');
17
- }, '');
18
- }
19
- var externalDebugInfo = WebAssembly.Module.customSections(module, 'external_debug_info');
20
- if (externalDebugInfo.length > 0) {
21
- var firstExternalDebugInfo = new Uint8Array(externalDebugInfo[0]);
22
- var decoder = new TextDecoder('utf-8');
23
- debugFile = decoder.decode(firstExternalDebugInfo);
24
- }
25
- return { buildId: buildId, debugFile: debugFile };
12
+ var buildIds = WebAssembly.Module.customSections(module, 'build_id');
13
+ let buildId = null;
14
+ let debugFile = null;
15
+
16
+ if (buildIds.length > 0) {
17
+ var firstBuildId = new Uint8Array(buildIds[0]);
18
+ buildId = Array.from(firstBuildId).reduce((acc, x) => {
19
+ return acc + x.toString(16).padStart(2, '0');
20
+ }, '');
21
+ }
22
+
23
+ var externalDebugInfo = WebAssembly.Module.customSections(module, 'external_debug_info');
24
+ if (externalDebugInfo.length > 0) {
25
+ var firstExternalDebugInfo = new Uint8Array(externalDebugInfo[0]);
26
+ var decoder = new TextDecoder('utf-8');
27
+ debugFile = decoder.decode(firstExternalDebugInfo);
28
+ }
29
+
30
+ return { buildId, debugFile };
26
31
  }
27
- exports.getModuleInfo = getModuleInfo;
32
+
28
33
  /**
29
34
  * Records a module
30
35
  */
31
36
  function registerModule(module, url) {
32
- var _a = getModuleInfo(module), buildId = _a.buildId, debugFile = _a.debugFile;
33
- if (buildId) {
34
- var oldIdx = exports.IMAGES.findIndex(function (img) { return img.code_file === url; });
35
- if (oldIdx >= 0) {
36
- exports.IMAGES.splice(oldIdx, 1);
37
- }
38
- exports.IMAGES.push({
39
- type: 'wasm',
40
- code_id: buildId,
41
- code_file: url,
42
- debug_file: debugFile ? new URL(debugFile, url).href : null,
43
- debug_id: buildId.padEnd(32, '0').substr(0, 32) + "0",
44
- });
37
+ const { buildId, debugFile } = getModuleInfo(module);
38
+ if (buildId) {
39
+ var oldIdx = IMAGES.findIndex(img => img.code_file === url);
40
+ if (oldIdx >= 0) {
41
+ IMAGES.splice(oldIdx, 1);
45
42
  }
43
+ IMAGES.push({
44
+ type: 'wasm',
45
+ code_id: buildId,
46
+ code_file: url,
47
+ debug_file: debugFile ? new URL(debugFile, url).href : null,
48
+ debug_id: `${buildId.padEnd(32, '0').substr(0, 32)}0`,
49
+ });
50
+ }
46
51
  }
47
- exports.registerModule = registerModule;
52
+
48
53
  /**
49
54
  * Returns all known images.
50
55
  */
51
56
  function getImages() {
52
- return exports.IMAGES;
57
+ return IMAGES;
53
58
  }
54
- exports.getImages = getImages;
59
+
55
60
  /**
56
61
  * Looks up an image by URL.
57
62
  *
58
63
  * @param url the URL of the WebAssembly module.
59
64
  */
60
65
  function getImage(url) {
61
- return exports.IMAGES.findIndex(function (img) { return img.code_file === url; });
66
+ return IMAGES.findIndex(img => img.code_file === url);
62
67
  }
68
+
69
+ exports.IMAGES = IMAGES;
63
70
  exports.getImage = getImage;
64
- //# sourceMappingURL=registry.js.map
71
+ exports.getImages = getImages;
72
+ exports.getModuleInfo = getModuleInfo;
73
+ exports.registerModule = registerModule;
74
+ //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/registry.ts"],"names":[],"mappings":";AAEa,QAAA,MAAM,GAAsB,EAAE,CAAC;AAO5C;;;;;GAKG;AACH,SAAgB,aAAa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AAG,EAArB,CAAqB,CAAC,CAAC;QAC9D,IAAI,MAAM,IAAI,CAAC,EAAE;YACf,cAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;SAC1B;QACD,cAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,GAAG;YACd,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;YAC3D,QAAQ,EAAK,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,MAAG;SACtD,CAAC,CAAC;KACJ;AACH,CAAC;AAfD,wCAeC;AAED;;GAEG;AACH,SAAgB,SAAS;IACvB,OAAO,cAAM,CAAC;AAChB,CAAC;AAFD,8BAEC;AAED;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,GAAW;IAClC,OAAO,cAAM,CAAC,SAAS,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,KAAK,GAAG,EAArB,CAAqB,CAAC,CAAC;AACxD,CAAC;AAFD,4BAEC","sourcesContent":["import { DebugImage } from '@sentry/types';\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 if (buildIds.length > 0) {\n const firstBuildId = new Uint8Array(buildIds[0]);\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 if (externalDebugInfo.length > 0) {\n const firstExternalDebugInfo = new Uint8Array(externalDebugInfo[0]);\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 = IMAGES.findIndex(img => img.code_file === url);\n if (oldIdx >= 0) {\n IMAGES.splice(oldIdx, 1);\n }\n IMAGES.push({\n type: 'wasm',\n code_id: buildId,\n code_file: url,\n debug_file: debugFile ? new URL(debugFile, url).href : null,\n debug_id: `${buildId.padEnd(32, '0').substr(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(img => img.code_file === url);\n}\n"]}
1
+ {"version":3,"file":"registry.js","sources":["../../../src/registry.ts"],"sourcesContent":["import { DebugImage } from '@sentry/types';\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 if (buildIds.length > 0) {\n const firstBuildId = new Uint8Array(buildIds[0]);\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 if (externalDebugInfo.length > 0) {\n const firstExternalDebugInfo = new Uint8Array(externalDebugInfo[0]);\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 = IMAGES.findIndex(img => img.code_file === url);\n if (oldIdx >= 0) {\n IMAGES.splice(oldIdx, 1);\n }\n IMAGES.push({\n type: 'wasm',\n code_id: buildId,\n code_file: url,\n debug_file: debugFile ? new URL(debugFile, url).href : null,\n debug_id: `${buildId.padEnd(32, '0').substr(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(img => img.code_file === url);\n}\n"],"names":[],"mappings":";;;;AASA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;"}
package/esm/index.js CHANGED
@@ -1,70 +1,72 @@
1
- import { patchWebAssembly } from './patchWebAssembly';
2
- import { getImage, getImages } from './registry';
1
+ import { _optionalChain } from '@sentry/utils/esm/buildPolyfills';
2
+ import { patchWebAssembly } from './patchWebAssembly.js';
3
+ import { getImage, getImages } from './registry.js';
4
+
3
5
  /** plz don't */
4
6
  function patchFrames(frames) {
5
- var haveWasm = false;
6
- frames.forEach(function (frame) {
7
- if (!frame.filename) {
8
- return;
9
- }
10
- var match = frame.filename.match(/^(.*?):wasm-function\[\d+\]:(0x[a-fA-F0-9]+)$/);
11
- if (match !== null) {
12
- var index = getImage(match[1]);
13
- if (index >= 0) {
14
- frame.instruction_addr = match[2];
15
- frame.addr_mode = "rel:" + index;
16
- frame.filename = match[1];
17
- frame.platform = 'native';
18
- haveWasm = true;
19
- }
20
- }
21
- });
22
- return haveWasm;
7
+ let haveWasm = false;
8
+ frames.forEach(frame => {
9
+ if (!frame.filename) {
10
+ return;
11
+ }
12
+ var match = frame.filename.match(/^(.*?):wasm-function\[\d+\]:(0x[a-fA-F0-9]+)$/);
13
+ if (match !== null) {
14
+ var index = getImage(match[1]);
15
+ if (index >= 0) {
16
+ frame.instruction_addr = match[2];
17
+ frame.addr_mode = `rel:${index}`;
18
+ frame.filename = match[1];
19
+ frame.platform = 'native';
20
+ haveWasm = true;
21
+ }
22
+ }
23
+ });
24
+ return haveWasm;
23
25
  }
26
+
24
27
  /**
25
28
  * Process WASM stack traces to support server-side symbolication.
26
29
  *
27
30
  * This also hooks the WebAssembly loading browser API so that module
28
31
  * registraitons are intercepted.
29
32
  */
30
- var Wasm = /** @class */ (function () {
31
- function Wasm() {
32
- /**
33
- * @inheritDoc
34
- */
35
- this.name = Wasm.id;
36
- }
37
- /**
38
- * @inheritDoc
39
- */
40
- Wasm.prototype.setupOnce = function (addGlobalEventProcessor, _getCurrentHub) {
41
- patchWebAssembly();
42
- addGlobalEventProcessor(function (event) {
43
- var _a;
44
- var haveWasm = false;
45
- if (event.exception && event.exception.values) {
46
- event.exception.values.forEach(function (exception) {
47
- var _a;
48
- if ((_a = exception === null || exception === void 0 ? void 0 : exception.stacktrace) === null || _a === void 0 ? void 0 : _a.frames) {
49
- haveWasm = haveWasm || patchFrames(exception.stacktrace.frames);
50
- }
51
- });
52
- }
53
- if ((_a = event.stacktrace) === null || _a === void 0 ? void 0 : _a.frames) {
54
- haveWasm = haveWasm || patchFrames(event.stacktrace.frames);
55
- }
56
- if (haveWasm) {
57
- event.debug_meta = event.debug_meta || {};
58
- event.debug_meta.images = getImages();
59
- }
60
- return event;
33
+ class Wasm {constructor() { Wasm.prototype.__init.call(this); }
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ static __initStatic() {this.id = 'Wasm';}
38
+
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ __init() {this.name = Wasm.id;}
43
+
44
+ /**
45
+ * @inheritDoc
46
+ */
47
+ setupOnce(addGlobalEventProcessor, _getCurrentHub) {
48
+ patchWebAssembly();
49
+
50
+ addGlobalEventProcessor((event) => {
51
+ let haveWasm = false;
52
+
53
+ if (event.exception && event.exception.values) {
54
+ event.exception.values.forEach(exception => {
55
+ if (_optionalChain([exception, 'optionalAccess', _ => _.stacktrace, 'optionalAccess', _2 => _2.frames])) {
56
+ haveWasm = haveWasm || patchFrames(exception.stacktrace.frames);
57
+ }
61
58
  });
62
- };
63
- /**
64
- * @inheritDoc
65
- */
66
- Wasm.id = 'Wasm';
67
- return Wasm;
68
- }());
59
+ }
60
+
61
+ if (haveWasm) {
62
+ event.debug_meta = event.debug_meta || {};
63
+ event.debug_meta.images = getImages();
64
+ }
65
+
66
+ return event;
67
+ });
68
+ }
69
+ }Wasm.__initStatic();
70
+
69
71
  export { Wasm };
70
- //# sourceMappingURL=index.js.map
72
+ //# sourceMappingURL=index.js.map
package/esm/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAEjD,gBAAgB;AAChB,SAAS,WAAW,CAAC,MAAyB;IAC5C,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,CAAC,OAAO,CAAC,UAAA,KAAK;QAClB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;YACnB,OAAO;SACR;QACD,IAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACpF,IAAI,KAAK,KAAK,IAAI,EAAE;YAClB,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CAAC,UAAU,IAAI,EAAE,CAAC;gBAC1C,KAAK,CAAC,UAAU,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;aACvC;YAED,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;IACL,CAAC;IArCD;;OAEG;IACW,OAAE,GAAW,MAAM,CAAC;IAmCpC,WAAC;CAAA,AAvCD,IAuCC;SAvCY,IAAI","sourcesContent":["import { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types';\n\nimport { patchWebAssembly } from './patchWebAssembly';\nimport { getImage, getImages } from './registry';\n\n/** plz don't */\nfunction patchFrames(frames: Array<StackFrame>): boolean {\n let haveWasm = false;\n frames.forEach(frame => {\n if (!frame.filename) {\n return;\n }\n const match = frame.filename.match(/^(.*?):wasm-function\\[\\d+\\]:(0x[a-fA-F0-9]+)$/);\n if (match !== null) {\n const index = getImage(match[1]);\n if (index >= 0) {\n frame.instruction_addr = match[2];\n frame.addr_mode = `rel:${index}`;\n frame.filename = match[1];\n frame.platform = 'native';\n haveWasm = true;\n }\n }\n });\n return haveWasm;\n}\n\n/**\n * Process WASM stack traces to support server-side symbolication.\n *\n * This also hooks the WebAssembly loading browser API so that module\n * registraitons are intercepted.\n */\nexport class Wasm implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Wasm';\n\n /**\n * @inheritDoc\n */\n public name: string = Wasm.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void {\n patchWebAssembly();\n\n addGlobalEventProcessor((event: Event) => {\n let haveWasm = false;\n\n if (event.exception && event.exception.values) {\n event.exception.values.forEach(exception => {\n if (exception?.stacktrace?.frames) {\n haveWasm = haveWasm || patchFrames(exception.stacktrace.frames);\n }\n });\n }\n if (event.stacktrace?.frames) {\n haveWasm = haveWasm || patchFrames(event.stacktrace.frames);\n }\n\n if (haveWasm) {\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = getImages();\n }\n\n return event;\n });\n }\n}\n"]}
1
+ {"version":3,"file":"index.js","sources":["../../../src/index.ts"],"sourcesContent":["import { Event, EventProcessor, Hub, Integration, StackFrame } from '@sentry/types';\n\nimport { patchWebAssembly } from './patchWebAssembly';\nimport { getImage, getImages } from './registry';\n\n/** plz don't */\nfunction patchFrames(frames: Array<StackFrame>): boolean {\n let haveWasm = false;\n frames.forEach(frame => {\n if (!frame.filename) {\n return;\n }\n const match = frame.filename.match(/^(.*?):wasm-function\\[\\d+\\]:(0x[a-fA-F0-9]+)$/);\n if (match !== null) {\n const index = getImage(match[1]);\n if (index >= 0) {\n frame.instruction_addr = match[2];\n frame.addr_mode = `rel:${index}`;\n frame.filename = match[1];\n frame.platform = 'native';\n haveWasm = true;\n }\n }\n });\n return haveWasm;\n}\n\n/**\n * Process WASM stack traces to support server-side symbolication.\n *\n * This also hooks the WebAssembly loading browser API so that module\n * registraitons are intercepted.\n */\nexport class Wasm implements Integration {\n /**\n * @inheritDoc\n */\n public static id: string = 'Wasm';\n\n /**\n * @inheritDoc\n */\n public name: string = Wasm.id;\n\n /**\n * @inheritDoc\n */\n public setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void {\n patchWebAssembly();\n\n addGlobalEventProcessor((event: Event) => {\n let haveWasm = false;\n\n if (event.exception && event.exception.values) {\n event.exception.values.forEach(exception => {\n if (exception?.stacktrace?.frames) {\n haveWasm = haveWasm || patchFrames(exception.stacktrace.frames);\n }\n });\n }\n\n if (haveWasm) {\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = getImages();\n }\n\n return event;\n });\n }\n}\n"],"names":[],"mappings":";;;;AAKA;AACA;;;;;;;;;;;;;;;;;;;AAmBA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA;;"}
@@ -1,33 +1,42 @@
1
- import { registerModule } from './registry';
1
+ import { registerModule } from './registry.js';
2
+
2
3
  /**
3
4
  * Patches the web assembly runtime.
4
5
  */
5
- export function patchWebAssembly() {
6
- if ('instantiateStreaming' in WebAssembly) {
7
- var origInstantiateStreaming_1 = WebAssembly.instantiateStreaming;
8
- WebAssembly.instantiateStreaming = function instantiateStreaming(response, importObject) {
9
- return Promise.resolve(response).then(function (response) {
10
- return origInstantiateStreaming_1(response, importObject).then(function (rv) {
11
- if (response.url) {
12
- registerModule(rv.module, response.url);
13
- }
14
- return rv;
15
- });
16
- });
17
- };
18
- }
19
- if ('compileStreaming' in WebAssembly) {
20
- var origCompileStreaming_1 = WebAssembly.compileStreaming;
21
- WebAssembly.compileStreaming = function compileStreaming(source) {
22
- return Promise.resolve(source).then(function (response) {
23
- return origCompileStreaming_1(response).then(function (module) {
24
- if (response.url) {
25
- registerModule(module, response.url);
26
- }
27
- return module;
28
- });
29
- });
30
- };
31
- }
6
+ function patchWebAssembly() {
7
+ if ('instantiateStreaming' in WebAssembly) {
8
+ var origInstantiateStreaming = WebAssembly.instantiateStreaming;
9
+ WebAssembly.instantiateStreaming = function instantiateStreaming(
10
+ response,
11
+ importObject,
12
+ ) {
13
+ return Promise.resolve(response).then(response => {
14
+ return origInstantiateStreaming(response, importObject).then(rv => {
15
+ if (response.url) {
16
+ registerModule(rv.module, response.url);
17
+ }
18
+ return rv;
19
+ });
20
+ });
21
+ } ;
22
+ }
23
+
24
+ if ('compileStreaming' in WebAssembly) {
25
+ var origCompileStreaming = WebAssembly.compileStreaming;
26
+ WebAssembly.compileStreaming = function compileStreaming(
27
+ source,
28
+ ) {
29
+ return Promise.resolve(source).then(response => {
30
+ return origCompileStreaming(response).then(module => {
31
+ if (response.url) {
32
+ registerModule(module, response.url);
33
+ }
34
+ return module;
35
+ });
36
+ });
37
+ } ;
38
+ }
32
39
  }
33
- //# sourceMappingURL=patchWebAssembly.js.map
40
+
41
+ export { patchWebAssembly };
42
+ //# sourceMappingURL=patchWebAssembly.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patchWebAssembly.js","sourceRoot":"","sources":["../../../src/patchW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ly 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"]}
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;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;"}
package/esm/registry.js CHANGED
@@ -1,59 +1,68 @@
1
- export var IMAGES = [];
1
+ var IMAGES = [];
2
+
2
3
  /**
3
4
  * Returns the extracted meta information from a web assembly module that
4
5
  * Sentry uses to identify debug images.
5
6
  *
6
7
  * @param module
7
8
  */
8
- export function getModuleInfo(module) {
9
- var buildIds = WebAssembly.Module.customSections(module, 'build_id');
10
- var buildId = null;
11
- var debugFile = null;
12
- if (buildIds.length > 0) {
13
- var firstBuildId = new Uint8Array(buildIds[0]);
14
- buildId = Array.from(firstBuildId).reduce(function (acc, x) {
15
- return acc + x.toString(16).padStart(2, '0');
16
- }, '');
17
- }
18
- var externalDebugInfo = WebAssembly.Module.customSections(module, 'external_debug_info');
19
- if (externalDebugInfo.length > 0) {
20
- var firstExternalDebugInfo = new Uint8Array(externalDebugInfo[0]);
21
- var decoder = new TextDecoder('utf-8');
22
- debugFile = decoder.decode(firstExternalDebugInfo);
23
- }
24
- return { buildId: buildId, debugFile: debugFile };
9
+ function getModuleInfo(module) {
10
+ var buildIds = WebAssembly.Module.customSections(module, 'build_id');
11
+ let buildId = null;
12
+ let debugFile = null;
13
+
14
+ if (buildIds.length > 0) {
15
+ var firstBuildId = new Uint8Array(buildIds[0]);
16
+ buildId = Array.from(firstBuildId).reduce((acc, x) => {
17
+ return acc + x.toString(16).padStart(2, '0');
18
+ }, '');
19
+ }
20
+
21
+ var externalDebugInfo = WebAssembly.Module.customSections(module, 'external_debug_info');
22
+ if (externalDebugInfo.length > 0) {
23
+ var firstExternalDebugInfo = new Uint8Array(externalDebugInfo[0]);
24
+ var decoder = new TextDecoder('utf-8');
25
+ debugFile = decoder.decode(firstExternalDebugInfo);
26
+ }
27
+
28
+ return { buildId, debugFile };
25
29
  }
30
+
26
31
  /**
27
32
  * Records a module
28
33
  */
29
- export function registerModule(module, url) {
30
- var _a = getModuleInfo(module), buildId = _a.buildId, debugFile = _a.debugFile;
31
- if (buildId) {
32
- var oldIdx = IMAGES.findIndex(function (img) { return img.code_file === url; });
33
- if (oldIdx >= 0) {
34
- IMAGES.splice(oldIdx, 1);
35
- }
36
- IMAGES.push({
37
- type: 'wasm',
38
- code_id: buildId,
39
- code_file: url,
40
- debug_file: debugFile ? new URL(debugFile, url).href : null,
41
- debug_id: buildId.padEnd(32, '0').substr(0, 32) + "0",
42
- });
34
+ function registerModule(module, url) {
35
+ const { buildId, debugFile } = getModuleInfo(module);
36
+ if (buildId) {
37
+ var oldIdx = IMAGES.findIndex(img => img.code_file === url);
38
+ if (oldIdx >= 0) {
39
+ IMAGES.splice(oldIdx, 1);
43
40
  }
41
+ IMAGES.push({
42
+ type: 'wasm',
43
+ code_id: buildId,
44
+ code_file: url,
45
+ debug_file: debugFile ? new URL(debugFile, url).href : null,
46
+ debug_id: `${buildId.padEnd(32, '0').substr(0, 32)}0`,
47
+ });
48
+ }
44
49
  }
50
+
45
51
  /**
46
52
  * Returns all known images.
47
53
  */
48
- export function getImages() {
49
- return IMAGES;
54
+ function getImages() {
55
+ return IMAGES;
50
56
  }
57
+
51
58
  /**
52
59
  * Looks up an image by URL.
53
60
  *
54
61
  * @param url the URL of the WebAssembly module.
55
62
  */
56
- export function getImage(url) {
57
- return IMAGES.findIndex(function (img) { return img.code_file === url; });
63
+ function getImage(url) {
64
+ return IMAGES.findIndex(img => img.code_file === url);
58
65
  }
59
- //# sourceMappingURL=registry.js.map
66
+
67
+ export { IMAGES, getImage, getImages, getModuleInfo, registerModule };
68
+ //# sourceMappingURL=registry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/registry.ts"],"names":[],"mappings":"AAEA,MAAM,C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AAC,SAAS,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,KAAK,GAAG,EAArB,CAAqB,CAAC,CAAC;QAC9D,IAAI,MAAM,IAAI,CAAC,EAAE;YACf,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;SAC1B;QACD,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,OAAO;YAChB,SAAS,EAAE,GAAG;YACd,UAAU,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI;YAC3D,QAAQ,EAAK,OAAO,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,MAAG;SACtD,CAAC,CAAC;KACJ;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,GAAW;IAClC,OAAO,MAAM,CAAC,SAAS,CAAC,UAAA,GAAG,IAAI,OAAA,GAAG,CAAC,SAAS,KAAK,GAAG,EAArB,CAAqB,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import { DebugImage } from '@sentry/types';\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 if (buildIds.length > 0) {\n const firstBuildId = new Uint8Array(buildIds[0]);\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 if (externalDebugInfo.length > 0) {\n const firstExternalDebugInfo = new Uint8Array(externalDebugInfo[0]);\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 = IMAGES.findIndex(img => img.code_file === url);\n if (oldIdx >= 0) {\n IMAGES.splice(oldIdx, 1);\n }\n IMAGES.push({\n type: 'wasm',\n code_id: buildId,\n code_file: url,\n debug_file: debugFile ? new URL(debugFile, url).href : null,\n debug_id: `${buildId.padEnd(32, '0').substr(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(img => img.code_file === url);\n}\n"]}
1
+ {"version":3,"file":"registry.js","sources":["../../../src/registry.ts"],"sourcesContent":["import { DebugImage } from '@sentry/types';\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 if (buildIds.length > 0) {\n const firstBuildId = new Uint8Array(buildIds[0]);\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 if (externalDebugInfo.length > 0) {\n const firstExternalDebugInfo = new Uint8Array(externalDebugInfo[0]);\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 = IMAGES.findIndex(img => img.code_file === url);\n if (oldIdx >= 0) {\n IMAGES.splice(oldIdx, 1);\n }\n IMAGES.push({\n type: 'wasm',\n code_id: buildId,\n code_file: url,\n debug_file: debugFile ? new URL(debugFile, url).href : null,\n debug_id: `${buildId.padEnd(32, '0').substr(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(img => img.code_file === url);\n}\n"],"names":[],"mappings":";;AASA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/wasm",
3
- "version": "7.0.0-alpha.0",
3
+ "version": "7.0.0-beta.1",
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",
@@ -16,8 +16,9 @@
16
16
  "access": "public"
17
17
  },
18
18
  "dependencies": {
19
- "@sentry/browser": "7.0.0-alpha.0",
20
- "@sentry/types": "7.0.0-alpha.0",
19
+ "@sentry/browser": "7.0.0-beta.1",
20
+ "@sentry/types": "7.0.0-beta.1",
21
+ "@sentry/utils": "7.0.0-beta.1",
21
22
  "tslib": "^1.9.3"
22
23
  },
23
24
  "devDependencies": {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,GAAG,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AA2BpF;;;;;GAKG;AACH,qBAAa,IAAK,YAAW,WAAW;IACtC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAU;IAElC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAW;IAE9B;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,cAAc,EAAE,MAAM,GAAG,GAAG,IAAI;CAyB/G"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,GAAG,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AA2BpF;;;;;GAKG;AACH,qBAAa,IAAK,YAAW,WAAW;IACtC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAU;IAElC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAW;IAE9B;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,cAAc,EAAE,MAAM,GAAG,GAAG,IAAI;CAsB/G"}
package/cjs/index.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import { EventProcessor, Hub, Integration } from '@sentry/types';
2
- /**
3
- * Process WASM stack traces to support server-side symbolication.
4
- *
5
- * This also hooks the WebAssembly loading browser API so that module
6
- * registraitons are intercepted.
7
- */
8
- export declare class Wasm implements Integration {
9
- /**
10
- * @inheritDoc
11
- */
12
- static id: string;
13
- /**
14
- * @inheritDoc
15
- */
16
- name: string;
17
- /**
18
- * @inheritDoc
19
- */
20
- setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void;
21
- }
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,GAAG,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AA2BpF;;;;;GAKG;AACH,qBAAa,IAAK,YAAW,WAAW;IACtC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAU;IAElC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAW;IAE9B;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,cAAc,EAAE,MAAM,GAAG,GAAG,IAAI;CAyB/G"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Patches the web assembly runtime.
3
- */
4
- export declare function patchWebAssembly(): void;
5
- //# sourceMappingURL=patchWebAssembly.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"patchWebAssembly.d.ts","sourceRoot":"","sources":["../../../src/patchWebAssembly.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAiCvC"}
package/cjs/registry.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import { DebugImage } from '@sentry/types';
2
- export declare const IMAGES: Array<DebugImage>;
3
- export interface ModuleInfo {
4
- buildId: string | null;
5
- debugFile: string | null;
6
- }
7
- /**
8
- * Returns the extracted meta information from a web assembly module that
9
- * Sentry uses to identify debug images.
10
- *
11
- * @param module
12
- */
13
- export declare function getModuleInfo(module: WebAssembly.Module): ModuleInfo;
14
- /**
15
- * Records a module
16
- */
17
- export declare function registerModule(module: WebAssembly.Module, url: string): void;
18
- /**
19
- * Returns all known images.
20
- */
21
- export declare function getImages(): Array<DebugImage>;
22
- /**
23
- * Looks up an image by URL.
24
- *
25
- * @param url the URL of the WebAssembly module.
26
- */
27
- export declare function getImage(url: string): number;
28
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,UAAU,CAAM,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,UAAU,CAoBpE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAe5E;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"}
package/esm/index.d.ts DELETED
@@ -1,22 +0,0 @@
1
- import { EventProcessor, Hub, Integration } from '@sentry/types';
2
- /**
3
- * Process WASM stack traces to support server-side symbolication.
4
- *
5
- * This also hooks the WebAssembly loading browser API so that module
6
- * registraitons are intercepted.
7
- */
8
- export declare class Wasm implements Integration {
9
- /**
10
- * @inheritDoc
11
- */
12
- static id: string;
13
- /**
14
- * @inheritDoc
15
- */
16
- name: string;
17
- /**
18
- * @inheritDoc
19
- */
20
- setupOnce(addGlobalEventProcessor: (callback: EventProcessor) => void, _getCurrentHub: () => Hub): void;
21
- }
22
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,cAAc,EAAE,GAAG,EAAE,WAAW,EAAc,MAAM,eAAe,CAAC;AA2BpF;;;;;GAKG;AACH,qBAAa,IAAK,YAAW,WAAW;IACtC;;OAEG;IACH,OAAc,EAAE,EAAE,MAAM,CAAU;IAElC;;OAEG;IACI,IAAI,EAAE,MAAM,CAAW;IAE9B;;OAEG;IACI,SAAS,CAAC,uBAAuB,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,IAAI,EAAE,cAAc,EAAE,MAAM,GAAG,GAAG,IAAI;CAyB/G"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Patches the web assembly runtime.
3
- */
4
- export declare function patchWebAssembly(): void;
5
- //# sourceMappingURL=patchWebAssembly.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"patchWebAssembly.d.ts","sourceRoot":"","sources":["../../../src/patchWebAssembly.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,IAAI,CAiCvC"}
package/esm/registry.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import { DebugImage } from '@sentry/types';
2
- export declare const IMAGES: Array<DebugImage>;
3
- export interface ModuleInfo {
4
- buildId: string | null;
5
- debugFile: string | null;
6
- }
7
- /**
8
- * Returns the extracted meta information from a web assembly module that
9
- * Sentry uses to identify debug images.
10
- *
11
- * @param module
12
- */
13
- export declare function getModuleInfo(module: WebAssembly.Module): ModuleInfo;
14
- /**
15
- * Records a module
16
- */
17
- export declare function registerModule(module: WebAssembly.Module, url: string): void;
18
- /**
19
- * Returns all known images.
20
- */
21
- export declare function getImages(): Array<DebugImage>;
22
- /**
23
- * Looks up an image by URL.
24
- *
25
- * @param url the URL of the WebAssembly module.
26
- */
27
- export declare function getImage(url: string): number;
28
- //# sourceMappingURL=registry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,UAAU,CAAM,CAAC;AAE5C,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,GAAG,UAAU,CAoBpE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAe5E;AAED;;GAEG;AACH,wBAAgB,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,CAE7C;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE5C"}