@sema-lang/sema-wasm 1.10.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@sema-lang/sema-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for the Sema Lisp interpreter",
5
- "version": "1.10.0",
5
+ "version": "1.12.1",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/sema_wasm.d.ts CHANGED
@@ -8,6 +8,28 @@ export class SemaInterpreter {
8
8
  * Create interpreter with options: {stdlib: false, deny: ["network", "fs-write"]}
9
9
  */
10
10
  static createWithOptions(opts: any): SemaInterpreter;
11
+ debugContinue(): any;
12
+ debugGetLocals(): any;
13
+ debugGetStackTrace(): any;
14
+ debugIsActive(): boolean;
15
+ /**
16
+ * Perform an HTTP fetch from a debug marker and cache the result.
17
+ * Called by JS in response to a "http_needed" status.
18
+ * Takes the marker JSON from the request field. Returns true on success.
19
+ */
20
+ debugPerformFetch(marker_json: string): Promise<boolean>;
21
+ debugPoll(): any;
22
+ debugSetBreakpoints(lines: Array<any>): void;
23
+ /**
24
+ * Start a debug session. Compiles the code, sets breakpoints on given lines,
25
+ * and runs until the first stop or completion.
26
+ * Returns JSON: { status: "stopped"|"finished"|"error"|"http_needed", ... }
27
+ */
28
+ debugStart(code: string, breakpoint_lines: Array<any>): any;
29
+ debugStepInto(): any;
30
+ debugStepOut(): any;
31
+ debugStepOver(): any;
32
+ debugStop(): void;
11
33
  /**
12
34
  * Delete a file from the virtual filesystem. Returns true if the file existed.
13
35
  */
@@ -37,6 +59,11 @@ export class SemaInterpreter {
37
59
  * Check if a path exists in the virtual filesystem (file or directory).
38
60
  */
39
61
  fileExists(path: string): boolean;
62
+ /**
63
+ * Compile code and return the set of lines that are valid breakpoint targets.
64
+ * Returns a JS array of line numbers (sorted). Returns empty array on parse/compile error.
65
+ */
66
+ getValidBreakpointLines(code: string): Array<any>;
40
67
  /**
41
68
  * Check if a path is a directory in the virtual filesystem.
42
69
  */
@@ -80,12 +107,31 @@ export class SemaInterpreter {
80
107
  writeFile(path: string, content: string): any;
81
108
  }
82
109
 
110
+ /**
111
+ * Format Sema source code. Returns JSON: {"formatted": "...", "error": null}
112
+ * or {"formatted": null, "error": "..."}
113
+ */
114
+ export function formatCode(code: string, width: number, indent: number, align: boolean): any;
115
+
83
116
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
84
117
 
85
118
  export interface InitOutput {
86
119
  readonly memory: WebAssembly.Memory;
87
120
  readonly __wbg_semainterpreter_free: (a: number, b: number) => void;
121
+ readonly formatCode: (a: number, b: number, c: number, d: number, e: number) => any;
88
122
  readonly semainterpreter_createWithOptions: (a: any) => number;
123
+ readonly semainterpreter_debugContinue: (a: number) => any;
124
+ readonly semainterpreter_debugGetLocals: (a: number) => any;
125
+ readonly semainterpreter_debugGetStackTrace: (a: number) => any;
126
+ readonly semainterpreter_debugIsActive: (a: number) => number;
127
+ readonly semainterpreter_debugPerformFetch: (a: number, b: number, c: number) => any;
128
+ readonly semainterpreter_debugPoll: (a: number) => any;
129
+ readonly semainterpreter_debugSetBreakpoints: (a: number, b: any) => void;
130
+ readonly semainterpreter_debugStart: (a: number, b: number, c: number, d: any) => any;
131
+ readonly semainterpreter_debugStepInto: (a: number) => any;
132
+ readonly semainterpreter_debugStepOut: (a: number) => any;
133
+ readonly semainterpreter_debugStepOver: (a: number) => any;
134
+ readonly semainterpreter_debugStop: (a: number) => void;
89
135
  readonly semainterpreter_deleteFile: (a: number, b: number, c: number) => number;
90
136
  readonly semainterpreter_eval: (a: number, b: number, c: number) => any;
91
137
  readonly semainterpreter_evalAsync: (a: number, b: number, c: number) => any;
@@ -93,6 +139,7 @@ export interface InitOutput {
93
139
  readonly semainterpreter_evalVM: (a: number, b: number, c: number) => any;
94
140
  readonly semainterpreter_evalVMAsync: (a: number, b: number, c: number) => any;
95
141
  readonly semainterpreter_fileExists: (a: number, b: number, c: number) => number;
142
+ readonly semainterpreter_getValidBreakpointLines: (a: number, b: number, c: number) => any;
96
143
  readonly semainterpreter_isDirectory: (a: number, b: number, c: number) => number;
97
144
  readonly semainterpreter_listFiles: (a: number, b: number, c: number) => any;
98
145
  readonly semainterpreter_mkdir: (a: number, b: number, c: number) => void;
@@ -104,17 +151,18 @@ export interface InitOutput {
104
151
  readonly semainterpreter_version: (a: number) => [number, number];
105
152
  readonly semainterpreter_vfsStats: (a: number) => any;
106
153
  readonly semainterpreter_writeFile: (a: number, b: number, c: number, d: number, e: number) => any;
107
- readonly wasm_bindgen__closure__destroy__h20c8f210e73a465a: (a: number, b: number) => void;
108
- readonly wasm_bindgen__closure__destroy__h75b7d99d124a8294: (a: number, b: number) => void;
109
- readonly wasm_bindgen__convert__closures_____invoke__h46a4fff719d8b2e7: (a: number, b: number, c: any, d: any) => void;
110
- readonly wasm_bindgen__convert__closures_____invoke__h30bf7fdedaefa193: (a: number, b: number, c: any) => void;
111
- readonly wasm_bindgen__convert__closures_____invoke__ha742e9488c8ed6c9: (a: number, b: number) => void;
154
+ readonly wasm_bindgen__closure__destroy__hee9d31c1decb1f58: (a: number, b: number) => void;
155
+ readonly wasm_bindgen__closure__destroy__hb821d031c0e4c87b: (a: number, b: number) => void;
156
+ readonly wasm_bindgen__convert__closures_____invoke__hd1297f566bde5dd8: (a: number, b: number, c: any) => [number, number];
157
+ readonly wasm_bindgen__convert__closures_____invoke__h0022ea9fa430a1be: (a: number, b: number, c: any, d: any) => void;
158
+ readonly wasm_bindgen__convert__closures_____invoke__hec161cfeb8c5230b: (a: number, b: number) => void;
112
159
  readonly __wbindgen_malloc: (a: number, b: number) => number;
113
160
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
114
161
  readonly __wbindgen_exn_store: (a: number) => void;
115
162
  readonly __externref_table_alloc: () => number;
116
163
  readonly __wbindgen_externrefs: WebAssembly.Table;
117
164
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
165
+ readonly __externref_table_dealloc: (a: number) => void;
118
166
  readonly __wbindgen_start: () => void;
119
167
  }
120
168
 
package/sema_wasm.js CHANGED
@@ -27,6 +27,98 @@ export class SemaInterpreter {
27
27
  const ret = wasm.semainterpreter_createWithOptions(opts);
28
28
  return SemaInterpreter.__wrap(ret);
29
29
  }
30
+ /**
31
+ * @returns {any}
32
+ */
33
+ debugContinue() {
34
+ const ret = wasm.semainterpreter_debugContinue(this.__wbg_ptr);
35
+ return ret;
36
+ }
37
+ /**
38
+ * @returns {any}
39
+ */
40
+ debugGetLocals() {
41
+ const ret = wasm.semainterpreter_debugGetLocals(this.__wbg_ptr);
42
+ return ret;
43
+ }
44
+ /**
45
+ * @returns {any}
46
+ */
47
+ debugGetStackTrace() {
48
+ const ret = wasm.semainterpreter_debugGetStackTrace(this.__wbg_ptr);
49
+ return ret;
50
+ }
51
+ /**
52
+ * @returns {boolean}
53
+ */
54
+ debugIsActive() {
55
+ const ret = wasm.semainterpreter_debugIsActive(this.__wbg_ptr);
56
+ return ret !== 0;
57
+ }
58
+ /**
59
+ * Perform an HTTP fetch from a debug marker and cache the result.
60
+ * Called by JS in response to a "http_needed" status.
61
+ * Takes the marker JSON from the request field. Returns true on success.
62
+ * @param {string} marker_json
63
+ * @returns {Promise<boolean>}
64
+ */
65
+ debugPerformFetch(marker_json) {
66
+ const ptr0 = passStringToWasm0(marker_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
67
+ const len0 = WASM_VECTOR_LEN;
68
+ const ret = wasm.semainterpreter_debugPerformFetch(this.__wbg_ptr, ptr0, len0);
69
+ return ret;
70
+ }
71
+ /**
72
+ * @returns {any}
73
+ */
74
+ debugPoll() {
75
+ const ret = wasm.semainterpreter_debugPoll(this.__wbg_ptr);
76
+ return ret;
77
+ }
78
+ /**
79
+ * @param {Array<any>} lines
80
+ */
81
+ debugSetBreakpoints(lines) {
82
+ wasm.semainterpreter_debugSetBreakpoints(this.__wbg_ptr, lines);
83
+ }
84
+ /**
85
+ * Start a debug session. Compiles the code, sets breakpoints on given lines,
86
+ * and runs until the first stop or completion.
87
+ * Returns JSON: { status: "stopped"|"finished"|"error"|"http_needed", ... }
88
+ * @param {string} code
89
+ * @param {Array<any>} breakpoint_lines
90
+ * @returns {any}
91
+ */
92
+ debugStart(code, breakpoint_lines) {
93
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
94
+ const len0 = WASM_VECTOR_LEN;
95
+ const ret = wasm.semainterpreter_debugStart(this.__wbg_ptr, ptr0, len0, breakpoint_lines);
96
+ return ret;
97
+ }
98
+ /**
99
+ * @returns {any}
100
+ */
101
+ debugStepInto() {
102
+ const ret = wasm.semainterpreter_debugStepInto(this.__wbg_ptr);
103
+ return ret;
104
+ }
105
+ /**
106
+ * @returns {any}
107
+ */
108
+ debugStepOut() {
109
+ const ret = wasm.semainterpreter_debugStepOut(this.__wbg_ptr);
110
+ return ret;
111
+ }
112
+ /**
113
+ * @returns {any}
114
+ */
115
+ debugStepOver() {
116
+ const ret = wasm.semainterpreter_debugStepOver(this.__wbg_ptr);
117
+ return ret;
118
+ }
119
+ debugStop() {
120
+ wasm.semainterpreter_debugStop(this.__wbg_ptr);
121
+ }
30
122
  /**
31
123
  * Delete a file from the virtual filesystem. Returns true if the file existed.
32
124
  * @param {string} path
@@ -105,6 +197,18 @@ export class SemaInterpreter {
105
197
  const ret = wasm.semainterpreter_fileExists(this.__wbg_ptr, ptr0, len0);
106
198
  return ret !== 0;
107
199
  }
200
+ /**
201
+ * Compile code and return the set of lines that are valid breakpoint targets.
202
+ * Returns a JS array of line numbers (sorted). Returns empty array on parse/compile error.
203
+ * @param {string} code
204
+ * @returns {Array<any>}
205
+ */
206
+ getValidBreakpointLines(code) {
207
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
208
+ const len0 = WASM_VECTOR_LEN;
209
+ const ret = wasm.semainterpreter_getValidBreakpointLines(this.__wbg_ptr, ptr0, len0);
210
+ return ret;
211
+ }
108
212
  /**
109
213
  * Check if a path is a directory in the virtual filesystem.
110
214
  * @param {string} path
@@ -224,45 +328,61 @@ export class SemaInterpreter {
224
328
  }
225
329
  if (Symbol.dispose) SemaInterpreter.prototype[Symbol.dispose] = SemaInterpreter.prototype.free;
226
330
 
331
+ /**
332
+ * Format Sema source code. Returns JSON: {"formatted": "...", "error": null}
333
+ * or {"formatted": null, "error": "..."}
334
+ * @param {string} code
335
+ * @param {number} width
336
+ * @param {number} indent
337
+ * @param {boolean} align
338
+ * @returns {any}
339
+ */
340
+ export function formatCode(code, width, indent, align) {
341
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
342
+ const len0 = WASM_VECTOR_LEN;
343
+ const ret = wasm.formatCode(ptr0, len0, width, indent, align);
344
+ return ret;
345
+ }
346
+
227
347
  function __wbg_get_imports() {
228
348
  const import0 = {
229
349
  __proto__: null,
230
- __wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25: function(arg0) {
350
+ __wbg___wbindgen_boolean_get_7f1c4dd217655ab6: function(arg0) {
231
351
  const v = arg0;
232
352
  const ret = typeof(v) === 'boolean' ? v : undefined;
233
353
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
234
354
  },
235
- __wbg___wbindgen_debug_string_0bc8482c6e3508ae: function(arg0, arg1) {
355
+ __wbg___wbindgen_debug_string_6cf0badf0b90f6ef: function(arg0, arg1) {
236
356
  const ret = debugString(arg1);
237
357
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
238
358
  const len1 = WASM_VECTOR_LEN;
239
359
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
240
360
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
241
361
  },
242
- __wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
362
+ __wbg___wbindgen_is_function_4500d4795b15e70b: function(arg0) {
243
363
  const ret = typeof(arg0) === 'function';
244
364
  return ret;
245
365
  },
246
- __wbg___wbindgen_is_null_ac34f5003991759a: function(arg0) {
366
+ __wbg___wbindgen_is_null_5467e07e008308e7: function(arg0) {
247
367
  const ret = arg0 === null;
248
368
  return ret;
249
369
  },
250
- __wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
370
+ __wbg___wbindgen_is_object_f8b6723c60349a13: function(arg0) {
251
371
  const val = arg0;
252
372
  const ret = typeof(val) === 'object' && val !== null;
253
373
  return ret;
254
374
  },
255
- __wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
375
+ __wbg___wbindgen_is_undefined_1296fcc83c2da07a: function(arg0) {
256
376
  const ret = arg0 === undefined;
257
377
  return ret;
258
378
  },
259
- __wbg___wbindgen_number_get_8ff4255516ccad3e: function(arg0, arg1) {
379
+ __wbg___wbindgen_number_get_3330675b4e5c3680: function(arg0, arg1) {
260
380
  const obj = arg1;
261
381
  const ret = typeof(obj) === 'number' ? obj : undefined;
262
382
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
263
383
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
264
384
  },
265
- __wbg___wbindgen_string_get_72fb696202c56729: function(arg0, arg1) {
385
+ __wbg___wbindgen_string_get_7b8bc463f6cbeefe: function(arg0, arg1) {
266
386
  const obj = arg1;
267
387
  const ret = typeof(obj) === 'string' ? obj : undefined;
268
388
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
@@ -270,66 +390,74 @@ function __wbg_get_imports() {
270
390
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
271
391
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
272
392
  },
273
- __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
393
+ __wbg___wbindgen_throw_89ca9e2c67795ec1: function(arg0, arg1) {
274
394
  throw new Error(getStringFromWasm0(arg0, arg1));
275
395
  },
276
- __wbg__wbg_cb_unref_d9b87ff7982e3b21: function(arg0) {
396
+ __wbg__wbg_cb_unref_f00ff3c6385bd6fa: function(arg0) {
277
397
  arg0._wbg_cb_unref();
278
398
  },
279
- __wbg_abort_2f0584e03e8e3950: function(arg0) {
399
+ __wbg_abort_e6a92d5623297220: function(arg0) {
280
400
  arg0.abort();
281
401
  },
282
- __wbg_apply_ada2ee1a60ac7b3c: function() { return handleError(function (arg0, arg1, arg2) {
402
+ __wbg_apply_362be3817fbaa7f3: function() { return handleError(function (arg0, arg1, arg2) {
283
403
  const ret = arg0.apply(arg1, arg2);
284
404
  return ret;
285
405
  }, arguments); },
286
- __wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
287
- const ret = arg0.call(arg1);
406
+ __wbg_call_3eadb5cea0462653: function() { return handleError(function (arg0, arg1, arg2) {
407
+ const ret = arg0.call(arg1, arg2);
288
408
  return ret;
289
409
  }, arguments); },
290
- __wbg_call_4708e0c13bdc8e95: function() { return handleError(function (arg0, arg1, arg2) {
291
- const ret = arg0.call(arg1, arg2);
410
+ __wbg_call_eb691bc2f5533064: function() { return handleError(function (arg0, arg1) {
411
+ const ret = arg0.call(arg1);
292
412
  return ret;
293
413
  }, arguments); },
294
- __wbg_done_57b39ecd9addfe81: function(arg0) {
414
+ __wbg_done_82b14aeb31e98db6: function(arg0) {
295
415
  const ret = arg0.done;
296
416
  return ret;
297
417
  },
298
- __wbg_eval_3f0b9f0cbaf45a34: function() { return handleError(function (arg0, arg1) {
418
+ __wbg_eval_f79a0253a6cf4894: function() { return handleError(function (arg0, arg1) {
299
419
  const ret = eval(getStringFromWasm0(arg0, arg1));
300
420
  return ret;
301
421
  }, arguments); },
302
- __wbg_fetch_e6e8e0a221783759: function(arg0, arg1) {
422
+ __wbg_fetch_457fd31a889a3605: function(arg0, arg1) {
303
423
  const ret = arg0.fetch(arg1);
304
424
  return ret;
305
425
  },
306
- __wbg_getRandomValues_2a91986308c74a93: function() { return handleError(function (arg0, arg1) {
426
+ __wbg_getRandomValues_3dda8830c2565714: function() { return handleError(function (arg0, arg1) {
307
427
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
308
428
  }, arguments); },
309
- __wbg_getRandomValues_9c5c1b115e142bb8: function() { return handleError(function (arg0, arg1) {
429
+ __wbg_getRandomValues_ab1935b403569652: function() { return handleError(function (arg0, arg1) {
310
430
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
311
431
  }, arguments); },
312
- __wbg_getTime_1e3cd1391c5c3995: function(arg0) {
432
+ __wbg_getTime_4b23931c93d819bb: function(arg0) {
313
433
  const ret = arg0.getTime();
314
434
  return ret;
315
435
  },
316
- __wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
436
+ __wbg_get_229657ec2da079cd: function(arg0, arg1) {
317
437
  const ret = arg0[arg1 >>> 0];
318
438
  return ret;
319
439
  },
320
- __wbg_get_b3ed3ad4be2bc8ac: function() { return handleError(function (arg0, arg1) {
440
+ __wbg_get_89f3a4c398b4872e: function() { return handleError(function (arg0, arg1) {
441
+ const ret = Reflect.get(arg0, arg1);
442
+ return ret;
443
+ }, arguments); },
444
+ __wbg_get_ed44f5f876f22351: function() { return handleError(function (arg0, arg1) {
321
445
  const ret = Reflect.get(arg0, arg1);
322
446
  return ret;
323
447
  }, arguments); },
324
- __wbg_headers_59a2938db9f80985: function(arg0) {
448
+ __wbg_get_unchecked_ae4d1600970be7c3: function(arg0, arg1) {
449
+ const ret = arg0[arg1 >>> 0];
450
+ return ret;
451
+ },
452
+ __wbg_headers_d0c04d2f0f2d1afa: function(arg0) {
325
453
  const ret = arg0.headers;
326
454
  return ret;
327
455
  },
328
- __wbg_headers_5a897f7fee9a0571: function(arg0) {
456
+ __wbg_headers_fa752b79db86f8b3: function(arg0) {
329
457
  const ret = arg0.headers;
330
458
  return ret;
331
459
  },
332
- __wbg_instanceof_Response_ee1d54d79ae41977: function(arg0) {
460
+ __wbg_instanceof_Response_1844be67dbd5e161: function(arg0) {
333
461
  let result;
334
462
  try {
335
463
  result = arg0 instanceof Response;
@@ -339,7 +467,7 @@ function __wbg_get_imports() {
339
467
  const ret = result;
340
468
  return ret;
341
469
  },
342
- __wbg_instanceof_Window_ed49b2db8df90359: function(arg0) {
470
+ __wbg_instanceof_Window_27a653e1b516dd65: function(arg0) {
343
471
  let result;
344
472
  try {
345
473
  result = arg0 instanceof Window;
@@ -349,38 +477,42 @@ function __wbg_get_imports() {
349
477
  const ret = result;
350
478
  return ret;
351
479
  },
352
- __wbg_isArray_d314bb98fcf08331: function(arg0) {
480
+ __wbg_isArray_fe5201bfdab7e39d: function(arg0) {
353
481
  const ret = Array.isArray(arg0);
354
482
  return ret;
355
483
  },
356
- __wbg_iterator_6ff6560ca1568e55: function() {
484
+ __wbg_iterator_63c3a1857203cf2f: function() {
357
485
  const ret = Symbol.iterator;
358
486
  return ret;
359
487
  },
360
- __wbg_length_35a7bace40f36eac: function(arg0) {
488
+ __wbg_length_feaf2a40e5f9755a: function(arg0) {
361
489
  const ret = arg0.length;
362
490
  return ret;
363
491
  },
364
- __wbg_new_0_73afc35eb544e539: function() {
492
+ __wbg_new_08d33c204155a3e2: function() { return handleError(function () {
493
+ const ret = new AbortController();
494
+ return ret;
495
+ }, arguments); },
496
+ __wbg_new_0_e8782c8df6122565: function() {
365
497
  const ret = new Date();
366
498
  return ret;
367
499
  },
368
- __wbg_new_361308b2356cecd0: function() {
500
+ __wbg_new_6feff3e11e4d0799: function() {
369
501
  const ret = new Object();
370
502
  return ret;
371
503
  },
372
- __wbg_new_3eb36ae241fe6f44: function() {
504
+ __wbg_new_ff7f9cc4c9a4a0cf: function() {
373
505
  const ret = new Array();
374
506
  return ret;
375
507
  },
376
- __wbg_new_b5d9e2fb389fef91: function(arg0, arg1) {
508
+ __wbg_new_typed_f79896f0ea5f7de8: function(arg0, arg1) {
377
509
  try {
378
510
  var state0 = {a: arg0, b: arg1};
379
511
  var cb0 = (arg0, arg1) => {
380
512
  const a = state0.a;
381
513
  state0.a = 0;
382
514
  try {
383
- return wasm_bindgen__convert__closures_____invoke__h46a4fff719d8b2e7(a, state0.b, arg0, arg1);
515
+ return wasm_bindgen__convert__closures_____invoke__h0022ea9fa430a1be(a, state0.b, arg0, arg1);
384
516
  } finally {
385
517
  state0.a = a;
386
518
  }
@@ -391,120 +523,116 @@ function __wbg_get_imports() {
391
523
  state0.a = state0.b = 0;
392
524
  }
393
525
  },
394
- __wbg_new_b949e7f56150a5d1: function() { return handleError(function () {
395
- const ret = new AbortController();
396
- return ret;
397
- }, arguments); },
398
- __wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
399
- const ret = new Function(getStringFromWasm0(arg0, arg1));
400
- return ret;
401
- },
402
- __wbg_new_with_str_and_init_a61cbc6bdef21614: function() { return handleError(function (arg0, arg1, arg2) {
526
+ __wbg_new_with_str_and_init_66de5344635d3590: function() { return handleError(function (arg0, arg1, arg2) {
403
527
  const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
404
528
  return ret;
405
529
  }, arguments); },
406
- __wbg_next_3482f54c49e8af19: function() { return handleError(function (arg0) {
530
+ __wbg_next_ae5b710aea83f41e: function() { return handleError(function (arg0) {
407
531
  const ret = arg0.next();
408
532
  return ret;
409
533
  }, arguments); },
410
- __wbg_next_418f80d8f5303233: function(arg0) {
534
+ __wbg_next_f577b3e02c9be709: function(arg0) {
411
535
  const ret = arg0.next;
412
536
  return ret;
413
537
  },
414
- __wbg_now_a3af9a2f4bbaa4d1: function() {
538
+ __wbg_now_054cfe5280165f10: function() {
415
539
  const ret = Date.now();
416
540
  return ret;
417
541
  },
418
- __wbg_parse_708461a1feddfb38: function() { return handleError(function (arg0, arg1) {
542
+ __wbg_parse_b03588c4ad83b7b2: function() { return handleError(function (arg0, arg1) {
419
543
  const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
420
544
  return ret;
421
545
  }, arguments); },
422
- __wbg_push_8ffdcb2063340ba5: function(arg0, arg1) {
546
+ __wbg_push_3584053bd77475ee: function(arg0, arg1) {
423
547
  const ret = arg0.push(arg1);
424
548
  return ret;
425
549
  },
426
- __wbg_queueMicrotask_0aa0a927f78f5d98: function(arg0) {
550
+ __wbg_queueMicrotask_5e387cf4d8e3f63e: function(arg0) {
551
+ queueMicrotask(arg0);
552
+ },
553
+ __wbg_queueMicrotask_77bf5a3ad712168b: function(arg0) {
427
554
  const ret = arg0.queueMicrotask;
428
555
  return ret;
429
556
  },
430
- __wbg_queueMicrotask_5bb536982f78a56f: function(arg0) {
431
- queueMicrotask(arg0);
432
- },
433
- __wbg_resolve_002c4b7d9d8f6b64: function(arg0) {
557
+ __wbg_resolve_2e8556632715b12f: function(arg0) {
434
558
  const ret = Promise.resolve(arg0);
435
559
  return ret;
436
560
  },
437
- __wbg_setTimeout_eff32631ea138533: function() { return handleError(function (arg0, arg1, arg2) {
561
+ __wbg_setTimeout_4ca0316a84ed500a: function() { return handleError(function (arg0, arg1, arg2) {
438
562
  const ret = arg0.setTimeout(arg1, arg2);
439
563
  return ret;
440
564
  }, arguments); },
441
- __wbg_set_body_9a7e00afe3cfe244: function(arg0, arg1) {
565
+ __wbg_set_409333732b484ee7: function() { return handleError(function (arg0, arg1, arg2) {
566
+ const ret = Reflect.set(arg0, arg1, arg2);
567
+ return ret;
568
+ }, arguments); },
569
+ __wbg_set_body_42d5ed933a1840a1: function(arg0, arg1) {
442
570
  arg0.body = arg1;
443
571
  },
444
- __wbg_set_db769d02949a271d: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
572
+ __wbg_set_f2987f52a57de416: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
445
573
  arg0.set(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
446
574
  }, arguments); },
447
- __wbg_set_method_c3e20375f5ae7fac: function(arg0, arg1, arg2) {
575
+ __wbg_set_method_5a35896632ca213d: function(arg0, arg1, arg2) {
448
576
  arg0.method = getStringFromWasm0(arg1, arg2);
449
577
  },
450
- __wbg_set_mode_b13642c312648202: function(arg0, arg1) {
578
+ __wbg_set_mode_6fa10db5d133ac26: function(arg0, arg1) {
451
579
  arg0.mode = __wbindgen_enum_RequestMode[arg1];
452
580
  },
453
- __wbg_set_signal_f2d3f8599248896d: function(arg0, arg1) {
581
+ __wbg_set_signal_0d93209e168efc85: function(arg0, arg1) {
454
582
  arg0.signal = arg1;
455
583
  },
456
- __wbg_signal_d1285ecab4ebc5ad: function(arg0) {
584
+ __wbg_signal_a0d9fead74a07e34: function(arg0) {
457
585
  const ret = arg0.signal;
458
586
  return ret;
459
587
  },
460
- __wbg_static_accessor_GLOBAL_12837167ad935116: function() {
588
+ __wbg_static_accessor_GLOBAL_280fe6a619bbfbf6: function() {
461
589
  const ret = typeof global === 'undefined' ? null : global;
462
590
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
463
591
  },
464
- __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
592
+ __wbg_static_accessor_GLOBAL_THIS_12c1f4811ec605d1: function() {
465
593
  const ret = typeof globalThis === 'undefined' ? null : globalThis;
466
594
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
467
595
  },
468
- __wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
596
+ __wbg_static_accessor_SELF_3a156961626f54d9: function() {
469
597
  const ret = typeof self === 'undefined' ? null : self;
470
598
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
471
599
  },
472
- __wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
600
+ __wbg_static_accessor_WINDOW_210015b3eb6018a4: function() {
473
601
  const ret = typeof window === 'undefined' ? null : window;
474
602
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
475
603
  },
476
- __wbg_status_89d7e803db911ee7: function(arg0) {
604
+ __wbg_status_1544422a8c64aef0: function(arg0) {
477
605
  const ret = arg0.status;
478
606
  return ret;
479
607
  },
480
- __wbg_stringify_8d1cc6ff383e8bae: function() { return handleError(function (arg0) {
608
+ __wbg_stringify_ab2dc46051bc59b7: function() { return handleError(function (arg0) {
481
609
  const ret = JSON.stringify(arg0);
482
610
  return ret;
483
611
  }, arguments); },
484
- __wbg_text_083b8727c990c8c0: function() { return handleError(function (arg0) {
612
+ __wbg_text_667415a14b08e789: function() { return handleError(function (arg0) {
485
613
  const ret = arg0.text();
486
614
  return ret;
487
615
  }, arguments); },
488
- __wbg_then_0d9fe2c7b1857d32: function(arg0, arg1, arg2) {
489
- const ret = arg0.then(arg1, arg2);
616
+ __wbg_then_5ce48a9e69c0d3cd: function(arg0, arg1) {
617
+ const ret = arg0.then(arg1);
490
618
  return ret;
491
619
  },
492
- __wbg_then_b9e7b3b5f1a9e1b5: function(arg0, arg1) {
493
- const ret = arg0.then(arg1);
620
+ __wbg_then_f73127af3894d61c: function(arg0, arg1, arg2) {
621
+ const ret = arg0.then(arg1, arg2);
494
622
  return ret;
495
623
  },
496
- __wbg_value_0546255b415e96c1: function(arg0) {
624
+ __wbg_value_3e1fdb73e1353fb3: function(arg0) {
497
625
  const ret = arg0.value;
498
626
  return ret;
499
627
  },
500
628
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
501
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1405, function: Function { arguments: [], shim_idx: 1406, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
502
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h20c8f210e73a465a, wasm_bindgen__convert__closures_____invoke__ha742e9488c8ed6c9);
629
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1530, function: Function { arguments: [], shim_idx: 1531, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
630
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hee9d31c1decb1f58, wasm_bindgen__convert__closures_____invoke__hec161cfeb8c5230b);
503
631
  return ret;
504
632
  },
505
633
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
506
- // Cast intrinsic for `Closure(Closure { dtor_idx: 1593, function: Function { arguments: [Externref], shim_idx: 1594, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
507
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h75b7d99d124a8294, wasm_bindgen__convert__closures_____invoke__h30bf7fdedaefa193);
634
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 1859, function: Function { arguments: [Externref], shim_idx: 1860, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
635
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hb821d031c0e4c87b, wasm_bindgen__convert__closures_____invoke__hd1297f566bde5dd8);
508
636
  return ret;
509
637
  },
510
638
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -533,16 +661,19 @@ function __wbg_get_imports() {
533
661
  };
534
662
  }
535
663
 
536
- function wasm_bindgen__convert__closures_____invoke__ha742e9488c8ed6c9(arg0, arg1) {
537
- wasm.wasm_bindgen__convert__closures_____invoke__ha742e9488c8ed6c9(arg0, arg1);
664
+ function wasm_bindgen__convert__closures_____invoke__hec161cfeb8c5230b(arg0, arg1) {
665
+ wasm.wasm_bindgen__convert__closures_____invoke__hec161cfeb8c5230b(arg0, arg1);
538
666
  }
539
667
 
540
- function wasm_bindgen__convert__closures_____invoke__h30bf7fdedaefa193(arg0, arg1, arg2) {
541
- wasm.wasm_bindgen__convert__closures_____invoke__h30bf7fdedaefa193(arg0, arg1, arg2);
668
+ function wasm_bindgen__convert__closures_____invoke__hd1297f566bde5dd8(arg0, arg1, arg2) {
669
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__hd1297f566bde5dd8(arg0, arg1, arg2);
670
+ if (ret[1]) {
671
+ throw takeFromExternrefTable0(ret[0]);
672
+ }
542
673
  }
543
674
 
544
- function wasm_bindgen__convert__closures_____invoke__h46a4fff719d8b2e7(arg0, arg1, arg2, arg3) {
545
- wasm.wasm_bindgen__convert__closures_____invoke__h46a4fff719d8b2e7(arg0, arg1, arg2, arg3);
675
+ function wasm_bindgen__convert__closures_____invoke__h0022ea9fa430a1be(arg0, arg1, arg2, arg3) {
676
+ wasm.wasm_bindgen__convert__closures_____invoke__h0022ea9fa430a1be(arg0, arg1, arg2, arg3);
546
677
  }
547
678
 
548
679
 
@@ -730,6 +861,12 @@ function passStringToWasm0(arg, malloc, realloc) {
730
861
  return ptr;
731
862
  }
732
863
 
864
+ function takeFromExternrefTable0(idx) {
865
+ const value = wasm.__wbindgen_externrefs.get(idx);
866
+ wasm.__externref_table_dealloc(idx);
867
+ return value;
868
+ }
869
+
733
870
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
734
871
  cachedTextDecoder.decode();
735
872
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
package/sema_wasm_bg.wasm CHANGED
Binary file