@astral-sh/ruff-wasm-web 0.6.1 → 0.6.3

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
@@ -5,7 +5,7 @@
5
5
  "Charlie Marsh <charlie.r.marsh@gmail.com>"
6
6
  ],
7
7
  "description": "WebAssembly bindings for Ruff",
8
- "version": "0.6.1",
8
+ "version": "0.6.3",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
package/ruff_wasm.d.ts CHANGED
@@ -86,7 +86,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
86
86
  export interface InitOutput {
87
87
  readonly memory: WebAssembly.Memory;
88
88
  readonly run: () => void;
89
- readonly __wbg_workspace_free: (a: number) => void;
89
+ readonly __wbg_workspace_free: (a: number, b: number) => void;
90
90
  readonly workspace_version: (a: number) => void;
91
91
  readonly workspace_new: (a: number, b: number) => void;
92
92
  readonly workspace_defaultSettings: (a: number) => void;
@@ -109,18 +109,18 @@ export type SyncInitInput = BufferSource | WebAssembly.Module;
109
109
  * Instantiates the given `module`, which can either be bytes or
110
110
  * a precompiled `WebAssembly.Module`.
111
111
  *
112
- * @param {SyncInitInput} module
112
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
113
113
  *
114
114
  * @returns {InitOutput}
115
115
  */
116
- export function initSync(module: SyncInitInput): InitOutput;
116
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
117
117
 
118
118
  /**
119
119
  * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
120
120
  * for everything else, calls `WebAssembly.instantiate` directly.
121
121
  *
122
- * @param {InitInput | Promise<InitInput>} module_or_path
122
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
123
123
  *
124
124
  * @returns {Promise<InitOutput>}
125
125
  */
126
- export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
126
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
package/ruff_wasm.js CHANGED
@@ -24,18 +24,18 @@ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder(
24
24
 
25
25
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
26
26
 
27
- let cachedUint8Memory0 = null;
27
+ let cachedUint8ArrayMemory0 = null;
28
28
 
29
- function getUint8Memory0() {
30
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
31
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
29
+ function getUint8ArrayMemory0() {
30
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
31
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
32
32
  }
33
- return cachedUint8Memory0;
33
+ return cachedUint8ArrayMemory0;
34
34
  }
35
35
 
36
36
  function getStringFromWasm0(ptr, len) {
37
37
  ptr = ptr >>> 0;
38
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
38
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
39
39
  }
40
40
 
41
41
  function addHeapObject(obj) {
@@ -51,22 +51,13 @@ function isLikeNone(x) {
51
51
  return x === undefined || x === null;
52
52
  }
53
53
 
54
- let cachedFloat64Memory0 = null;
54
+ let cachedDataViewMemory0 = null;
55
55
 
56
- function getFloat64Memory0() {
57
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
58
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
56
+ function getDataViewMemory0() {
57
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
58
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
59
59
  }
60
- return cachedFloat64Memory0;
61
- }
62
-
63
- let cachedInt32Memory0 = null;
64
-
65
- function getInt32Memory0() {
66
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
67
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
68
- }
69
- return cachedInt32Memory0;
60
+ return cachedDataViewMemory0;
70
61
  }
71
62
 
72
63
  let WASM_VECTOR_LEN = 0;
@@ -91,7 +82,7 @@ function passStringToWasm0(arg, malloc, realloc) {
91
82
  if (realloc === undefined) {
92
83
  const buf = cachedTextEncoder.encode(arg);
93
84
  const ptr = malloc(buf.length, 1) >>> 0;
94
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
85
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
95
86
  WASM_VECTOR_LEN = buf.length;
96
87
  return ptr;
97
88
  }
@@ -99,7 +90,7 @@ function passStringToWasm0(arg, malloc, realloc) {
99
90
  let len = arg.length;
100
91
  let ptr = malloc(len, 1) >>> 0;
101
92
 
102
- const mem = getUint8Memory0();
93
+ const mem = getUint8ArrayMemory0();
103
94
 
104
95
  let offset = 0;
105
96
 
@@ -114,7 +105,7 @@ function passStringToWasm0(arg, malloc, realloc) {
114
105
  arg = arg.slice(offset);
115
106
  }
116
107
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
117
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
108
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
118
109
  const ret = encodeString(arg, view);
119
110
 
120
111
  offset += ret.written;
@@ -125,15 +116,6 @@ function passStringToWasm0(arg, malloc, realloc) {
125
116
  return ptr;
126
117
  }
127
118
 
128
- let cachedBigInt64Memory0 = null;
129
-
130
- function getBigInt64Memory0() {
131
- if (cachedBigInt64Memory0 === null || cachedBigInt64Memory0.byteLength === 0) {
132
- cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
133
- }
134
- return cachedBigInt64Memory0;
135
- }
136
-
137
119
  function debugString(val) {
138
120
  // primitive types
139
121
  const type = typeof val;
@@ -214,7 +196,7 @@ function handleError(f, args) {
214
196
 
215
197
  const WorkspaceFinalization = (typeof FinalizationRegistry === 'undefined')
216
198
  ? { register: () => {}, unregister: () => {} }
217
- : new FinalizationRegistry(ptr => wasm.__wbg_workspace_free(ptr >>> 0));
199
+ : new FinalizationRegistry(ptr => wasm.__wbg_workspace_free(ptr >>> 0, 1));
218
200
  /**
219
201
  */
220
202
  export class Workspace {
@@ -228,7 +210,7 @@ export class Workspace {
228
210
 
229
211
  free() {
230
212
  const ptr = this.__destroy_into_raw();
231
- wasm.__wbg_workspace_free(ptr);
213
+ wasm.__wbg_workspace_free(ptr, 0);
232
214
  }
233
215
  /**
234
216
  * @returns {string}
@@ -239,8 +221,8 @@ export class Workspace {
239
221
  try {
240
222
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
241
223
  wasm.workspace_version(retptr);
242
- var r0 = getInt32Memory0()[retptr / 4 + 0];
243
- var r1 = getInt32Memory0()[retptr / 4 + 1];
224
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
225
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
244
226
  deferred1_0 = r0;
245
227
  deferred1_1 = r1;
246
228
  return getStringFromWasm0(r0, r1);
@@ -256,13 +238,14 @@ export class Workspace {
256
238
  try {
257
239
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
258
240
  wasm.workspace_new(retptr, addHeapObject(options));
259
- var r0 = getInt32Memory0()[retptr / 4 + 0];
260
- var r1 = getInt32Memory0()[retptr / 4 + 1];
261
- var r2 = getInt32Memory0()[retptr / 4 + 2];
241
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
242
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
243
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
262
244
  if (r2) {
263
245
  throw takeObject(r1);
264
246
  }
265
247
  this.__wbg_ptr = r0 >>> 0;
248
+ WorkspaceFinalization.register(this, this.__wbg_ptr, this);
266
249
  return this;
267
250
  } finally {
268
251
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -275,9 +258,9 @@ export class Workspace {
275
258
  try {
276
259
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
277
260
  wasm.workspace_defaultSettings(retptr);
278
- var r0 = getInt32Memory0()[retptr / 4 + 0];
279
- var r1 = getInt32Memory0()[retptr / 4 + 1];
280
- var r2 = getInt32Memory0()[retptr / 4 + 2];
261
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
262
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
263
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
281
264
  if (r2) {
282
265
  throw takeObject(r1);
283
266
  }
@@ -296,9 +279,9 @@ export class Workspace {
296
279
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
297
280
  const len0 = WASM_VECTOR_LEN;
298
281
  wasm.workspace_check(retptr, this.__wbg_ptr, ptr0, len0);
299
- var r0 = getInt32Memory0()[retptr / 4 + 0];
300
- var r1 = getInt32Memory0()[retptr / 4 + 1];
301
- var r2 = getInt32Memory0()[retptr / 4 + 2];
282
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
283
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
284
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
302
285
  if (r2) {
303
286
  throw takeObject(r1);
304
287
  }
@@ -319,10 +302,10 @@ export class Workspace {
319
302
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
320
303
  const len0 = WASM_VECTOR_LEN;
321
304
  wasm.workspace_format(retptr, this.__wbg_ptr, ptr0, len0);
322
- var r0 = getInt32Memory0()[retptr / 4 + 0];
323
- var r1 = getInt32Memory0()[retptr / 4 + 1];
324
- var r2 = getInt32Memory0()[retptr / 4 + 2];
325
- var r3 = getInt32Memory0()[retptr / 4 + 3];
305
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
306
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
307
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
308
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
326
309
  var ptr2 = r0;
327
310
  var len2 = r1;
328
311
  if (r3) {
@@ -349,10 +332,10 @@ export class Workspace {
349
332
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
350
333
  const len0 = WASM_VECTOR_LEN;
351
334
  wasm.workspace_format_ir(retptr, this.__wbg_ptr, ptr0, len0);
352
- var r0 = getInt32Memory0()[retptr / 4 + 0];
353
- var r1 = getInt32Memory0()[retptr / 4 + 1];
354
- var r2 = getInt32Memory0()[retptr / 4 + 2];
355
- var r3 = getInt32Memory0()[retptr / 4 + 3];
335
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
336
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
337
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
338
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
356
339
  var ptr2 = r0;
357
340
  var len2 = r1;
358
341
  if (r3) {
@@ -379,10 +362,10 @@ export class Workspace {
379
362
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
380
363
  const len0 = WASM_VECTOR_LEN;
381
364
  wasm.workspace_comments(retptr, this.__wbg_ptr, ptr0, len0);
382
- var r0 = getInt32Memory0()[retptr / 4 + 0];
383
- var r1 = getInt32Memory0()[retptr / 4 + 1];
384
- var r2 = getInt32Memory0()[retptr / 4 + 2];
385
- var r3 = getInt32Memory0()[retptr / 4 + 3];
365
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
366
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
367
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
368
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
386
369
  var ptr2 = r0;
387
370
  var len2 = r1;
388
371
  if (r3) {
@@ -410,10 +393,10 @@ export class Workspace {
410
393
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
411
394
  const len0 = WASM_VECTOR_LEN;
412
395
  wasm.workspace_parse(retptr, this.__wbg_ptr, ptr0, len0);
413
- var r0 = getInt32Memory0()[retptr / 4 + 0];
414
- var r1 = getInt32Memory0()[retptr / 4 + 1];
415
- var r2 = getInt32Memory0()[retptr / 4 + 2];
416
- var r3 = getInt32Memory0()[retptr / 4 + 3];
396
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
397
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
398
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
399
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
417
400
  var ptr2 = r0;
418
401
  var len2 = r1;
419
402
  if (r3) {
@@ -440,10 +423,10 @@ export class Workspace {
440
423
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
441
424
  const len0 = WASM_VECTOR_LEN;
442
425
  wasm.workspace_tokens(retptr, this.__wbg_ptr, ptr0, len0);
443
- var r0 = getInt32Memory0()[retptr / 4 + 0];
444
- var r1 = getInt32Memory0()[retptr / 4 + 1];
445
- var r2 = getInt32Memory0()[retptr / 4 + 2];
446
- var r3 = getInt32Memory0()[retptr / 4 + 3];
426
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
427
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
428
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
429
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
447
430
  var ptr2 = r0;
448
431
  var len2 = r1;
449
432
  if (r3) {
@@ -525,16 +508,16 @@ function __wbg_get_imports() {
525
508
  imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
526
509
  const obj = getObject(arg1);
527
510
  const ret = typeof(obj) === 'number' ? obj : undefined;
528
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
529
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
511
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
512
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
530
513
  };
531
514
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
532
515
  const obj = getObject(arg1);
533
516
  const ret = typeof(obj) === 'string' ? obj : undefined;
534
517
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
535
518
  var len1 = WASM_VECTOR_LEN;
536
- getInt32Memory0()[arg0 / 4 + 1] = len1;
537
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
519
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
520
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
538
521
  };
539
522
  imports.wbg.__wbindgen_is_object = function(arg0) {
540
523
  const val = getObject(arg0);
@@ -577,8 +560,8 @@ function __wbg_get_imports() {
577
560
  const ret = String(getObject(arg1));
578
561
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
579
562
  const len1 = WASM_VECTOR_LEN;
580
- getInt32Memory0()[arg0 / 4 + 1] = len1;
581
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
563
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
564
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
582
565
  };
583
566
  imports.wbg.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
584
567
  const ret = getObject(arg0)[getObject(arg1)];
@@ -610,8 +593,8 @@ function __wbg_get_imports() {
610
593
  const ret = getObject(arg1).stack;
611
594
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
612
595
  const len1 = WASM_VECTOR_LEN;
613
- getInt32Memory0()[arg0 / 4 + 1] = len1;
614
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
596
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
597
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
615
598
  };
616
599
  imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
617
600
  let deferred0_0;
@@ -628,62 +611,62 @@ function __wbg_get_imports() {
628
611
  const ret = typeof(getObject(arg0)) === 'function';
629
612
  return ret;
630
613
  };
631
- imports.wbg.__wbg_get_bd8e338fbd5f5cc8 = function(arg0, arg1) {
614
+ imports.wbg.__wbg_get_3baa728f9d58d3f6 = function(arg0, arg1) {
632
615
  const ret = getObject(arg0)[arg1 >>> 0];
633
616
  return addHeapObject(ret);
634
617
  };
635
- imports.wbg.__wbg_length_cd7af8117672b8b8 = function(arg0) {
618
+ imports.wbg.__wbg_length_ae22078168b726f5 = function(arg0) {
636
619
  const ret = getObject(arg0).length;
637
620
  return ret;
638
621
  };
639
- imports.wbg.__wbg_new_16b304a2cfa7ff4a = function() {
622
+ imports.wbg.__wbg_new_a220cf903aa02ca2 = function() {
640
623
  const ret = new Array();
641
624
  return addHeapObject(ret);
642
625
  };
643
- imports.wbg.__wbg_new_d9bc3a0147634640 = function() {
626
+ imports.wbg.__wbg_new_8608a2b51a5f6737 = function() {
644
627
  const ret = new Map();
645
628
  return addHeapObject(ret);
646
629
  };
647
- imports.wbg.__wbg_next_40fc327bfc8770e6 = function(arg0) {
630
+ imports.wbg.__wbg_next_de3e9db4440638b2 = function(arg0) {
648
631
  const ret = getObject(arg0).next;
649
632
  return addHeapObject(ret);
650
633
  };
651
- imports.wbg.__wbg_next_196c84450b364254 = function() { return handleError(function (arg0) {
634
+ imports.wbg.__wbg_next_f9cb570345655b9a = function() { return handleError(function (arg0) {
652
635
  const ret = getObject(arg0).next();
653
636
  return addHeapObject(ret);
654
637
  }, arguments) };
655
- imports.wbg.__wbg_done_298b57d23c0fc80c = function(arg0) {
638
+ imports.wbg.__wbg_done_bfda7aa8f252b39f = function(arg0) {
656
639
  const ret = getObject(arg0).done;
657
640
  return ret;
658
641
  };
659
- imports.wbg.__wbg_value_d93c65011f51a456 = function(arg0) {
642
+ imports.wbg.__wbg_value_6d39332ab4788d86 = function(arg0) {
660
643
  const ret = getObject(arg0).value;
661
644
  return addHeapObject(ret);
662
645
  };
663
- imports.wbg.__wbg_iterator_2cee6dadfd956dfa = function() {
646
+ imports.wbg.__wbg_iterator_888179a48810a9fe = function() {
664
647
  const ret = Symbol.iterator;
665
648
  return addHeapObject(ret);
666
649
  };
667
- imports.wbg.__wbg_get_e3c254076557e348 = function() { return handleError(function (arg0, arg1) {
650
+ imports.wbg.__wbg_get_224d16597dbbfd96 = function() { return handleError(function (arg0, arg1) {
668
651
  const ret = Reflect.get(getObject(arg0), getObject(arg1));
669
652
  return addHeapObject(ret);
670
653
  }, arguments) };
671
- imports.wbg.__wbg_call_27c0f87801dedf93 = function() { return handleError(function (arg0, arg1) {
654
+ imports.wbg.__wbg_call_1084a111329e68ce = function() { return handleError(function (arg0, arg1) {
672
655
  const ret = getObject(arg0).call(getObject(arg1));
673
656
  return addHeapObject(ret);
674
657
  }, arguments) };
675
- imports.wbg.__wbg_new_72fb9a18b5ae2624 = function() {
658
+ imports.wbg.__wbg_new_525245e2b9901204 = function() {
676
659
  const ret = new Object();
677
660
  return addHeapObject(ret);
678
661
  };
679
- imports.wbg.__wbg_set_d4638f722068f043 = function(arg0, arg1, arg2) {
662
+ imports.wbg.__wbg_set_673dda6c73d19609 = function(arg0, arg1, arg2) {
680
663
  getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
681
664
  };
682
- imports.wbg.__wbg_isArray_2ab64d95e09ea0ae = function(arg0) {
665
+ imports.wbg.__wbg_isArray_8364a5371e9737d8 = function(arg0) {
683
666
  const ret = Array.isArray(getObject(arg0));
684
667
  return ret;
685
668
  };
686
- imports.wbg.__wbg_instanceof_ArrayBuffer_836825be07d4c9d2 = function(arg0) {
669
+ imports.wbg.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function(arg0) {
687
670
  let result;
688
671
  try {
689
672
  result = getObject(arg0) instanceof ArrayBuffer;
@@ -693,11 +676,11 @@ function __wbg_get_imports() {
693
676
  const ret = result;
694
677
  return ret;
695
678
  };
696
- imports.wbg.__wbg_new_28c511d9baebfa89 = function(arg0, arg1) {
679
+ imports.wbg.__wbg_new_796382978dfd4fb0 = function(arg0, arg1) {
697
680
  const ret = new Error(getStringFromWasm0(arg0, arg1));
698
681
  return addHeapObject(ret);
699
682
  };
700
- imports.wbg.__wbg_instanceof_Map_87917e0a7aaf4012 = function(arg0) {
683
+ imports.wbg.__wbg_instanceof_Map_763ce0e95960d55e = function(arg0) {
701
684
  let result;
702
685
  try {
703
686
  result = getObject(arg0) instanceof Map;
@@ -707,38 +690,38 @@ function __wbg_get_imports() {
707
690
  const ret = result;
708
691
  return ret;
709
692
  };
710
- imports.wbg.__wbg_set_8417257aaedc936b = function(arg0, arg1, arg2) {
693
+ imports.wbg.__wbg_set_49185437f0ab06f8 = function(arg0, arg1, arg2) {
711
694
  const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
712
695
  return addHeapObject(ret);
713
696
  };
714
- imports.wbg.__wbg_isSafeInteger_f7b04ef02296c4d2 = function(arg0) {
697
+ imports.wbg.__wbg_isSafeInteger_7f1ed56200d90674 = function(arg0) {
715
698
  const ret = Number.isSafeInteger(getObject(arg0));
716
699
  return ret;
717
700
  };
718
- imports.wbg.__wbg_entries_95cc2c823b285a09 = function(arg0) {
701
+ imports.wbg.__wbg_entries_7a0e06255456ebcd = function(arg0) {
719
702
  const ret = Object.entries(getObject(arg0));
720
703
  return addHeapObject(ret);
721
704
  };
722
- imports.wbg.__wbg_fromCodePoint_cedd7612a2ff688f = function() { return handleError(function (arg0) {
705
+ imports.wbg.__wbg_fromCodePoint_ae875c4ff5f6a86b = function() { return handleError(function (arg0) {
723
706
  const ret = String.fromCodePoint(arg0 >>> 0);
724
707
  return addHeapObject(ret);
725
708
  }, arguments) };
726
- imports.wbg.__wbg_buffer_12d079cc21e14bdb = function(arg0) {
709
+ imports.wbg.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
727
710
  const ret = getObject(arg0).buffer;
728
711
  return addHeapObject(ret);
729
712
  };
730
- imports.wbg.__wbg_new_63b92bc8671ed464 = function(arg0) {
713
+ imports.wbg.__wbg_new_ea1883e1e5e86686 = function(arg0) {
731
714
  const ret = new Uint8Array(getObject(arg0));
732
715
  return addHeapObject(ret);
733
716
  };
734
- imports.wbg.__wbg_set_a47bac70306a19a7 = function(arg0, arg1, arg2) {
717
+ imports.wbg.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
735
718
  getObject(arg0).set(getObject(arg1), arg2 >>> 0);
736
719
  };
737
- imports.wbg.__wbg_length_c20a40f15020d68a = function(arg0) {
720
+ imports.wbg.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
738
721
  const ret = getObject(arg0).length;
739
722
  return ret;
740
723
  };
741
- imports.wbg.__wbg_instanceof_Uint8Array_2b3bbecd033d19f6 = function(arg0) {
724
+ imports.wbg.__wbg_instanceof_Uint8Array_247a91427532499e = function(arg0) {
742
725
  let result;
743
726
  try {
744
727
  result = getObject(arg0) instanceof Uint8Array;
@@ -751,15 +734,15 @@ function __wbg_get_imports() {
751
734
  imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
752
735
  const v = getObject(arg1);
753
736
  const ret = typeof(v) === 'bigint' ? v : undefined;
754
- getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? BigInt(0) : ret;
755
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
737
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
738
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
756
739
  };
757
740
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
758
741
  const ret = debugString(getObject(arg1));
759
742
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
760
743
  const len1 = WASM_VECTOR_LEN;
761
- getInt32Memory0()[arg0 / 4 + 1] = len1;
762
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
744
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
745
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
763
746
  };
764
747
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
765
748
  throw new Error(getStringFromWasm0(arg0, arg1));
@@ -772,17 +755,16 @@ function __wbg_get_imports() {
772
755
  return imports;
773
756
  }
774
757
 
775
- function __wbg_init_memory(imports, maybe_memory) {
758
+ function __wbg_init_memory(imports, memory) {
776
759
 
777
760
  }
778
761
 
779
762
  function __wbg_finalize_init(instance, module) {
780
763
  wasm = instance.exports;
781
764
  __wbg_init.__wbindgen_wasm_module = module;
782
- cachedBigInt64Memory0 = null;
783
- cachedFloat64Memory0 = null;
784
- cachedInt32Memory0 = null;
785
- cachedUint8Memory0 = null;
765
+ cachedDataViewMemory0 = null;
766
+ cachedUint8ArrayMemory0 = null;
767
+
786
768
 
787
769
  wasm.__wbindgen_start();
788
770
  return wasm;
@@ -791,6 +773,12 @@ function __wbg_finalize_init(instance, module) {
791
773
  function initSync(module) {
792
774
  if (wasm !== undefined) return wasm;
793
775
 
776
+
777
+ if (typeof module !== 'undefined' && Object.getPrototypeOf(module) === Object.prototype)
778
+ ({module} = module)
779
+ else
780
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
781
+
794
782
  const imports = __wbg_get_imports();
795
783
 
796
784
  __wbg_init_memory(imports);
@@ -804,24 +792,30 @@ function initSync(module) {
804
792
  return __wbg_finalize_init(instance, module);
805
793
  }
806
794
 
807
- async function __wbg_init(input) {
795
+ async function __wbg_init(module_or_path) {
808
796
  if (wasm !== undefined) return wasm;
809
797
 
810
- if (typeof input === 'undefined') {
811
- input = new URL('ruff_wasm_bg.wasm', import.meta.url);
798
+
799
+ if (typeof module_or_path !== 'undefined' && Object.getPrototypeOf(module_or_path) === Object.prototype)
800
+ ({module_or_path} = module_or_path)
801
+ else
802
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
803
+
804
+ if (typeof module_or_path === 'undefined') {
805
+ module_or_path = new URL('ruff_wasm_bg.wasm', import.meta.url);
812
806
  }
813
807
  const imports = __wbg_get_imports();
814
808
 
815
- if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
816
- input = fetch(input);
809
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
810
+ module_or_path = fetch(module_or_path);
817
811
  }
818
812
 
819
813
  __wbg_init_memory(imports);
820
814
 
821
- const { instance, module } = await __wbg_load(await input, imports);
815
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
822
816
 
823
817
  return __wbg_finalize_init(instance, module);
824
818
  }
825
819
 
826
- export { initSync }
820
+ export { initSync };
827
821
  export default __wbg_init;
package/ruff_wasm_bg.wasm CHANGED
Binary file