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