@astral-sh/ruff-wasm-nodejs 0.6.9 → 0.7.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
@@ -4,7 +4,7 @@
4
4
  "Charlie Marsh <charlie.r.marsh@gmail.com>"
5
5
  ],
6
6
  "description": "WebAssembly bindings for Ruff",
7
- "version": "0.6.9",
7
+ "version": "0.7.1",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
package/ruff_wasm.d.ts CHANGED
@@ -1,7 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- /**
4
- */
5
3
  export function run(): void;
6
4
 
7
5
  export interface Diagnostic {
@@ -32,51 +30,49 @@ export interface Diagnostic {
32
30
  };
33
31
 
34
32
 
35
- /**
36
- */
37
33
  export class Workspace {
38
34
  free(): void;
39
- /**
40
- * @returns {string}
41
- */
35
+ /**
36
+ * @returns {string}
37
+ */
42
38
  static version(): string;
43
- /**
44
- * @param {any} options
45
- */
39
+ /**
40
+ * @param {any} options
41
+ */
46
42
  constructor(options: any);
47
- /**
48
- * @returns {any}
49
- */
43
+ /**
44
+ * @returns {any}
45
+ */
50
46
  static defaultSettings(): any;
51
- /**
52
- * @param {string} contents
53
- * @returns {any}
54
- */
47
+ /**
48
+ * @param {string} contents
49
+ * @returns {any}
50
+ */
55
51
  check(contents: string): any;
56
- /**
57
- * @param {string} contents
58
- * @returns {string}
59
- */
52
+ /**
53
+ * @param {string} contents
54
+ * @returns {string}
55
+ */
60
56
  format(contents: string): string;
61
- /**
62
- * @param {string} contents
63
- * @returns {string}
64
- */
57
+ /**
58
+ * @param {string} contents
59
+ * @returns {string}
60
+ */
65
61
  format_ir(contents: string): string;
66
- /**
67
- * @param {string} contents
68
- * @returns {string}
69
- */
62
+ /**
63
+ * @param {string} contents
64
+ * @returns {string}
65
+ */
70
66
  comments(contents: string): string;
71
- /**
72
- * Parses the content and returns its AST
73
- * @param {string} contents
74
- * @returns {string}
75
- */
67
+ /**
68
+ * Parses the content and returns its AST
69
+ * @param {string} contents
70
+ * @returns {string}
71
+ */
76
72
  parse(contents: string): string;
77
- /**
78
- * @param {string} contents
79
- * @returns {string}
80
- */
73
+ /**
74
+ * @param {string} contents
75
+ * @returns {string}
76
+ */
81
77
  tokens(contents: string): string;
82
78
  }
package/ruff_wasm.js CHANGED
@@ -4,26 +4,6 @@ imports['__wbindgen_placeholder__'] = module.exports;
4
4
  let wasm;
5
5
  const { TextDecoder, TextEncoder } = require(`util`);
6
6
 
7
- const heap = new Array(128).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
12
-
13
- let heap_next = heap.length;
14
-
15
- function dropObject(idx) {
16
- if (idx < 132) return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
19
- }
20
-
21
- function takeObject(idx) {
22
- const ret = getObject(idx);
23
- dropObject(idx);
24
- return ret;
25
- }
26
-
27
7
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
28
8
 
29
9
  cachedTextDecoder.decode();
@@ -42,15 +22,6 @@ function getStringFromWasm0(ptr, len) {
42
22
  return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
43
23
  }
44
24
 
45
- function addHeapObject(obj) {
46
- if (heap_next === heap.length) heap.push(heap.length + 1);
47
- const idx = heap_next;
48
- heap_next = heap[idx];
49
-
50
- heap[idx] = obj;
51
- return idx;
52
- }
53
-
54
25
  function isLikeNone(x) {
55
26
  return x === undefined || x === null;
56
27
  }
@@ -184,25 +155,38 @@ function debugString(val) {
184
155
  // TODO we could test for more things here, like `Set`s and `Map`s.
185
156
  return className;
186
157
  }
187
- /**
188
- */
158
+
189
159
  module.exports.run = function() {
190
160
  wasm.run();
191
161
  };
192
162
 
163
+ function takeFromExternrefTable0(idx) {
164
+ const value = wasm.__wbindgen_export_2.get(idx);
165
+ wasm.__externref_table_dealloc(idx);
166
+ return value;
167
+ }
168
+
169
+ function notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; }
170
+
171
+ function addToExternrefTable0(obj) {
172
+ const idx = wasm.__externref_table_alloc();
173
+ wasm.__wbindgen_export_2.set(idx, obj);
174
+ return idx;
175
+ }
176
+
193
177
  function handleError(f, args) {
194
178
  try {
195
179
  return f.apply(this, args);
196
180
  } catch (e) {
197
- wasm.__wbindgen_exn_store(addHeapObject(e));
181
+ const idx = addToExternrefTable0(e);
182
+ wasm.__wbindgen_exn_store(idx);
198
183
  }
199
184
  }
200
185
 
201
186
  const WorkspaceFinalization = (typeof FinalizationRegistry === 'undefined')
202
187
  ? { register: () => {}, unregister: () => {} }
203
188
  : new FinalizationRegistry(ptr => wasm.__wbg_workspace_free(ptr >>> 0, 1));
204
- /**
205
- */
189
+
206
190
  class Workspace {
207
191
 
208
192
  __destroy_into_raw() {
@@ -217,281 +201,214 @@ class Workspace {
217
201
  wasm.__wbg_workspace_free(ptr, 0);
218
202
  }
219
203
  /**
220
- * @returns {string}
221
- */
204
+ * @returns {string}
205
+ */
222
206
  static version() {
223
207
  let deferred1_0;
224
208
  let deferred1_1;
225
209
  try {
226
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
227
- wasm.workspace_version(retptr);
228
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
229
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
230
- deferred1_0 = r0;
231
- deferred1_1 = r1;
232
- return getStringFromWasm0(r0, r1);
210
+ const ret = wasm.workspace_version();
211
+ deferred1_0 = ret[0];
212
+ deferred1_1 = ret[1];
213
+ return getStringFromWasm0(ret[0], ret[1]);
233
214
  } finally {
234
- wasm.__wbindgen_add_to_stack_pointer(16);
235
215
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
236
216
  }
237
217
  }
238
218
  /**
239
- * @param {any} options
240
- */
219
+ * @param {any} options
220
+ */
241
221
  constructor(options) {
242
- try {
243
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
244
- wasm.workspace_new(retptr, addHeapObject(options));
245
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
246
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
247
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
248
- if (r2) {
249
- throw takeObject(r1);
250
- }
251
- this.__wbg_ptr = r0 >>> 0;
252
- WorkspaceFinalization.register(this, this.__wbg_ptr, this);
253
- return this;
254
- } finally {
255
- wasm.__wbindgen_add_to_stack_pointer(16);
222
+ const ret = wasm.workspace_new(options);
223
+ if (ret[2]) {
224
+ throw takeFromExternrefTable0(ret[1]);
256
225
  }
226
+ this.__wbg_ptr = ret[0] >>> 0;
227
+ WorkspaceFinalization.register(this, this.__wbg_ptr, this);
228
+ return this;
257
229
  }
258
230
  /**
259
- * @returns {any}
260
- */
231
+ * @returns {any}
232
+ */
261
233
  static defaultSettings() {
262
- try {
263
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
264
- wasm.workspace_defaultSettings(retptr);
265
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
266
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
267
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
268
- if (r2) {
269
- throw takeObject(r1);
270
- }
271
- return takeObject(r0);
272
- } finally {
273
- wasm.__wbindgen_add_to_stack_pointer(16);
234
+ const ret = wasm.workspace_defaultSettings();
235
+ if (ret[2]) {
236
+ throw takeFromExternrefTable0(ret[1]);
274
237
  }
238
+ return takeFromExternrefTable0(ret[0]);
275
239
  }
276
240
  /**
277
- * @param {string} contents
278
- * @returns {any}
279
- */
241
+ * @param {string} contents
242
+ * @returns {any}
243
+ */
280
244
  check(contents) {
281
- try {
282
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
283
- const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
284
- const len0 = WASM_VECTOR_LEN;
285
- wasm.workspace_check(retptr, this.__wbg_ptr, ptr0, len0);
286
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
287
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
288
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
289
- if (r2) {
290
- throw takeObject(r1);
291
- }
292
- return takeObject(r0);
293
- } finally {
294
- wasm.__wbindgen_add_to_stack_pointer(16);
245
+ const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
246
+ const len0 = WASM_VECTOR_LEN;
247
+ const ret = wasm.workspace_check(this.__wbg_ptr, ptr0, len0);
248
+ if (ret[2]) {
249
+ throw takeFromExternrefTable0(ret[1]);
295
250
  }
251
+ return takeFromExternrefTable0(ret[0]);
296
252
  }
297
253
  /**
298
- * @param {string} contents
299
- * @returns {string}
300
- */
254
+ * @param {string} contents
255
+ * @returns {string}
256
+ */
301
257
  format(contents) {
302
258
  let deferred3_0;
303
259
  let deferred3_1;
304
260
  try {
305
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
306
261
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
307
262
  const len0 = WASM_VECTOR_LEN;
308
- wasm.workspace_format(retptr, this.__wbg_ptr, ptr0, len0);
309
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
310
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
311
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
312
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
313
- var ptr2 = r0;
314
- var len2 = r1;
315
- if (r3) {
263
+ const ret = wasm.workspace_format(this.__wbg_ptr, ptr0, len0);
264
+ var ptr2 = ret[0];
265
+ var len2 = ret[1];
266
+ if (ret[3]) {
316
267
  ptr2 = 0; len2 = 0;
317
- throw takeObject(r2);
268
+ throw takeFromExternrefTable0(ret[2]);
318
269
  }
319
270
  deferred3_0 = ptr2;
320
271
  deferred3_1 = len2;
321
272
  return getStringFromWasm0(ptr2, len2);
322
273
  } finally {
323
- wasm.__wbindgen_add_to_stack_pointer(16);
324
274
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
325
275
  }
326
276
  }
327
277
  /**
328
- * @param {string} contents
329
- * @returns {string}
330
- */
278
+ * @param {string} contents
279
+ * @returns {string}
280
+ */
331
281
  format_ir(contents) {
332
282
  let deferred3_0;
333
283
  let deferred3_1;
334
284
  try {
335
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
336
285
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
337
286
  const len0 = WASM_VECTOR_LEN;
338
- wasm.workspace_format_ir(retptr, this.__wbg_ptr, ptr0, len0);
339
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
340
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
341
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
342
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
343
- var ptr2 = r0;
344
- var len2 = r1;
345
- if (r3) {
287
+ const ret = wasm.workspace_format_ir(this.__wbg_ptr, ptr0, len0);
288
+ var ptr2 = ret[0];
289
+ var len2 = ret[1];
290
+ if (ret[3]) {
346
291
  ptr2 = 0; len2 = 0;
347
- throw takeObject(r2);
292
+ throw takeFromExternrefTable0(ret[2]);
348
293
  }
349
294
  deferred3_0 = ptr2;
350
295
  deferred3_1 = len2;
351
296
  return getStringFromWasm0(ptr2, len2);
352
297
  } finally {
353
- wasm.__wbindgen_add_to_stack_pointer(16);
354
298
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
355
299
  }
356
300
  }
357
301
  /**
358
- * @param {string} contents
359
- * @returns {string}
360
- */
302
+ * @param {string} contents
303
+ * @returns {string}
304
+ */
361
305
  comments(contents) {
362
306
  let deferred3_0;
363
307
  let deferred3_1;
364
308
  try {
365
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
366
309
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
367
310
  const len0 = WASM_VECTOR_LEN;
368
- wasm.workspace_comments(retptr, this.__wbg_ptr, ptr0, len0);
369
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
370
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
371
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
372
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
373
- var ptr2 = r0;
374
- var len2 = r1;
375
- if (r3) {
311
+ const ret = wasm.workspace_comments(this.__wbg_ptr, ptr0, len0);
312
+ var ptr2 = ret[0];
313
+ var len2 = ret[1];
314
+ if (ret[3]) {
376
315
  ptr2 = 0; len2 = 0;
377
- throw takeObject(r2);
316
+ throw takeFromExternrefTable0(ret[2]);
378
317
  }
379
318
  deferred3_0 = ptr2;
380
319
  deferred3_1 = len2;
381
320
  return getStringFromWasm0(ptr2, len2);
382
321
  } finally {
383
- wasm.__wbindgen_add_to_stack_pointer(16);
384
322
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
385
323
  }
386
324
  }
387
325
  /**
388
- * Parses the content and returns its AST
389
- * @param {string} contents
390
- * @returns {string}
391
- */
326
+ * Parses the content and returns its AST
327
+ * @param {string} contents
328
+ * @returns {string}
329
+ */
392
330
  parse(contents) {
393
331
  let deferred3_0;
394
332
  let deferred3_1;
395
333
  try {
396
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
397
334
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
398
335
  const len0 = WASM_VECTOR_LEN;
399
- wasm.workspace_parse(retptr, this.__wbg_ptr, ptr0, len0);
400
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
401
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
402
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
403
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
404
- var ptr2 = r0;
405
- var len2 = r1;
406
- if (r3) {
336
+ const ret = wasm.workspace_parse(this.__wbg_ptr, ptr0, len0);
337
+ var ptr2 = ret[0];
338
+ var len2 = ret[1];
339
+ if (ret[3]) {
407
340
  ptr2 = 0; len2 = 0;
408
- throw takeObject(r2);
341
+ throw takeFromExternrefTable0(ret[2]);
409
342
  }
410
343
  deferred3_0 = ptr2;
411
344
  deferred3_1 = len2;
412
345
  return getStringFromWasm0(ptr2, len2);
413
346
  } finally {
414
- wasm.__wbindgen_add_to_stack_pointer(16);
415
347
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
416
348
  }
417
349
  }
418
350
  /**
419
- * @param {string} contents
420
- * @returns {string}
421
- */
351
+ * @param {string} contents
352
+ * @returns {string}
353
+ */
422
354
  tokens(contents) {
423
355
  let deferred3_0;
424
356
  let deferred3_1;
425
357
  try {
426
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
427
358
  const ptr0 = passStringToWasm0(contents, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
428
359
  const len0 = WASM_VECTOR_LEN;
429
- wasm.workspace_tokens(retptr, this.__wbg_ptr, ptr0, len0);
430
- var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
431
- var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
432
- var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
433
- var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
434
- var ptr2 = r0;
435
- var len2 = r1;
436
- if (r3) {
360
+ const ret = wasm.workspace_tokens(this.__wbg_ptr, ptr0, len0);
361
+ var ptr2 = ret[0];
362
+ var len2 = ret[1];
363
+ if (ret[3]) {
437
364
  ptr2 = 0; len2 = 0;
438
- throw takeObject(r2);
365
+ throw takeFromExternrefTable0(ret[2]);
439
366
  }
440
367
  deferred3_0 = ptr2;
441
368
  deferred3_1 = len2;
442
369
  return getStringFromWasm0(ptr2, len2);
443
370
  } finally {
444
- wasm.__wbindgen_add_to_stack_pointer(16);
445
371
  wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
446
372
  }
447
373
  }
448
374
  }
449
375
  module.exports.Workspace = Workspace;
450
376
 
451
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
452
- takeObject(arg0);
453
- };
454
-
455
377
  module.exports.__wbindgen_is_string = function(arg0) {
456
- const ret = typeof(getObject(arg0)) === 'string';
378
+ const ret = typeof(arg0) === 'string';
457
379
  return ret;
458
380
  };
459
381
 
460
382
  module.exports.__wbindgen_error_new = function(arg0, arg1) {
461
383
  const ret = new Error(getStringFromWasm0(arg0, arg1));
462
- return addHeapObject(ret);
384
+ return ret;
463
385
  };
464
386
 
465
387
  module.exports.__wbindgen_as_number = function(arg0) {
466
- const ret = +getObject(arg0);
388
+ const ret = +arg0;
467
389
  return ret;
468
390
  };
469
391
 
470
- module.exports.__wbindgen_object_clone_ref = function(arg0) {
471
- const ret = getObject(arg0);
472
- return addHeapObject(ret);
473
- };
474
-
475
392
  module.exports.__wbindgen_boolean_get = function(arg0) {
476
- const v = getObject(arg0);
393
+ const v = arg0;
477
394
  const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
478
395
  return ret;
479
396
  };
480
397
 
481
398
  module.exports.__wbindgen_is_bigint = function(arg0) {
482
- const ret = typeof(getObject(arg0)) === 'bigint';
399
+ const ret = typeof(arg0) === 'bigint';
483
400
  return ret;
484
401
  };
485
402
 
486
403
  module.exports.__wbindgen_number_get = function(arg0, arg1) {
487
- const obj = getObject(arg1);
404
+ const obj = arg1;
488
405
  const ret = typeof(obj) === 'number' ? obj : undefined;
489
406
  getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
490
407
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
491
408
  };
492
409
 
493
410
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
494
- const obj = getObject(arg1);
411
+ const obj = arg1;
495
412
  const ret = typeof(obj) === 'string' ? obj : undefined;
496
413
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
497
414
  var len1 = WASM_VECTOR_LEN;
@@ -500,53 +417,53 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
500
417
  };
501
418
 
502
419
  module.exports.__wbindgen_is_object = function(arg0) {
503
- const val = getObject(arg0);
420
+ const val = arg0;
504
421
  const ret = typeof(val) === 'object' && val !== null;
505
422
  return ret;
506
423
  };
507
424
 
508
425
  module.exports.__wbindgen_in = function(arg0, arg1) {
509
- const ret = getObject(arg0) in getObject(arg1);
426
+ const ret = arg0 in arg1;
510
427
  return ret;
511
428
  };
512
429
 
513
430
  module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
514
431
  const ret = arg0;
515
- return addHeapObject(ret);
432
+ return ret;
516
433
  };
517
434
 
518
435
  module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
519
- const ret = getObject(arg0) === getObject(arg1);
436
+ const ret = arg0 === arg1;
520
437
  return ret;
521
438
  };
522
439
 
523
440
  module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
524
441
  const ret = BigInt.asUintN(64, arg0);
525
- return addHeapObject(ret);
442
+ return ret;
526
443
  };
527
444
 
528
445
  module.exports.__wbindgen_is_undefined = function(arg0) {
529
- const ret = getObject(arg0) === undefined;
446
+ const ret = arg0 === undefined;
447
+ return ret;
448
+ };
449
+
450
+ module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
451
+ const ret = arg0 == arg1;
530
452
  return ret;
531
453
  };
532
454
 
533
455
  module.exports.__wbindgen_number_new = function(arg0) {
534
456
  const ret = arg0;
535
- return addHeapObject(ret);
457
+ return ret;
536
458
  };
537
459
 
538
460
  module.exports.__wbindgen_string_new = function(arg0, arg1) {
539
461
  const ret = getStringFromWasm0(arg0, arg1);
540
- return addHeapObject(ret);
541
- };
542
-
543
- module.exports.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
544
- const ret = getObject(arg0) == getObject(arg1);
545
462
  return ret;
546
463
  };
547
464
 
548
465
  module.exports.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
549
- const ret = String(getObject(arg1));
466
+ const ret = String(arg1);
550
467
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
551
468
  const len1 = WASM_VECTOR_LEN;
552
469
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
@@ -554,41 +471,31 @@ module.exports.__wbg_String_b9412f8799faab3e = function(arg0, arg1) {
554
471
  };
555
472
 
556
473
  module.exports.__wbg_getwithrefkey_edc2c8960f0f1191 = function(arg0, arg1) {
557
- const ret = getObject(arg0)[getObject(arg1)];
558
- return addHeapObject(ret);
474
+ const ret = arg0[arg1];
475
+ return ret;
559
476
  };
560
477
 
561
478
  module.exports.__wbg_set_f975102236d3c502 = function(arg0, arg1, arg2) {
562
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
479
+ arg0[arg1] = arg2;
563
480
  };
564
481
 
565
- module.exports.__wbg_debug_5fb96680aecf5dc8 = function(arg0) {
566
- console.debug(getObject(arg0));
567
- };
482
+ module.exports.__wbg_debug_5fb96680aecf5dc8 = typeof console.debug == 'function' ? console.debug : notDefined('console.debug');
568
483
 
569
- module.exports.__wbg_error_8e3928cfb8a43e2b = function(arg0) {
570
- console.error(getObject(arg0));
571
- };
484
+ module.exports.__wbg_error_8e3928cfb8a43e2b = typeof console.error == 'function' ? console.error : notDefined('console.error');
572
485
 
573
- module.exports.__wbg_info_530a29cb2e4e3304 = function(arg0) {
574
- console.info(getObject(arg0));
575
- };
486
+ module.exports.__wbg_info_530a29cb2e4e3304 = typeof console.info == 'function' ? console.info : notDefined('console.info');
576
487
 
577
- module.exports.__wbg_log_5bb5f88f245d7762 = function(arg0) {
578
- console.log(getObject(arg0));
579
- };
488
+ module.exports.__wbg_log_5bb5f88f245d7762 = typeof console.log == 'function' ? console.log : notDefined('console.log');
580
489
 
581
- module.exports.__wbg_warn_63bbae1730aead09 = function(arg0) {
582
- console.warn(getObject(arg0));
583
- };
490
+ module.exports.__wbg_warn_63bbae1730aead09 = typeof console.warn == 'function' ? console.warn : notDefined('console.warn');
584
491
 
585
492
  module.exports.__wbg_new_abda76e883ba8a5f = function() {
586
493
  const ret = new Error();
587
- return addHeapObject(ret);
494
+ return ret;
588
495
  };
589
496
 
590
497
  module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
591
- const ret = getObject(arg1).stack;
498
+ const ret = arg1.stack;
592
499
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
593
500
  const len1 = WASM_VECTOR_LEN;
594
501
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
@@ -608,83 +515,83 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
608
515
  };
609
516
 
610
517
  module.exports.__wbindgen_is_function = function(arg0) {
611
- const ret = typeof(getObject(arg0)) === 'function';
518
+ const ret = typeof(arg0) === 'function';
612
519
  return ret;
613
520
  };
614
521
 
615
- module.exports.__wbg_get_3baa728f9d58d3f6 = function(arg0, arg1) {
616
- const ret = getObject(arg0)[arg1 >>> 0];
617
- return addHeapObject(ret);
522
+ module.exports.__wbg_get_5419cf6b954aa11d = function(arg0, arg1) {
523
+ const ret = arg0[arg1 >>> 0];
524
+ return ret;
618
525
  };
619
526
 
620
- module.exports.__wbg_length_ae22078168b726f5 = function(arg0) {
621
- const ret = getObject(arg0).length;
527
+ module.exports.__wbg_length_f217bbbf7e8e4df4 = function(arg0) {
528
+ const ret = arg0.length;
622
529
  return ret;
623
530
  };
624
531
 
625
- module.exports.__wbg_new_a220cf903aa02ca2 = function() {
532
+ module.exports.__wbg_new_034f913e7636e987 = function() {
626
533
  const ret = new Array();
627
- return addHeapObject(ret);
534
+ return ret;
628
535
  };
629
536
 
630
- module.exports.__wbg_new_8608a2b51a5f6737 = function() {
537
+ module.exports.__wbg_new_7a87a0376e40533b = function() {
631
538
  const ret = new Map();
632
- return addHeapObject(ret);
539
+ return ret;
633
540
  };
634
541
 
635
- module.exports.__wbg_next_de3e9db4440638b2 = function(arg0) {
636
- const ret = getObject(arg0).next;
637
- return addHeapObject(ret);
542
+ module.exports.__wbg_next_13b477da1eaa3897 = function(arg0) {
543
+ const ret = arg0.next;
544
+ return ret;
638
545
  };
639
546
 
640
- module.exports.__wbg_next_f9cb570345655b9a = function() { return handleError(function (arg0) {
641
- const ret = getObject(arg0).next();
642
- return addHeapObject(ret);
547
+ module.exports.__wbg_next_b06e115d1b01e10b = function() { return handleError(function (arg0) {
548
+ const ret = arg0.next();
549
+ return ret;
643
550
  }, arguments) };
644
551
 
645
- module.exports.__wbg_done_bfda7aa8f252b39f = function(arg0) {
646
- const ret = getObject(arg0).done;
552
+ module.exports.__wbg_done_983b5ffcaec8c583 = function(arg0) {
553
+ const ret = arg0.done;
647
554
  return ret;
648
555
  };
649
556
 
650
- module.exports.__wbg_value_6d39332ab4788d86 = function(arg0) {
651
- const ret = getObject(arg0).value;
652
- return addHeapObject(ret);
557
+ module.exports.__wbg_value_2ab8a198c834c26a = function(arg0) {
558
+ const ret = arg0.value;
559
+ return ret;
653
560
  };
654
561
 
655
- module.exports.__wbg_iterator_888179a48810a9fe = function() {
562
+ module.exports.__wbg_iterator_695d699a44d6234c = function() {
656
563
  const ret = Symbol.iterator;
657
- return addHeapObject(ret);
564
+ return ret;
658
565
  };
659
566
 
660
- module.exports.__wbg_get_224d16597dbbfd96 = function() { return handleError(function (arg0, arg1) {
661
- const ret = Reflect.get(getObject(arg0), getObject(arg1));
662
- return addHeapObject(ret);
567
+ module.exports.__wbg_get_ef828680c64da212 = function() { return handleError(function (arg0, arg1) {
568
+ const ret = Reflect.get(arg0, arg1);
569
+ return ret;
663
570
  }, arguments) };
664
571
 
665
- module.exports.__wbg_call_1084a111329e68ce = function() { return handleError(function (arg0, arg1) {
666
- const ret = getObject(arg0).call(getObject(arg1));
667
- return addHeapObject(ret);
572
+ module.exports.__wbg_call_a9ef466721e824f2 = function() { return handleError(function (arg0, arg1) {
573
+ const ret = arg0.call(arg1);
574
+ return ret;
668
575
  }, arguments) };
669
576
 
670
- module.exports.__wbg_new_525245e2b9901204 = function() {
577
+ module.exports.__wbg_new_e69b5f66fda8f13c = function() {
671
578
  const ret = new Object();
672
- return addHeapObject(ret);
579
+ return ret;
673
580
  };
674
581
 
675
- module.exports.__wbg_set_673dda6c73d19609 = function(arg0, arg1, arg2) {
676
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
582
+ module.exports.__wbg_set_425e70f7c64ac962 = function(arg0, arg1, arg2) {
583
+ arg0[arg1 >>> 0] = arg2;
677
584
  };
678
585
 
679
- module.exports.__wbg_isArray_8364a5371e9737d8 = function(arg0) {
680
- const ret = Array.isArray(getObject(arg0));
586
+ module.exports.__wbg_isArray_6f3b47f09adb61b5 = function(arg0) {
587
+ const ret = Array.isArray(arg0);
681
588
  return ret;
682
589
  };
683
590
 
684
- module.exports.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function(arg0) {
591
+ module.exports.__wbg_instanceof_ArrayBuffer_74945570b4a62ec7 = function(arg0) {
685
592
  let result;
686
593
  try {
687
- result = getObject(arg0) instanceof ArrayBuffer;
594
+ result = arg0 instanceof ArrayBuffer;
688
595
  } catch (_) {
689
596
  result = false;
690
597
  }
@@ -692,15 +599,15 @@ module.exports.__wbg_instanceof_ArrayBuffer_61dfc3198373c902 = function(arg0) {
692
599
  return ret;
693
600
  };
694
601
 
695
- module.exports.__wbg_new_796382978dfd4fb0 = function(arg0, arg1) {
602
+ module.exports.__wbg_new_70a2f23d1565c04c = function(arg0, arg1) {
696
603
  const ret = new Error(getStringFromWasm0(arg0, arg1));
697
- return addHeapObject(ret);
604
+ return ret;
698
605
  };
699
606
 
700
- module.exports.__wbg_instanceof_Map_763ce0e95960d55e = function(arg0) {
607
+ module.exports.__wbg_instanceof_Map_f96986929e7e89ed = function(arg0) {
701
608
  let result;
702
609
  try {
703
- result = getObject(arg0) instanceof Map;
610
+ result = arg0 instanceof Map;
704
611
  } catch (_) {
705
612
  result = false;
706
613
  }
@@ -708,49 +615,49 @@ module.exports.__wbg_instanceof_Map_763ce0e95960d55e = function(arg0) {
708
615
  return ret;
709
616
  };
710
617
 
711
- module.exports.__wbg_set_49185437f0ab06f8 = function(arg0, arg1, arg2) {
712
- const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
713
- return addHeapObject(ret);
618
+ module.exports.__wbg_set_277a63e77c89279f = function(arg0, arg1, arg2) {
619
+ const ret = arg0.set(arg1, arg2);
620
+ return ret;
714
621
  };
715
622
 
716
- module.exports.__wbg_isSafeInteger_7f1ed56200d90674 = function(arg0) {
717
- const ret = Number.isSafeInteger(getObject(arg0));
623
+ module.exports.__wbg_isSafeInteger_b9dff570f01a9100 = function(arg0) {
624
+ const ret = Number.isSafeInteger(arg0);
718
625
  return ret;
719
626
  };
720
627
 
721
- module.exports.__wbg_entries_7a0e06255456ebcd = function(arg0) {
722
- const ret = Object.entries(getObject(arg0));
723
- return addHeapObject(ret);
628
+ module.exports.__wbg_entries_c02034de337d3ee2 = function(arg0) {
629
+ const ret = Object.entries(arg0);
630
+ return ret;
724
631
  };
725
632
 
726
- module.exports.__wbg_fromCodePoint_ae875c4ff5f6a86b = function() { return handleError(function (arg0) {
633
+ module.exports.__wbg_fromCodePoint_a9176a674cd93db9 = function() { return handleError(function (arg0) {
727
634
  const ret = String.fromCodePoint(arg0 >>> 0);
728
- return addHeapObject(ret);
635
+ return ret;
729
636
  }, arguments) };
730
637
 
731
- module.exports.__wbg_buffer_b7b08af79b0b0974 = function(arg0) {
732
- const ret = getObject(arg0).buffer;
733
- return addHeapObject(ret);
638
+ module.exports.__wbg_buffer_ccaed51a635d8a2d = function(arg0) {
639
+ const ret = arg0.buffer;
640
+ return ret;
734
641
  };
735
642
 
736
- module.exports.__wbg_new_ea1883e1e5e86686 = function(arg0) {
737
- const ret = new Uint8Array(getObject(arg0));
738
- return addHeapObject(ret);
643
+ module.exports.__wbg_new_fec2611eb9180f95 = function(arg0) {
644
+ const ret = new Uint8Array(arg0);
645
+ return ret;
739
646
  };
740
647
 
741
- module.exports.__wbg_set_d1e79e2388520f18 = function(arg0, arg1, arg2) {
742
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
648
+ module.exports.__wbg_set_ec2fcf81bc573fd9 = function(arg0, arg1, arg2) {
649
+ arg0.set(arg1, arg2 >>> 0);
743
650
  };
744
651
 
745
- module.exports.__wbg_length_8339fcf5d8ecd12e = function(arg0) {
746
- const ret = getObject(arg0).length;
652
+ module.exports.__wbg_length_9254c4bd3b9f23c4 = function(arg0) {
653
+ const ret = arg0.length;
747
654
  return ret;
748
655
  };
749
656
 
750
- module.exports.__wbg_instanceof_Uint8Array_247a91427532499e = function(arg0) {
657
+ module.exports.__wbg_instanceof_Uint8Array_df0761410414ef36 = function(arg0) {
751
658
  let result;
752
659
  try {
753
- result = getObject(arg0) instanceof Uint8Array;
660
+ result = arg0 instanceof Uint8Array;
754
661
  } catch (_) {
755
662
  result = false;
756
663
  }
@@ -759,14 +666,14 @@ module.exports.__wbg_instanceof_Uint8Array_247a91427532499e = function(arg0) {
759
666
  };
760
667
 
761
668
  module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
762
- const v = getObject(arg1);
669
+ const v = arg1;
763
670
  const ret = typeof(v) === 'bigint' ? v : undefined;
764
671
  getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
765
672
  getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
766
673
  };
767
674
 
768
675
  module.exports.__wbindgen_debug_string = function(arg0, arg1) {
769
- const ret = debugString(getObject(arg1));
676
+ const ret = debugString(arg1);
770
677
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
771
678
  const len1 = WASM_VECTOR_LEN;
772
679
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
@@ -779,7 +686,18 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
779
686
 
780
687
  module.exports.__wbindgen_memory = function() {
781
688
  const ret = wasm.memory;
782
- return addHeapObject(ret);
689
+ return ret;
690
+ };
691
+
692
+ module.exports.__wbindgen_init_externref_table = function() {
693
+ const table = wasm.__wbindgen_export_2;
694
+ const offset = table.grow(4);
695
+ table.set(0, undefined);
696
+ table.set(offset + 0, undefined);
697
+ table.set(offset + 1, null);
698
+ table.set(offset + 2, true);
699
+ table.set(offset + 3, false);
700
+ ;
783
701
  };
784
702
 
785
703
  const path = require('path').join(__dirname, 'ruff_wasm_bg.wasm');
package/ruff_wasm_bg.wasm CHANGED
Binary file