@sentry/wasm 7.0.0-alpha.1 → 7.0.0-beta.2
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 +2 -3
- package/cjs/index.js +66 -56
- package/cjs/index.js.map +1 -1
- package/cjs/patchWebAssembly.js +38 -29
- package/cjs/patchWebAssembly.js.map +1 -1
- package/cjs/registry.js +47 -37
- package/cjs/registry.js.map +1 -1
- package/esm/index.js +61 -55
- package/esm/index.js.map +1 -1
- package/esm/patchWebAssembly.js +38 -29
- package/esm/patchWebAssembly.js.map +1 -1
- package/esm/registry.js +46 -37
- package/esm/registry.js.map +1 -1
- package/package.json +4 -3
- package/cjs/index.d.ts +0 -22
- package/cjs/index.d.ts.map +0 -1
- package/cjs/patchWebAssembly.d.ts +0 -5
- package/cjs/patchWebAssembly.d.ts.map +0 -1
- package/cjs/registry.d.ts +0 -28
- package/cjs/registry.d.ts.map +0 -1
- package/esm/index.d.ts +0 -22
- package/esm/index.d.ts.map +0 -1
- package/esm/patchWebAssembly.d.ts +0 -5
- package/esm/patchWebAssembly.d.ts.map +0 -1
- package/esm/registry.d.ts +0 -28
- package/esm/registry.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="https://sentry.io" target="_blank"
|
|
3
|
-
<img src="https://sentry-brand.storage.googleapis.com/sentry-
|
|
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,67 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
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
|
+
}
|
|
58
63
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
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
|
+
|
|
66
76
|
exports.Wasm = Wasm;
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
package/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
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;;"}
|
package/cjs/patchWebAssembly.js
CHANGED
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
Object.defineProperty(exports,
|
|
2
|
-
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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","
|
|
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,
|
|
2
|
-
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
32
|
+
|
|
28
33
|
/**
|
|
29
34
|
* Records a module
|
|
30
35
|
*/
|
|
31
36
|
function registerModule(module, url) {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
52
|
+
|
|
48
53
|
/**
|
|
49
54
|
* Returns all known images.
|
|
50
55
|
*/
|
|
51
56
|
function getImages() {
|
|
52
|
-
|
|
57
|
+
return IMAGES;
|
|
53
58
|
}
|
|
54
|
-
|
|
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
|
-
|
|
66
|
+
return IMAGES.findIndex(img => img.code_file === url);
|
|
62
67
|
}
|
|
68
|
+
|
|
69
|
+
exports.IMAGES = IMAGES;
|
|
63
70
|
exports.getImage = getImage;
|
|
64
|
-
|
|
71
|
+
exports.getImages = getImages;
|
|
72
|
+
exports.getModuleInfo = getModuleInfo;
|
|
73
|
+
exports.registerModule = registerModule;
|
|
74
|
+
//# sourceMappingURL=registry.js.map
|
package/cjs/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","
|
|
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,66 +1,72 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
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
|
+
}
|
|
57
58
|
});
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
|
|
65
71
|
export { Wasm };
|
|
66
|
-
//# sourceMappingURL=index.js.map
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
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;;"}
|
package/esm/patchWebAssembly.js
CHANGED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
-
|
|
40
|
+
|
|
41
|
+
export { patchWebAssembly };
|
|
42
|
+
//# sourceMappingURL=patchWebAssembly.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patchWebAssembly.js","
|
|
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
|
-
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
49
|
-
|
|
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
|
-
|
|
57
|
-
|
|
63
|
+
function getImage(url) {
|
|
64
|
+
return IMAGES.findIndex(img => img.code_file === url);
|
|
58
65
|
}
|
|
59
|
-
|
|
66
|
+
|
|
67
|
+
export { IMAGES, getImage, getImages, getModuleInfo, registerModule };
|
|
68
|
+
//# sourceMappingURL=registry.js.map
|
package/esm/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","
|
|
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-
|
|
3
|
+
"version": "7.0.0-beta.2",
|
|
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-
|
|
20
|
-
"@sentry/types": "7.0.0-
|
|
19
|
+
"@sentry/browser": "7.0.0-beta.2",
|
|
20
|
+
"@sentry/types": "7.0.0-beta.2",
|
|
21
|
+
"@sentry/utils": "7.0.0-beta.2",
|
|
21
22
|
"tslib": "^1.9.3"
|
|
22
23
|
},
|
|
23
24
|
"devDependencies": {
|
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
|
package/cjs/index.d.ts.map
DELETED
|
@@ -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;CAsB/G"}
|
|
@@ -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
|
package/cjs/registry.d.ts.map
DELETED
|
@@ -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
|
package/esm/index.d.ts.map
DELETED
|
@@ -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;CAsB/G"}
|
|
@@ -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
|
package/esm/registry.d.ts.map
DELETED
|
@@ -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"}
|