@srcmap/symbolicate-wasm 0.1.3 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +112 -0
- package/package.json +1 -1
- package/pkg/README.md +112 -0
- package/pkg/package.json +2 -2
- package/pkg/srcmap_symbolicate_wasm_bg.wasm +0 -0
- package/web/package.json +0 -21
- package/web/srcmap_symbolicate_wasm.d.ts +0 -53
- package/web/srcmap_symbolicate_wasm.js +0 -345
- package/web/srcmap_symbolicate_wasm_bg.wasm +0 -0
- package/web/srcmap_symbolicate_wasm_bg.wasm.d.ts +0 -10
package/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# @srcmap/symbolicate-wasm
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@srcmap/symbolicate-wasm)
|
|
4
|
+
[](https://github.com/BartWaardenburg/srcmap/actions/workflows/ci.yml)
|
|
5
|
+
|
|
6
|
+
Stack trace symbolication using source maps, powered by Rust via WebAssembly.
|
|
7
|
+
|
|
8
|
+
Parses stack traces from V8 (Chrome, Node.js), SpiderMonkey (Firefox), and JavaScriptCore (Safari), resolves each frame through source maps, and produces readable output. Built for error monitoring, crash reporting, and debugging services.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @srcmap/symbolicate-wasm
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Works in Node.js, browsers, and any WebAssembly-capable runtime. No native compilation required.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Symbolicate a stack trace
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { symbolicate } from '@srcmap/symbolicate-wasm'
|
|
24
|
+
|
|
25
|
+
const stack = `Error: Something went wrong
|
|
26
|
+
at handleClick (bundle.js:42:10)
|
|
27
|
+
at processEvent (bundle.js:108:5)`
|
|
28
|
+
|
|
29
|
+
const result = symbolicate(stack, (file) => {
|
|
30
|
+
// Called for each unique source file in the stack trace
|
|
31
|
+
if (file === 'bundle.js') {
|
|
32
|
+
return sourceMapJsonString // source map JSON for this file
|
|
33
|
+
}
|
|
34
|
+
return null // no source map available
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
// result is a JSON string:
|
|
38
|
+
// {
|
|
39
|
+
// "message": "Error: Something went wrong",
|
|
40
|
+
// "frames": [
|
|
41
|
+
// { "functionName": "handleClick", "file": "src/app.ts", "line": 10, "column": 4, "symbolicated": true },
|
|
42
|
+
// { "functionName": "processEvent", "file": "src/events.ts", "line": 25, "column": 1, "symbolicated": true }
|
|
43
|
+
// ]
|
|
44
|
+
// }
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Parse a stack trace (without symbolication)
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { parseStackTrace } from '@srcmap/symbolicate-wasm'
|
|
51
|
+
|
|
52
|
+
const frames = parseStackTrace(stack)
|
|
53
|
+
// [
|
|
54
|
+
// { functionName: 'handleClick', file: 'bundle.js', line: 42, column: 10 },
|
|
55
|
+
// { functionName: 'processEvent', file: 'bundle.js', line: 108, column: 5 }
|
|
56
|
+
// ]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## API
|
|
60
|
+
|
|
61
|
+
### `symbolicate(stack, loader)`
|
|
62
|
+
|
|
63
|
+
Symbolicate a stack trace using a source map loader.
|
|
64
|
+
|
|
65
|
+
| Parameter | Type | Description |
|
|
66
|
+
|-----------|------|-------------|
|
|
67
|
+
| `stack` | `string` | Stack trace string (V8, SpiderMonkey, or JSC format) |
|
|
68
|
+
| `loader` | `(file: string) => string \| null` | Returns source map JSON for a file, or `null` |
|
|
69
|
+
|
|
70
|
+
Returns a JSON string with `message` and `frames` (each frame has `functionName`, `file`, `line`, `column`, `symbolicated`).
|
|
71
|
+
|
|
72
|
+
### `parseStackTrace(stack)`
|
|
73
|
+
|
|
74
|
+
Parse a stack trace into individual frames without symbolication.
|
|
75
|
+
|
|
76
|
+
| Parameter | Type | Description |
|
|
77
|
+
|-----------|------|-------------|
|
|
78
|
+
| `stack` | `string` | Stack trace string |
|
|
79
|
+
|
|
80
|
+
Returns an array of `{ functionName: string | null, file: string, line: number, column: number }`.
|
|
81
|
+
|
|
82
|
+
## Supported formats
|
|
83
|
+
|
|
84
|
+
| Engine | Format |
|
|
85
|
+
|--------|--------|
|
|
86
|
+
| V8 (Chrome, Node.js) | `at func (file:line:col)` |
|
|
87
|
+
| SpiderMonkey (Firefox) | `func@file:line:col` |
|
|
88
|
+
| JavaScriptCore (Safari) | `func@file:line:col` |
|
|
89
|
+
|
|
90
|
+
## Build targets
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Node.js (default)
|
|
94
|
+
npm run build
|
|
95
|
+
|
|
96
|
+
# Browser (ES module + .wasm)
|
|
97
|
+
npm run build:web
|
|
98
|
+
|
|
99
|
+
# Bundler (e.g. webpack, vite)
|
|
100
|
+
npm run build:bundler
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Part of [srcmap](https://github.com/BartWaardenburg/srcmap)
|
|
104
|
+
|
|
105
|
+
High-performance source map tooling written in Rust. See also:
|
|
106
|
+
- [`@srcmap/sourcemap-wasm`](https://www.npmjs.com/package/@srcmap/sourcemap-wasm) - Source map parser (WASM)
|
|
107
|
+
- [`@srcmap/generator-wasm`](https://www.npmjs.com/package/@srcmap/generator-wasm) - Source map generator (WASM)
|
|
108
|
+
- [`@srcmap/remapping-wasm`](https://www.npmjs.com/package/@srcmap/remapping-wasm) - Concatenation + composition (WASM)
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|
package/package.json
CHANGED
package/pkg/README.md
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# @srcmap/symbolicate-wasm
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@srcmap/symbolicate-wasm)
|
|
4
|
+
[](https://github.com/BartWaardenburg/srcmap/actions/workflows/ci.yml)
|
|
5
|
+
|
|
6
|
+
Stack trace symbolication using source maps, powered by Rust via WebAssembly.
|
|
7
|
+
|
|
8
|
+
Parses stack traces from V8 (Chrome, Node.js), SpiderMonkey (Firefox), and JavaScriptCore (Safari), resolves each frame through source maps, and produces readable output. Built for error monitoring, crash reporting, and debugging services.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install @srcmap/symbolicate-wasm
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Works in Node.js, browsers, and any WebAssembly-capable runtime. No native compilation required.
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
### Symbolicate a stack trace
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import { symbolicate } from '@srcmap/symbolicate-wasm'
|
|
24
|
+
|
|
25
|
+
const stack = `Error: Something went wrong
|
|
26
|
+
at handleClick (bundle.js:42:10)
|
|
27
|
+
at processEvent (bundle.js:108:5)`
|
|
28
|
+
|
|
29
|
+
const result = symbolicate(stack, (file) => {
|
|
30
|
+
// Called for each unique source file in the stack trace
|
|
31
|
+
if (file === 'bundle.js') {
|
|
32
|
+
return sourceMapJsonString // source map JSON for this file
|
|
33
|
+
}
|
|
34
|
+
return null // no source map available
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
// result is a JSON string:
|
|
38
|
+
// {
|
|
39
|
+
// "message": "Error: Something went wrong",
|
|
40
|
+
// "frames": [
|
|
41
|
+
// { "functionName": "handleClick", "file": "src/app.ts", "line": 10, "column": 4, "symbolicated": true },
|
|
42
|
+
// { "functionName": "processEvent", "file": "src/events.ts", "line": 25, "column": 1, "symbolicated": true }
|
|
43
|
+
// ]
|
|
44
|
+
// }
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Parse a stack trace (without symbolication)
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { parseStackTrace } from '@srcmap/symbolicate-wasm'
|
|
51
|
+
|
|
52
|
+
const frames = parseStackTrace(stack)
|
|
53
|
+
// [
|
|
54
|
+
// { functionName: 'handleClick', file: 'bundle.js', line: 42, column: 10 },
|
|
55
|
+
// { functionName: 'processEvent', file: 'bundle.js', line: 108, column: 5 }
|
|
56
|
+
// ]
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## API
|
|
60
|
+
|
|
61
|
+
### `symbolicate(stack, loader)`
|
|
62
|
+
|
|
63
|
+
Symbolicate a stack trace using a source map loader.
|
|
64
|
+
|
|
65
|
+
| Parameter | Type | Description |
|
|
66
|
+
|-----------|------|-------------|
|
|
67
|
+
| `stack` | `string` | Stack trace string (V8, SpiderMonkey, or JSC format) |
|
|
68
|
+
| `loader` | `(file: string) => string \| null` | Returns source map JSON for a file, or `null` |
|
|
69
|
+
|
|
70
|
+
Returns a JSON string with `message` and `frames` (each frame has `functionName`, `file`, `line`, `column`, `symbolicated`).
|
|
71
|
+
|
|
72
|
+
### `parseStackTrace(stack)`
|
|
73
|
+
|
|
74
|
+
Parse a stack trace into individual frames without symbolication.
|
|
75
|
+
|
|
76
|
+
| Parameter | Type | Description |
|
|
77
|
+
|-----------|------|-------------|
|
|
78
|
+
| `stack` | `string` | Stack trace string |
|
|
79
|
+
|
|
80
|
+
Returns an array of `{ functionName: string | null, file: string, line: number, column: number }`.
|
|
81
|
+
|
|
82
|
+
## Supported formats
|
|
83
|
+
|
|
84
|
+
| Engine | Format |
|
|
85
|
+
|--------|--------|
|
|
86
|
+
| V8 (Chrome, Node.js) | `at func (file:line:col)` |
|
|
87
|
+
| SpiderMonkey (Firefox) | `func@file:line:col` |
|
|
88
|
+
| JavaScriptCore (Safari) | `func@file:line:col` |
|
|
89
|
+
|
|
90
|
+
## Build targets
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Node.js (default)
|
|
94
|
+
npm run build
|
|
95
|
+
|
|
96
|
+
# Browser (ES module + .wasm)
|
|
97
|
+
npm run build:web
|
|
98
|
+
|
|
99
|
+
# Bundler (e.g. webpack, vite)
|
|
100
|
+
npm run build:bundler
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Part of [srcmap](https://github.com/BartWaardenburg/srcmap)
|
|
104
|
+
|
|
105
|
+
High-performance source map tooling written in Rust. See also:
|
|
106
|
+
- [`@srcmap/sourcemap-wasm`](https://www.npmjs.com/package/@srcmap/sourcemap-wasm) - Source map parser (WASM)
|
|
107
|
+
- [`@srcmap/generator-wasm`](https://www.npmjs.com/package/@srcmap/generator-wasm) - Source map generator (WASM)
|
|
108
|
+
- [`@srcmap/remapping-wasm`](https://www.npmjs.com/package/@srcmap/remapping-wasm) - Concatenation + composition (WASM)
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT
|
package/pkg/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "srcmap-symbolicate-wasm",
|
|
3
3
|
"description": "WebAssembly bindings for srcmap-symbolicate",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/
|
|
8
|
+
"url": "https://github.com/BartWaardenburg/srcmap"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"srcmap_symbolicate_wasm_bg.wasm",
|
|
Binary file
|
package/web/package.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "srcmap-symbolicate-wasm",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"description": "WebAssembly bindings for srcmap-symbolicate",
|
|
5
|
-
"version": "0.1.3",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"repository": {
|
|
8
|
-
"type": "git",
|
|
9
|
-
"url": "https://github.com/bartwaardenburg/srcmap"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"srcmap_symbolicate_wasm_bg.wasm",
|
|
13
|
-
"srcmap_symbolicate_wasm.js",
|
|
14
|
-
"srcmap_symbolicate_wasm.d.ts"
|
|
15
|
-
],
|
|
16
|
-
"main": "srcmap_symbolicate_wasm.js",
|
|
17
|
-
"types": "srcmap_symbolicate_wasm.d.ts",
|
|
18
|
-
"sideEffects": [
|
|
19
|
-
"./snippets/*"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Parse a stack trace string into an array of frame objects.
|
|
6
|
-
* Each frame has: {functionName, file, line, column}
|
|
7
|
-
*/
|
|
8
|
-
export function parseStackTrace(input: string): any[];
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Symbolicate a stack trace using a JavaScript loader function.
|
|
12
|
-
*
|
|
13
|
-
* The loader is called with each unique source file and should return
|
|
14
|
-
* a source map JSON string, or null/undefined if not available.
|
|
15
|
-
*
|
|
16
|
-
* Returns a JSON string with the symbolicated stack.
|
|
17
|
-
*/
|
|
18
|
-
export function symbolicate(input: string, loader: Function): string;
|
|
19
|
-
|
|
20
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
21
|
-
|
|
22
|
-
export interface InitOutput {
|
|
23
|
-
readonly memory: WebAssembly.Memory;
|
|
24
|
-
readonly parseStackTrace: (a: number, b: number, c: number) => void;
|
|
25
|
-
readonly symbolicate: (a: number, b: number, c: number, d: number) => void;
|
|
26
|
-
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
27
|
-
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
28
|
-
readonly __wbindgen_export3: (a: number) => void;
|
|
29
|
-
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
30
|
-
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
37
|
-
* a precompiled `WebAssembly.Module`.
|
|
38
|
-
*
|
|
39
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
40
|
-
*
|
|
41
|
-
* @returns {InitOutput}
|
|
42
|
-
*/
|
|
43
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
47
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
48
|
-
*
|
|
49
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
50
|
-
*
|
|
51
|
-
* @returns {Promise<InitOutput>}
|
|
52
|
-
*/
|
|
53
|
-
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./srcmap_symbolicate_wasm.d.ts" */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Parse a stack trace string into an array of frame objects.
|
|
5
|
-
* Each frame has: {functionName, file, line, column}
|
|
6
|
-
* @param {string} input
|
|
7
|
-
* @returns {any[]}
|
|
8
|
-
*/
|
|
9
|
-
export function parseStackTrace(input) {
|
|
10
|
-
try {
|
|
11
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
12
|
-
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
13
|
-
const len0 = WASM_VECTOR_LEN;
|
|
14
|
-
wasm.parseStackTrace(retptr, ptr0, len0);
|
|
15
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
16
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
17
|
-
var v2 = getArrayJsValueFromWasm0(r0, r1).slice();
|
|
18
|
-
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
19
|
-
return v2;
|
|
20
|
-
} finally {
|
|
21
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Symbolicate a stack trace using a JavaScript loader function.
|
|
27
|
-
*
|
|
28
|
-
* The loader is called with each unique source file and should return
|
|
29
|
-
* a source map JSON string, or null/undefined if not available.
|
|
30
|
-
*
|
|
31
|
-
* Returns a JSON string with the symbolicated stack.
|
|
32
|
-
* @param {string} input
|
|
33
|
-
* @param {Function} loader
|
|
34
|
-
* @returns {string}
|
|
35
|
-
*/
|
|
36
|
-
export function symbolicate(input, loader) {
|
|
37
|
-
let deferred2_0;
|
|
38
|
-
let deferred2_1;
|
|
39
|
-
try {
|
|
40
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
41
|
-
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
42
|
-
const len0 = WASM_VECTOR_LEN;
|
|
43
|
-
wasm.symbolicate(retptr, ptr0, len0, addBorrowedObject(loader));
|
|
44
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
45
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
46
|
-
deferred2_0 = r0;
|
|
47
|
-
deferred2_1 = r1;
|
|
48
|
-
return getStringFromWasm0(r0, r1);
|
|
49
|
-
} finally {
|
|
50
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
51
|
-
heap[stack_pointer++] = undefined;
|
|
52
|
-
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function __wbg_get_imports() {
|
|
57
|
-
const import0 = {
|
|
58
|
-
__proto__: null,
|
|
59
|
-
__wbg___wbindgen_is_null_0b605fc6b167c56f: function(arg0) {
|
|
60
|
-
const ret = getObject(arg0) === null;
|
|
61
|
-
return ret;
|
|
62
|
-
},
|
|
63
|
-
__wbg___wbindgen_is_undefined_52709e72fb9f179c: function(arg0) {
|
|
64
|
-
const ret = getObject(arg0) === undefined;
|
|
65
|
-
return ret;
|
|
66
|
-
},
|
|
67
|
-
__wbg___wbindgen_string_get_395e606bd0ee4427: function(arg0, arg1) {
|
|
68
|
-
const obj = getObject(arg1);
|
|
69
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
70
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
71
|
-
var len1 = WASM_VECTOR_LEN;
|
|
72
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
73
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
74
|
-
},
|
|
75
|
-
__wbg___wbindgen_throw_6ddd609b62940d55: function(arg0, arg1) {
|
|
76
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
77
|
-
},
|
|
78
|
-
__wbg_call_2d781c1f4d5c0ef8: function() { return handleError(function (arg0, arg1, arg2) {
|
|
79
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
80
|
-
return addHeapObject(ret);
|
|
81
|
-
}, arguments); },
|
|
82
|
-
__wbg_new_ab79df5bd7c26067: function() {
|
|
83
|
-
const ret = new Object();
|
|
84
|
-
return addHeapObject(ret);
|
|
85
|
-
},
|
|
86
|
-
__wbg_set_7eaa4f96924fd6b3: function() { return handleError(function (arg0, arg1, arg2) {
|
|
87
|
-
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
88
|
-
return ret;
|
|
89
|
-
}, arguments); },
|
|
90
|
-
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
91
|
-
// Cast intrinsic for `F64 -> Externref`.
|
|
92
|
-
const ret = arg0;
|
|
93
|
-
return addHeapObject(ret);
|
|
94
|
-
},
|
|
95
|
-
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
96
|
-
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
97
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
98
|
-
return addHeapObject(ret);
|
|
99
|
-
},
|
|
100
|
-
__wbindgen_object_drop_ref: function(arg0) {
|
|
101
|
-
takeObject(arg0);
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
return {
|
|
105
|
-
__proto__: null,
|
|
106
|
-
"./srcmap_symbolicate_wasm_bg.js": import0,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function addHeapObject(obj) {
|
|
111
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
112
|
-
const idx = heap_next;
|
|
113
|
-
heap_next = heap[idx];
|
|
114
|
-
|
|
115
|
-
heap[idx] = obj;
|
|
116
|
-
return idx;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function addBorrowedObject(obj) {
|
|
120
|
-
if (stack_pointer == 1) throw new Error('out of js stack');
|
|
121
|
-
heap[--stack_pointer] = obj;
|
|
122
|
-
return stack_pointer;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
function dropObject(idx) {
|
|
126
|
-
if (idx < 1028) return;
|
|
127
|
-
heap[idx] = heap_next;
|
|
128
|
-
heap_next = idx;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function getArrayJsValueFromWasm0(ptr, len) {
|
|
132
|
-
ptr = ptr >>> 0;
|
|
133
|
-
const mem = getDataViewMemory0();
|
|
134
|
-
const result = [];
|
|
135
|
-
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
136
|
-
result.push(takeObject(mem.getUint32(i, true)));
|
|
137
|
-
}
|
|
138
|
-
return result;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
let cachedDataViewMemory0 = null;
|
|
142
|
-
function getDataViewMemory0() {
|
|
143
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
144
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
145
|
-
}
|
|
146
|
-
return cachedDataViewMemory0;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function getStringFromWasm0(ptr, len) {
|
|
150
|
-
ptr = ptr >>> 0;
|
|
151
|
-
return decodeText(ptr, len);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
let cachedUint8ArrayMemory0 = null;
|
|
155
|
-
function getUint8ArrayMemory0() {
|
|
156
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
157
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
158
|
-
}
|
|
159
|
-
return cachedUint8ArrayMemory0;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function getObject(idx) { return heap[idx]; }
|
|
163
|
-
|
|
164
|
-
function handleError(f, args) {
|
|
165
|
-
try {
|
|
166
|
-
return f.apply(this, args);
|
|
167
|
-
} catch (e) {
|
|
168
|
-
wasm.__wbindgen_export3(addHeapObject(e));
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
let heap = new Array(1024).fill(undefined);
|
|
173
|
-
heap.push(undefined, null, true, false);
|
|
174
|
-
|
|
175
|
-
let heap_next = heap.length;
|
|
176
|
-
|
|
177
|
-
function isLikeNone(x) {
|
|
178
|
-
return x === undefined || x === null;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
182
|
-
if (realloc === undefined) {
|
|
183
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
184
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
185
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
186
|
-
WASM_VECTOR_LEN = buf.length;
|
|
187
|
-
return ptr;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
let len = arg.length;
|
|
191
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
192
|
-
|
|
193
|
-
const mem = getUint8ArrayMemory0();
|
|
194
|
-
|
|
195
|
-
let offset = 0;
|
|
196
|
-
|
|
197
|
-
for (; offset < len; offset++) {
|
|
198
|
-
const code = arg.charCodeAt(offset);
|
|
199
|
-
if (code > 0x7F) break;
|
|
200
|
-
mem[ptr + offset] = code;
|
|
201
|
-
}
|
|
202
|
-
if (offset !== len) {
|
|
203
|
-
if (offset !== 0) {
|
|
204
|
-
arg = arg.slice(offset);
|
|
205
|
-
}
|
|
206
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
207
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
208
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
209
|
-
|
|
210
|
-
offset += ret.written;
|
|
211
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
WASM_VECTOR_LEN = offset;
|
|
215
|
-
return ptr;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
let stack_pointer = 1024;
|
|
219
|
-
|
|
220
|
-
function takeObject(idx) {
|
|
221
|
-
const ret = getObject(idx);
|
|
222
|
-
dropObject(idx);
|
|
223
|
-
return ret;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
227
|
-
cachedTextDecoder.decode();
|
|
228
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
229
|
-
let numBytesDecoded = 0;
|
|
230
|
-
function decodeText(ptr, len) {
|
|
231
|
-
numBytesDecoded += len;
|
|
232
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
233
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
234
|
-
cachedTextDecoder.decode();
|
|
235
|
-
numBytesDecoded = len;
|
|
236
|
-
}
|
|
237
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
const cachedTextEncoder = new TextEncoder();
|
|
241
|
-
|
|
242
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
243
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
244
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
245
|
-
view.set(buf);
|
|
246
|
-
return {
|
|
247
|
-
read: arg.length,
|
|
248
|
-
written: buf.length
|
|
249
|
-
};
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
let WASM_VECTOR_LEN = 0;
|
|
254
|
-
|
|
255
|
-
let wasmModule, wasm;
|
|
256
|
-
function __wbg_finalize_init(instance, module) {
|
|
257
|
-
wasm = instance.exports;
|
|
258
|
-
wasmModule = module;
|
|
259
|
-
cachedDataViewMemory0 = null;
|
|
260
|
-
cachedUint8ArrayMemory0 = null;
|
|
261
|
-
return wasm;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
async function __wbg_load(module, imports) {
|
|
265
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
266
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
267
|
-
try {
|
|
268
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
269
|
-
} catch (e) {
|
|
270
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
271
|
-
|
|
272
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
273
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
274
|
-
|
|
275
|
-
} else { throw e; }
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
const bytes = await module.arrayBuffer();
|
|
280
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
281
|
-
} else {
|
|
282
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
283
|
-
|
|
284
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
285
|
-
return { instance, module };
|
|
286
|
-
} else {
|
|
287
|
-
return instance;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
function expectedResponseType(type) {
|
|
292
|
-
switch (type) {
|
|
293
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
294
|
-
}
|
|
295
|
-
return false;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
function initSync(module) {
|
|
300
|
-
if (wasm !== undefined) return wasm;
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
if (module !== undefined) {
|
|
304
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
305
|
-
({module} = module)
|
|
306
|
-
} else {
|
|
307
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
const imports = __wbg_get_imports();
|
|
312
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
313
|
-
module = new WebAssembly.Module(module);
|
|
314
|
-
}
|
|
315
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
316
|
-
return __wbg_finalize_init(instance, module);
|
|
317
|
-
}
|
|
318
|
-
|
|
319
|
-
async function __wbg_init(module_or_path) {
|
|
320
|
-
if (wasm !== undefined) return wasm;
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (module_or_path !== undefined) {
|
|
324
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
325
|
-
({module_or_path} = module_or_path)
|
|
326
|
-
} else {
|
|
327
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if (module_or_path === undefined) {
|
|
332
|
-
module_or_path = new URL('srcmap_symbolicate_wasm_bg.wasm', import.meta.url);
|
|
333
|
-
}
|
|
334
|
-
const imports = __wbg_get_imports();
|
|
335
|
-
|
|
336
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
337
|
-
module_or_path = fetch(module_or_path);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
341
|
-
|
|
342
|
-
return __wbg_finalize_init(instance, module);
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const parseStackTrace: (a: number, b: number, c: number) => void;
|
|
5
|
-
export const symbolicate: (a: number, b: number, c: number, d: number) => void;
|
|
6
|
-
export const __wbindgen_export: (a: number, b: number) => number;
|
|
7
|
-
export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
8
|
-
export const __wbindgen_export3: (a: number) => void;
|
|
9
|
-
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
10
|
-
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|