@socketsecurity/lib 6.0.5 → 6.0.6
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/CHANGELOG.md +18 -0
- package/dist/ai/discover.js +3 -2
- package/dist/ai/spawn.js +8 -5
- package/dist/ai/worktree.js +11 -6
- package/dist/ansi/strip.js +2 -2
- package/dist/archives/_internal.js +4 -4
- package/dist/archives/zip.js +1 -1
- package/dist/arrays/_internal.js +2 -2
- package/dist/arrays/chunk.js +1 -1
- package/dist/arrays/join.js +2 -2
- package/dist/arrays/unique.js +1 -1
- package/dist/bin/acorn-bindgen.cjs +769 -0
- package/dist/bin/acorn.wasm +0 -0
- package/dist/bin/check-primordials.js +3 -2
- package/dist/bin/check.js +3 -2
- package/dist/bin/exec.js +1 -1
- package/dist/bin/prim.cjs +39064 -0
- package/dist/bin/resolve.js +1 -1
- package/dist/colors/socket-palette.js +2 -2
- package/dist/compression/_internal.js +3 -2
- package/dist/compression/brotli.js +5 -12
- package/dist/compression/gzip.js +5 -13
- package/dist/constants/agents.js +4 -4
- package/dist/constants/packages.js +6 -6
- package/dist/constants/socket.js +1 -1
- package/dist/crypto/hash.js +2 -2
- package/dist/debug/_internal.js +2 -2
- package/dist/debug/caller-info.js +1 -1
- package/dist/debug/namespace.js +5 -5
- package/dist/debug/output.js +3 -3
- package/dist/dlx/binary-download.js +3 -2
- package/dist/eco/npm/npm/flags.js +5 -5
- package/dist/eco/npm/pnpm/flags.js +3 -3
- package/dist/env/boolean.js +1 -1
- package/dist/env/ci.js +1 -1
- package/dist/env/debug.js +1 -1
- package/dist/env/github.js +8 -8
- package/dist/env/home.js +1 -1
- package/dist/env/locale.js +3 -3
- package/dist/env/node-auth-token.js +1 -1
- package/dist/env/node-env.js +1 -1
- package/dist/env/npm.js +5 -5
- package/dist/env/number.js +1 -1
- package/dist/env/package-manager.js +3 -3
- package/dist/env/path.js +1 -1
- package/dist/env/pre-commit.js +1 -1
- package/dist/env/rewire.js +2 -2
- package/dist/env/shell.js +1 -1
- package/dist/env/socket-cli.js +13 -13
- package/dist/env/socket.js +33 -32
- package/dist/env/string.js +1 -1
- package/dist/env/temp-dir.js +3 -3
- package/dist/env/term.js +1 -1
- package/dist/env/test.js +3 -3
- package/dist/env/windows.js +4 -4
- package/dist/env/xdg.js +3 -3
- package/dist/events/exit/_internal.js +5 -5
- package/dist/events/exit/handler.js +1 -1
- package/dist/events/exit/intercept.js +2 -2
- package/dist/events/exit/lifecycle.js +3 -3
- package/dist/events/exit/signals.js +1 -1
- package/dist/external/@sinclair/typebox/value.js +5 -1
- package/dist/external/@sinclair/typebox.js +5 -1
- package/dist/external/@socketregistry/packageurl-js.js +27 -0
- package/dist/external-tools/bazel/resolve.js +2 -1
- package/dist/external-tools/cdxgen/resolve.js +2 -1
- package/dist/external-tools/from-pip-venv.d.ts +73 -0
- package/dist/external-tools/from-pip-venv.js +98 -0
- package/dist/external-tools/janus/asset-names.js +1 -1
- package/dist/external-tools/janus/from-download.js +3 -5
- package/dist/external-tools/janus/resolve.js +2 -1
- package/dist/external-tools/jre/from-download.js +2 -1
- package/dist/external-tools/jre/resolve.js +2 -1
- package/dist/external-tools/manifest.js +7 -5
- package/dist/external-tools/opengrep/resolve.js +2 -1
- package/dist/external-tools/sbt/resolve.js +2 -1
- package/dist/external-tools/skillspector/from-dlx.d.ts +24 -0
- package/dist/external-tools/skillspector/from-dlx.js +41 -0
- package/dist/external-tools/skillspector/from-path.d.ts +8 -0
- package/dist/external-tools/skillspector/from-path.js +32 -0
- package/dist/external-tools/skillspector/from-vfs.d.ts +8 -0
- package/dist/external-tools/skillspector/from-vfs.js +27 -0
- package/dist/external-tools/skillspector/resolve.d.ts +34 -0
- package/dist/external-tools/skillspector/resolve.js +53 -0
- package/dist/external-tools/skillspector/types.d.ts +24 -0
- package/dist/external-tools/skillspector/types.js +2 -0
- package/dist/external-tools/synp/resolve.js +2 -1
- package/dist/external-tools/trivy/resolve.js +2 -1
- package/dist/external-tools/trufflehog/resolve.js +2 -1
- package/dist/external-tools/uv/resolve.js +2 -1
- package/dist/fs/access.js +4 -4
- package/dist/fs/encoding.js +2 -2
- package/dist/fs/find-up.js +2 -2
- package/dist/fs/inspect.js +6 -6
- package/dist/fs/read-dir.js +3 -3
- package/dist/fs/read-file.js +6 -6
- package/dist/fs/read-json.js +2 -2
- package/dist/fs/safe.js +2 -2
- package/dist/fs/unique.js +1 -1
- package/dist/fs/validate.js +1 -1
- package/dist/fs/write-json.js +1 -1
- package/dist/git/_internal.js +2 -1
- package/dist/globs/_internal.js +4 -4
- package/dist/globs/match.js +4 -3
- package/dist/globs/matcher.js +2 -2
- package/dist/globs/stream.js +1 -1
- package/dist/http-request/browser.js +17 -11
- package/dist/http-request/download.js +1 -1
- package/dist/http-request/headers.d.ts +32 -3
- package/dist/http-request/headers.js +42 -13
- package/dist/http-request/request-attempt.js +1 -0
- package/dist/http-request/request-types.d.ts +5 -0
- package/dist/http-request/request.js +32 -15
- package/dist/http-request/response-reader.d.ts +12 -1
- package/dist/http-request/response-reader.js +22 -2
- package/dist/http-request/user-agent.js +1 -1
- package/dist/json/edit.js +1 -1
- package/dist/json/parse.js +4 -4
- package/dist/logger/colors.js +2 -2
- package/dist/logger/console.js +1 -1
- package/dist/logger/symbols.js +1 -1
- package/dist/node/async-hooks.js +2 -2
- package/dist/node/child-process.js +2 -2
- package/dist/node/crypto.js +2 -2
- package/dist/node/events.js +2 -2
- package/dist/node/fs-promises.js +2 -2
- package/dist/node/fs.js +2 -2
- package/dist/node/http.js +2 -2
- package/dist/node/https.js +2 -2
- package/dist/node/module.js +3 -3
- package/dist/node/os.js +2 -2
- package/dist/node/path.js +2 -2
- package/dist/node/timers-promises.js +2 -2
- package/dist/node/url.js +2 -2
- package/dist/node/util.js +2 -2
- package/dist/objects/getters.js +2 -2
- package/dist/objects/inspect.js +3 -3
- package/dist/objects/mutate.js +1 -1
- package/dist/objects/predicates.js +4 -4
- package/dist/objects/sort.js +4 -4
- package/dist/packages/edit-class.js +1 -1
- package/dist/packages/edit.js +2 -2
- package/dist/packages/exports.js +6 -6
- package/dist/packages/licenses.js +8 -8
- package/dist/packages/manifest.js +3 -3
- package/dist/packages/normalize.js +4 -4
- package/dist/packages/operations.js +11 -11
- package/dist/packages/provenance.d.ts +6 -0
- package/dist/packages/provenance.js +12 -3
- package/dist/packages/specs.js +5 -5
- package/dist/packages/validation.js +3 -3
- package/dist/paths/_internal.js +3 -3
- package/dist/paths/conversion.js +4 -4
- package/dist/paths/normalize.js +3 -1
- package/dist/paths/packages.js +3 -3
- package/dist/paths/predicates.js +7 -7
- package/dist/paths/resolve.js +3 -3
- package/dist/process/spawn/_internal.js +3 -3
- package/dist/process/spawn/errors.js +2 -2
- package/dist/process/spawn/stdio.js +1 -1
- package/dist/promises/_internal.js +1 -1
- package/dist/promises/iterate.js +5 -5
- package/dist/promises/options.js +3 -3
- package/dist/promises/retry.js +1 -1
- package/dist/secrets/_internal.js +3 -2
- package/dist/secrets/keychain.js +5 -4
- package/dist/secrets/linux.js +6 -4
- package/dist/secrets/macos.js +5 -3
- package/dist/secrets/rc.js +9 -6
- package/dist/secrets/windows.js +7 -4
- package/dist/shell/parse.d.ts +108 -1
- package/dist/shell/parse.js +168 -2
- package/dist/smol/detect.js +1 -1
- package/dist/smol/http.js +1 -1
- package/dist/smol/https.js +1 -1
- package/dist/smol/manifest.js +1 -1
- package/dist/smol/path.js +1 -1
- package/dist/smol/primordial.js +1 -1
- package/dist/smol/purl.js +1 -1
- package/dist/smol/versions.js +1 -1
- package/dist/smol/vfs.js +1 -1
- package/dist/sorts/_internal.js +4 -4
- package/dist/sorts/natural.js +3 -3
- package/dist/sorts/semver.js +1 -1
- package/dist/sorts/strings.js +1 -1
- package/dist/spinner/default.js +1 -1
- package/dist/spinner/spinner.js +1 -1
- package/dist/ssri/convert.js +2 -2
- package/dist/ssri/parse.js +1 -1
- package/dist/ssri/validate.js +2 -2
- package/dist/stdio/prompts.js +1 -1
- package/dist/streams/parallel.js +2 -2
- package/dist/streams/transform.js +1 -1
- package/dist/strings/format.js +4 -4
- package/dist/strings/predicates.js +2 -2
- package/dist/strings/search.js +1 -1
- package/dist/strings/transform.js +3 -3
- package/dist/strings/width.js +2 -2
- package/dist/temporal/instant.js +4 -2
- package/dist/temporal/slots.js +3 -2
- package/dist/themes/context.js +2 -2
- package/dist/url/parse.js +2 -2
- package/dist/url/predicates.js +1 -1
- package/dist/url/search-params.js +6 -6
- package/dist/words/article.js +1 -1
- package/dist/words/capitalize.js +1 -1
- package/dist/words/pluralize.d.ts +24 -2
- package/dist/words/pluralize.js +37 -2
- package/dist/words/types.d.ts +25 -2
- package/package.json +44 -4
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
|
|
2
|
+
let imports = {};
|
|
3
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
+
|
|
5
|
+
let heap = new Array(128).fill(undefined);
|
|
6
|
+
|
|
7
|
+
heap.push(undefined, null, true, false);
|
|
8
|
+
|
|
9
|
+
function getObject(idx) { return heap[idx]; }
|
|
10
|
+
|
|
11
|
+
let heap_next = heap.length;
|
|
12
|
+
|
|
13
|
+
function addHeapObject(obj) {
|
|
14
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
15
|
+
const idx = heap_next;
|
|
16
|
+
heap_next = heap[idx];
|
|
17
|
+
|
|
18
|
+
heap[idx] = obj;
|
|
19
|
+
return idx;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function handleError(f, args) {
|
|
23
|
+
try {
|
|
24
|
+
return f.apply(this, args);
|
|
25
|
+
} catch (e) {
|
|
26
|
+
wasm.__wbindgen_export_0(addHeapObject(e));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let cachedUint8ArrayMemory0 = null;
|
|
31
|
+
|
|
32
|
+
function getUint8ArrayMemory0() {
|
|
33
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
34
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
35
|
+
}
|
|
36
|
+
return cachedUint8ArrayMemory0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
40
|
+
|
|
41
|
+
cachedTextDecoder.decode();
|
|
42
|
+
|
|
43
|
+
function decodeText(ptr, len) {
|
|
44
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function getStringFromWasm0(ptr, len) {
|
|
48
|
+
ptr = ptr >>> 0;
|
|
49
|
+
return decodeText(ptr, len);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function isLikeNone(x) {
|
|
53
|
+
return x === undefined || x === null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function debugString(val) {
|
|
57
|
+
// primitive types
|
|
58
|
+
const type = typeof val;
|
|
59
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
60
|
+
return `${val}`;
|
|
61
|
+
}
|
|
62
|
+
if (type == 'string') {
|
|
63
|
+
return `"${val}"`;
|
|
64
|
+
}
|
|
65
|
+
if (type == 'symbol') {
|
|
66
|
+
const description = val.description;
|
|
67
|
+
if (description == null) {
|
|
68
|
+
return 'Symbol';
|
|
69
|
+
} else {
|
|
70
|
+
return `Symbol(${description})`;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (type == 'function') {
|
|
74
|
+
const name = val.name;
|
|
75
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
76
|
+
return `Function(${name})`;
|
|
77
|
+
} else {
|
|
78
|
+
return 'Function';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
// objects
|
|
82
|
+
if (Array.isArray(val)) {
|
|
83
|
+
const length = val.length;
|
|
84
|
+
let debug = '[';
|
|
85
|
+
if (length > 0) {
|
|
86
|
+
debug += debugString(val[0]);
|
|
87
|
+
}
|
|
88
|
+
for(let i = 1; i < length; i++) {
|
|
89
|
+
debug += ', ' + debugString(val[i]);
|
|
90
|
+
}
|
|
91
|
+
debug += ']';
|
|
92
|
+
return debug;
|
|
93
|
+
}
|
|
94
|
+
// Test for built-in
|
|
95
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
96
|
+
let className;
|
|
97
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
98
|
+
className = builtInMatches[1];
|
|
99
|
+
} else {
|
|
100
|
+
// Failed to match the standard '[object ClassName]'
|
|
101
|
+
return toString.call(val);
|
|
102
|
+
}
|
|
103
|
+
if (className == 'Object') {
|
|
104
|
+
// we're a user defined class or Object
|
|
105
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
106
|
+
// easier than looping through ownProperties of `val`.
|
|
107
|
+
try {
|
|
108
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
109
|
+
} catch (_) {
|
|
110
|
+
return 'Object';
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// errors
|
|
114
|
+
if (val instanceof Error) {
|
|
115
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
116
|
+
}
|
|
117
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
118
|
+
return className;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let WASM_VECTOR_LEN = 0;
|
|
122
|
+
|
|
123
|
+
const cachedTextEncoder = new TextEncoder();
|
|
124
|
+
|
|
125
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
126
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
127
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
128
|
+
view.set(buf);
|
|
129
|
+
return {
|
|
130
|
+
read: arg.length,
|
|
131
|
+
written: buf.length
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
137
|
+
|
|
138
|
+
if (realloc === undefined) {
|
|
139
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
140
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
141
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
142
|
+
WASM_VECTOR_LEN = buf.length;
|
|
143
|
+
return ptr;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
let len = arg.length;
|
|
147
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
148
|
+
|
|
149
|
+
const mem = getUint8ArrayMemory0();
|
|
150
|
+
|
|
151
|
+
let offset = 0;
|
|
152
|
+
|
|
153
|
+
for (; offset < len; offset++) {
|
|
154
|
+
const code = arg.charCodeAt(offset);
|
|
155
|
+
if (code > 0x7F) break;
|
|
156
|
+
mem[ptr + offset] = code;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (offset !== len) {
|
|
160
|
+
if (offset !== 0) {
|
|
161
|
+
arg = arg.slice(offset);
|
|
162
|
+
}
|
|
163
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
164
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
165
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
166
|
+
|
|
167
|
+
offset += ret.written;
|
|
168
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
WASM_VECTOR_LEN = offset;
|
|
172
|
+
return ptr;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
let cachedDataViewMemory0 = null;
|
|
176
|
+
|
|
177
|
+
function getDataViewMemory0() {
|
|
178
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
179
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
180
|
+
}
|
|
181
|
+
return cachedDataViewMemory0;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function dropObject(idx) {
|
|
185
|
+
if (idx < 132) return;
|
|
186
|
+
heap[idx] = heap_next;
|
|
187
|
+
heap_next = idx;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
function takeObject(idx) {
|
|
191
|
+
const ret = getObject(idx);
|
|
192
|
+
dropObject(idx);
|
|
193
|
+
return ret;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Parse `source`, compile `selector`, run the matcher, return a
|
|
197
|
+
* JSON-encoded result string. Meant to be called from JavaScript as:
|
|
198
|
+
*
|
|
199
|
+
* const result = JSON.parse(aqs_match(source, selector))
|
|
200
|
+
* @param {string} source
|
|
201
|
+
* @param {string} selector
|
|
202
|
+
* @returns {string}
|
|
203
|
+
*/
|
|
204
|
+
exports.aqs_match = function(source, selector) {
|
|
205
|
+
let deferred3_0;
|
|
206
|
+
let deferred3_1;
|
|
207
|
+
try {
|
|
208
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
209
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
210
|
+
const len0 = WASM_VECTOR_LEN;
|
|
211
|
+
const ptr1 = passStringToWasm0(selector, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
212
|
+
const len1 = WASM_VECTOR_LEN;
|
|
213
|
+
wasm.aqs_match(retptr, ptr0, len0, ptr1, len1);
|
|
214
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
215
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
216
|
+
deferred3_0 = r0;
|
|
217
|
+
deferred3_1 = r1;
|
|
218
|
+
return getStringFromWasm0(r0, r1);
|
|
219
|
+
} finally {
|
|
220
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
221
|
+
wasm.__wbindgen_export_3(deferred3_0, deferred3_1, 1);
|
|
222
|
+
}
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Standalone parse function (matches Acorn API)
|
|
227
|
+
* @param {string} code
|
|
228
|
+
* @param {any} options
|
|
229
|
+
* @returns {any}
|
|
230
|
+
*/
|
|
231
|
+
exports.parse = function(code, options) {
|
|
232
|
+
try {
|
|
233
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
234
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
235
|
+
const len0 = WASM_VECTOR_LEN;
|
|
236
|
+
wasm.parse(retptr, ptr0, len0, addHeapObject(options));
|
|
237
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
238
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
239
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
240
|
+
if (r2) {
|
|
241
|
+
throw takeObject(r1);
|
|
242
|
+
}
|
|
243
|
+
return takeObject(r0);
|
|
244
|
+
} finally {
|
|
245
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
246
|
+
}
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Check if code has syntax errors (returns true if valid)
|
|
251
|
+
* @param {string} code
|
|
252
|
+
* @returns {boolean}
|
|
253
|
+
*/
|
|
254
|
+
exports.is_valid = function(code) {
|
|
255
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
257
|
+
const ret = wasm.is_valid(ptr0, len0);
|
|
258
|
+
return ret !== 0;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Get version information
|
|
263
|
+
* @returns {string}
|
|
264
|
+
*/
|
|
265
|
+
exports.version = function() {
|
|
266
|
+
let deferred1_0;
|
|
267
|
+
let deferred1_1;
|
|
268
|
+
try {
|
|
269
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
270
|
+
wasm.version(retptr);
|
|
271
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
272
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
273
|
+
deferred1_0 = r0;
|
|
274
|
+
deferred1_1 = r1;
|
|
275
|
+
return getStringFromWasm0(r0, r1);
|
|
276
|
+
} finally {
|
|
277
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
278
|
+
wasm.__wbindgen_export_3(deferred1_0, deferred1_1, 1);
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Find innermost node containing position
|
|
284
|
+
* @param {string} code
|
|
285
|
+
* @param {number} pos
|
|
286
|
+
* @param {string | null | undefined} node_type
|
|
287
|
+
* @param {any} options_js
|
|
288
|
+
* @returns {any}
|
|
289
|
+
*/
|
|
290
|
+
exports.findNodeAround = function(code, pos, node_type, options_js) {
|
|
291
|
+
try {
|
|
292
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
293
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
294
|
+
const len0 = WASM_VECTOR_LEN;
|
|
295
|
+
var ptr1 = isLikeNone(node_type) ? 0 : passStringToWasm0(node_type, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
296
|
+
var len1 = WASM_VECTOR_LEN;
|
|
297
|
+
wasm.findNodeAround(retptr, ptr0, len0, pos, ptr1, len1, addHeapObject(options_js));
|
|
298
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
299
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
300
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
301
|
+
if (r2) {
|
|
302
|
+
throw takeObject(r1);
|
|
303
|
+
}
|
|
304
|
+
return takeObject(r0);
|
|
305
|
+
} finally {
|
|
306
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Find first node starting at or after position
|
|
312
|
+
* @param {string} code
|
|
313
|
+
* @param {number} pos
|
|
314
|
+
* @param {string | null | undefined} node_type
|
|
315
|
+
* @param {any} options_js
|
|
316
|
+
* @returns {any}
|
|
317
|
+
*/
|
|
318
|
+
exports.findNodeAfter = function(code, pos, node_type, options_js) {
|
|
319
|
+
try {
|
|
320
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
321
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
322
|
+
const len0 = WASM_VECTOR_LEN;
|
|
323
|
+
var ptr1 = isLikeNone(node_type) ? 0 : passStringToWasm0(node_type, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
324
|
+
var len1 = WASM_VECTOR_LEN;
|
|
325
|
+
wasm.findNodeAfter(retptr, ptr0, len0, pos, ptr1, len1, addHeapObject(options_js));
|
|
326
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
327
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
328
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
329
|
+
if (r2) {
|
|
330
|
+
throw takeObject(r1);
|
|
331
|
+
}
|
|
332
|
+
return takeObject(r0);
|
|
333
|
+
} finally {
|
|
334
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Find outermost node ending before position
|
|
340
|
+
* @param {string} code
|
|
341
|
+
* @param {number} pos
|
|
342
|
+
* @param {string | null | undefined} node_type
|
|
343
|
+
* @param {any} options_js
|
|
344
|
+
* @returns {any}
|
|
345
|
+
*/
|
|
346
|
+
exports.findNodeBefore = function(code, pos, node_type, options_js) {
|
|
347
|
+
try {
|
|
348
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
349
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
350
|
+
const len0 = WASM_VECTOR_LEN;
|
|
351
|
+
var ptr1 = isLikeNone(node_type) ? 0 : passStringToWasm0(node_type, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
352
|
+
var len1 = WASM_VECTOR_LEN;
|
|
353
|
+
wasm.findNodeBefore(retptr, ptr0, len0, pos, ptr1, len1, addHeapObject(options_js));
|
|
354
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
355
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
356
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
357
|
+
if (r2) {
|
|
358
|
+
throw takeObject(r1);
|
|
359
|
+
}
|
|
360
|
+
return takeObject(r0);
|
|
361
|
+
} finally {
|
|
362
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
363
|
+
}
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Simple walk - parse code and call visitor for each node type
|
|
368
|
+
* @param {string} code
|
|
369
|
+
* @param {any} visitors_obj
|
|
370
|
+
* @param {any} options_js
|
|
371
|
+
*/
|
|
372
|
+
exports.simple = function(code, visitors_obj, options_js) {
|
|
373
|
+
try {
|
|
374
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
375
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
376
|
+
const len0 = WASM_VECTOR_LEN;
|
|
377
|
+
wasm.simple(retptr, ptr0, len0, addHeapObject(visitors_obj), addHeapObject(options_js));
|
|
378
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
379
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
380
|
+
if (r1) {
|
|
381
|
+
throw takeObject(r0);
|
|
382
|
+
}
|
|
383
|
+
} finally {
|
|
384
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Walk with ancestors
|
|
390
|
+
* @param {string} code
|
|
391
|
+
* @param {any} visitors_obj
|
|
392
|
+
* @param {any} options_js
|
|
393
|
+
*/
|
|
394
|
+
exports.walk = function(code, visitors_obj, options_js) {
|
|
395
|
+
try {
|
|
396
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
397
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
398
|
+
const len0 = WASM_VECTOR_LEN;
|
|
399
|
+
wasm.walk(retptr, ptr0, len0, addHeapObject(visitors_obj), addHeapObject(options_js));
|
|
400
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
401
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
402
|
+
if (r1) {
|
|
403
|
+
throw takeObject(r0);
|
|
404
|
+
}
|
|
405
|
+
} finally {
|
|
406
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* Full walk with enter/exit
|
|
412
|
+
* @param {string} code
|
|
413
|
+
* @param {any} visitors_obj
|
|
414
|
+
* @param {any} options_js
|
|
415
|
+
*/
|
|
416
|
+
exports.full = function(code, visitors_obj, options_js) {
|
|
417
|
+
try {
|
|
418
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
419
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
420
|
+
const len0 = WASM_VECTOR_LEN;
|
|
421
|
+
wasm.full(retptr, ptr0, len0, addHeapObject(visitors_obj), addHeapObject(options_js));
|
|
422
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
423
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
424
|
+
if (r1) {
|
|
425
|
+
throw takeObject(r0);
|
|
426
|
+
}
|
|
427
|
+
} finally {
|
|
428
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Recursive walk — visitor controls child traversal via c(child, state)
|
|
434
|
+
* @param {string} code
|
|
435
|
+
* @param {any} state
|
|
436
|
+
* @param {any} funcs
|
|
437
|
+
* @param {any} options_js
|
|
438
|
+
*/
|
|
439
|
+
exports.recursive = function(code, state, funcs, options_js) {
|
|
440
|
+
try {
|
|
441
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
442
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
443
|
+
const len0 = WASM_VECTOR_LEN;
|
|
444
|
+
wasm.recursive(retptr, ptr0, len0, addHeapObject(state), addHeapObject(funcs), addHeapObject(options_js));
|
|
445
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
446
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
447
|
+
if (r1) {
|
|
448
|
+
throw takeObject(r0);
|
|
449
|
+
}
|
|
450
|
+
} finally {
|
|
451
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
452
|
+
}
|
|
453
|
+
};
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Find all nodes matching a type string
|
|
457
|
+
* @param {string} code
|
|
458
|
+
* @param {string} node_type
|
|
459
|
+
* @param {any} options_js
|
|
460
|
+
* @returns {any}
|
|
461
|
+
*/
|
|
462
|
+
exports.findAll = function(code, node_type, options_js) {
|
|
463
|
+
try {
|
|
464
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
465
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
466
|
+
const len0 = WASM_VECTOR_LEN;
|
|
467
|
+
const ptr1 = passStringToWasm0(node_type, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
468
|
+
const len1 = WASM_VECTOR_LEN;
|
|
469
|
+
wasm.findAll(retptr, ptr0, len0, ptr1, len1, addHeapObject(options_js));
|
|
470
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
471
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
472
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
473
|
+
if (r2) {
|
|
474
|
+
throw takeObject(r1);
|
|
475
|
+
}
|
|
476
|
+
return takeObject(r0);
|
|
477
|
+
} finally {
|
|
478
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Count nodes by type
|
|
484
|
+
* @param {string} code
|
|
485
|
+
* @param {any} options_js
|
|
486
|
+
* @returns {any}
|
|
487
|
+
*/
|
|
488
|
+
exports.countNodes = function(code, options_js) {
|
|
489
|
+
try {
|
|
490
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
491
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
492
|
+
const len0 = WASM_VECTOR_LEN;
|
|
493
|
+
wasm.countNodes(retptr, ptr0, len0, addHeapObject(options_js));
|
|
494
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
495
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
496
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
497
|
+
if (r2) {
|
|
498
|
+
throw takeObject(r1);
|
|
499
|
+
}
|
|
500
|
+
return takeObject(r0);
|
|
501
|
+
} finally {
|
|
502
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
503
|
+
}
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Walk all nodes, calling callback with (node, ancestors) for every node
|
|
508
|
+
* @param {string} code
|
|
509
|
+
* @param {any} callback
|
|
510
|
+
* @param {any} options_js
|
|
511
|
+
*/
|
|
512
|
+
exports.fullAncestor = function(code, callback, options_js) {
|
|
513
|
+
try {
|
|
514
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
515
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
516
|
+
const len0 = WASM_VECTOR_LEN;
|
|
517
|
+
wasm.fullAncestor(retptr, ptr0, len0, addHeapObject(callback), addHeapObject(options_js));
|
|
518
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
519
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
520
|
+
if (r1) {
|
|
521
|
+
throw takeObject(r0);
|
|
522
|
+
}
|
|
523
|
+
} finally {
|
|
524
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
525
|
+
}
|
|
526
|
+
};
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Find innermost node at exact start/end position
|
|
530
|
+
* @param {string} code
|
|
531
|
+
* @param {number | null | undefined} start
|
|
532
|
+
* @param {number | null | undefined} end
|
|
533
|
+
* @param {string | null | undefined} node_type
|
|
534
|
+
* @param {any} options_js
|
|
535
|
+
* @returns {any}
|
|
536
|
+
*/
|
|
537
|
+
exports.findNodeAt = function(code, start, end, node_type, options_js) {
|
|
538
|
+
try {
|
|
539
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
540
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
541
|
+
const len0 = WASM_VECTOR_LEN;
|
|
542
|
+
var ptr1 = isLikeNone(node_type) ? 0 : passStringToWasm0(node_type, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
543
|
+
var len1 = WASM_VECTOR_LEN;
|
|
544
|
+
wasm.findNodeAt(retptr, ptr0, len0, isLikeNone(start) ? 0x100000001 : (start) >>> 0, isLikeNone(end) ? 0x100000001 : (end) >>> 0, ptr1, len1, addHeapObject(options_js));
|
|
545
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
546
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
547
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
548
|
+
if (r2) {
|
|
549
|
+
throw takeObject(r1);
|
|
550
|
+
}
|
|
551
|
+
return takeObject(r0);
|
|
552
|
+
} finally {
|
|
553
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
554
|
+
}
|
|
555
|
+
};
|
|
556
|
+
|
|
557
|
+
const WasmParserFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
558
|
+
? { register: () => {}, unregister: () => {} }
|
|
559
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmparser_free(ptr >>> 0, 1));
|
|
560
|
+
|
|
561
|
+
class WasmParser {
|
|
562
|
+
|
|
563
|
+
__destroy_into_raw() {
|
|
564
|
+
const ptr = this.__wbg_ptr;
|
|
565
|
+
this.__wbg_ptr = 0;
|
|
566
|
+
WasmParserFinalization.unregister(this);
|
|
567
|
+
return ptr;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
free() {
|
|
571
|
+
const ptr = this.__destroy_into_raw();
|
|
572
|
+
wasm.__wbg_wasmparser_free(ptr, 0);
|
|
573
|
+
}
|
|
574
|
+
constructor() {
|
|
575
|
+
const ret = wasm.wasmparser_new();
|
|
576
|
+
this.__wbg_ptr = ret >>> 0;
|
|
577
|
+
WasmParserFinalization.register(this, this.__wbg_ptr, this);
|
|
578
|
+
return this;
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* Parse JavaScript code and return AST as JsValue (WASM) or JSON string (native).
|
|
582
|
+
*
|
|
583
|
+
* The WASM path goes:
|
|
584
|
+
* options_js (JS object)
|
|
585
|
+
* → options_from_jsvalue (Reflect-based reads, no serde_json)
|
|
586
|
+
* → parser → JSON string
|
|
587
|
+
* → JSON::parse (one cheap JS-side parse)
|
|
588
|
+
* → JsValue handed back to JS as the AST root
|
|
589
|
+
* @param {string} code
|
|
590
|
+
* @param {any} options_js
|
|
591
|
+
* @returns {any}
|
|
592
|
+
*/
|
|
593
|
+
parse(code, options_js) {
|
|
594
|
+
try {
|
|
595
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
596
|
+
const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
597
|
+
const len0 = WASM_VECTOR_LEN;
|
|
598
|
+
wasm.wasmparser_parse(retptr, this.__wbg_ptr, ptr0, len0, addHeapObject(options_js));
|
|
599
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
600
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
601
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
602
|
+
if (r2) {
|
|
603
|
+
throw takeObject(r1);
|
|
604
|
+
}
|
|
605
|
+
return takeObject(r0);
|
|
606
|
+
} finally {
|
|
607
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
if (Symbol.dispose) WasmParser.prototype[Symbol.dispose] = WasmParser.prototype.free;
|
|
612
|
+
|
|
613
|
+
exports.WasmParser = WasmParser;
|
|
614
|
+
|
|
615
|
+
exports.__wbg_call_641db1bb5db5a579 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
616
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
617
|
+
return addHeapObject(ret);
|
|
618
|
+
}, arguments) };
|
|
619
|
+
|
|
620
|
+
exports.__wbg_call_a5400b25a865cfd8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
621
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
622
|
+
return addHeapObject(ret);
|
|
623
|
+
}, arguments) };
|
|
624
|
+
|
|
625
|
+
exports.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
|
|
626
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
627
|
+
return addHeapObject(ret);
|
|
628
|
+
};
|
|
629
|
+
|
|
630
|
+
exports.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
|
|
631
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
632
|
+
return addHeapObject(ret);
|
|
633
|
+
}, arguments) };
|
|
634
|
+
|
|
635
|
+
exports.__wbg_isArray_030cce220591fb41 = function(arg0) {
|
|
636
|
+
const ret = Array.isArray(getObject(arg0));
|
|
637
|
+
return ret;
|
|
638
|
+
};
|
|
639
|
+
|
|
640
|
+
exports.__wbg_keys_ef52390b2ae0e714 = function(arg0) {
|
|
641
|
+
const ret = Object.keys(getObject(arg0));
|
|
642
|
+
return addHeapObject(ret);
|
|
643
|
+
};
|
|
644
|
+
|
|
645
|
+
exports.__wbg_length_186546c51cd61acd = function(arg0) {
|
|
646
|
+
const ret = getObject(arg0).length;
|
|
647
|
+
return ret;
|
|
648
|
+
};
|
|
649
|
+
|
|
650
|
+
exports.__wbg_new_19c25a3f2fa63a02 = function() {
|
|
651
|
+
const ret = new Object();
|
|
652
|
+
return addHeapObject(ret);
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
exports.__wbg_new_1f3a344cf3123716 = function() {
|
|
656
|
+
const ret = new Array();
|
|
657
|
+
return addHeapObject(ret);
|
|
658
|
+
};
|
|
659
|
+
|
|
660
|
+
exports.__wbg_new_da9dc54c5db29dfa = function(arg0, arg1) {
|
|
661
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
662
|
+
return addHeapObject(ret);
|
|
663
|
+
};
|
|
664
|
+
|
|
665
|
+
exports.__wbg_parse_442f5ba02e5eaf8b = function() { return handleError(function (arg0, arg1) {
|
|
666
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
667
|
+
return addHeapObject(ret);
|
|
668
|
+
}, arguments) };
|
|
669
|
+
|
|
670
|
+
exports.__wbg_pop_5aaf63e29ea83074 = function(arg0) {
|
|
671
|
+
const ret = getObject(arg0).pop();
|
|
672
|
+
return addHeapObject(ret);
|
|
673
|
+
};
|
|
674
|
+
|
|
675
|
+
exports.__wbg_push_330b2eb93e4e1212 = function(arg0, arg1) {
|
|
676
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
677
|
+
return ret;
|
|
678
|
+
};
|
|
679
|
+
|
|
680
|
+
exports.__wbg_set_453345bcda80b89a = function() { return handleError(function (arg0, arg1, arg2) {
|
|
681
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
682
|
+
return ret;
|
|
683
|
+
}, arguments) };
|
|
684
|
+
|
|
685
|
+
exports.__wbg_setname_832b43d4602cb930 = function(arg0, arg1, arg2) {
|
|
686
|
+
getObject(arg0).name = getStringFromWasm0(arg1, arg2);
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
exports.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function(arg0) {
|
|
690
|
+
const v = getObject(arg0);
|
|
691
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
692
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
693
|
+
};
|
|
694
|
+
|
|
695
|
+
exports.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
|
|
696
|
+
const ret = debugString(getObject(arg1));
|
|
697
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
698
|
+
const len1 = WASM_VECTOR_LEN;
|
|
699
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
700
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
exports.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function(arg0) {
|
|
704
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
705
|
+
return ret;
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
exports.__wbg_wbindgenisnull_f3037694abe4d97a = function(arg0) {
|
|
709
|
+
const ret = getObject(arg0) === null;
|
|
710
|
+
return ret;
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
exports.__wbg_wbindgenisobject_307a53c6bd97fbf8 = function(arg0) {
|
|
714
|
+
const val = getObject(arg0);
|
|
715
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
716
|
+
return ret;
|
|
717
|
+
};
|
|
718
|
+
|
|
719
|
+
exports.__wbg_wbindgenisundefined_c4b71d073b92f3c5 = function(arg0) {
|
|
720
|
+
const ret = getObject(arg0) === undefined;
|
|
721
|
+
return ret;
|
|
722
|
+
};
|
|
723
|
+
|
|
724
|
+
exports.__wbg_wbindgennumberget_f74b4c7525ac05cb = function(arg0, arg1) {
|
|
725
|
+
const obj = getObject(arg1);
|
|
726
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
727
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
728
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
729
|
+
};
|
|
730
|
+
|
|
731
|
+
exports.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
|
|
732
|
+
const obj = getObject(arg1);
|
|
733
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
734
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_1, wasm.__wbindgen_export_2);
|
|
735
|
+
var len1 = WASM_VECTOR_LEN;
|
|
736
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
737
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
738
|
+
};
|
|
739
|
+
|
|
740
|
+
exports.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
|
|
741
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
742
|
+
};
|
|
743
|
+
|
|
744
|
+
exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
745
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
746
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
747
|
+
return addHeapObject(ret);
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
751
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
752
|
+
const ret = arg0;
|
|
753
|
+
return addHeapObject(ret);
|
|
754
|
+
};
|
|
755
|
+
|
|
756
|
+
exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
757
|
+
const ret = getObject(arg0);
|
|
758
|
+
return addHeapObject(ret);
|
|
759
|
+
};
|
|
760
|
+
|
|
761
|
+
exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
762
|
+
takeObject(arg0);
|
|
763
|
+
};
|
|
764
|
+
|
|
765
|
+
const wasmPath = `${__dirname}/./acorn.wasm`;
|
|
766
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
767
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
768
|
+
const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
|
|
769
|
+
|