csskit 0.0.37-canary.edf34f2724 → 0.0.37

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.
@@ -20,14 +20,14 @@ export class SerializableParserResult {
20
20
  */
21
21
  get ast() {
22
22
  const ret = wasm.serializableparserresult_ast(this.__wbg_ptr);
23
- return takeObject(ret);
23
+ return ret;
24
24
  }
25
25
  /**
26
26
  * @returns {any[]}
27
27
  */
28
28
  get diagnostics() {
29
29
  try {
30
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
30
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
31
31
  wasm.serializableparserresult_diagnostics(retptr, this.__wbg_ptr);
32
32
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
33
33
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
@@ -50,10 +50,10 @@ export function format(source_text, options) {
50
50
  let deferred3_0;
51
51
  let deferred3_1;
52
52
  try {
53
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
53
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
54
54
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
55
55
  const len0 = WASM_VECTOR_LEN;
56
- wasm.format(retptr, ptr0, len0, addHeapObject(options));
56
+ wasm.format(retptr, ptr0, len0, options);
57
57
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
58
58
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
59
59
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -62,7 +62,7 @@ export function format(source_text, options) {
62
62
  var len2 = r1;
63
63
  if (r3) {
64
64
  ptr2 = 0; len2 = 0;
65
- throw takeObject(r2);
65
+ throw takeFromExternrefTable0(r2);
66
66
  }
67
67
  deferred3_0 = ptr2;
68
68
  deferred3_1 = len2;
@@ -79,7 +79,7 @@ export function format(source_text, options) {
79
79
  */
80
80
  export function lex(source_text) {
81
81
  try {
82
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
82
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
83
83
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
84
84
  const len0 = WASM_VECTOR_LEN;
85
85
  wasm.lex(retptr, ptr0, len0);
@@ -87,9 +87,9 @@ export function lex(source_text) {
87
87
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
88
88
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
89
89
  if (r2) {
90
- throw takeObject(r1);
90
+ throw takeFromExternrefTable0(r1);
91
91
  }
92
- return takeObject(r0);
92
+ return takeFromExternrefTable0(r0);
93
93
  } finally {
94
94
  wasm.__wbindgen_add_to_stack_pointer(16);
95
95
  }
@@ -107,7 +107,7 @@ export function minify(source_text) {
107
107
  let deferred3_0;
108
108
  let deferred3_1;
109
109
  try {
110
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
110
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
111
111
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
112
112
  const len0 = WASM_VECTOR_LEN;
113
113
  wasm.minify(retptr, ptr0, len0);
@@ -119,7 +119,7 @@ export function minify(source_text) {
119
119
  var len2 = r1;
120
120
  if (r3) {
121
121
  ptr2 = 0; len2 = 0;
122
- throw takeObject(r2);
122
+ throw takeFromExternrefTable0(r2);
123
123
  }
124
124
  deferred3_0 = ptr2;
125
125
  deferred3_1 = len2;
@@ -136,7 +136,7 @@ export function minify(source_text) {
136
136
  */
137
137
  export function parse(source_text) {
138
138
  try {
139
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
139
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
140
140
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
141
141
  const len0 = WASM_VECTOR_LEN;
142
142
  wasm.parse(retptr, ptr0, len0);
@@ -144,7 +144,7 @@ export function parse(source_text) {
144
144
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
145
145
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
146
146
  if (r2) {
147
- throw takeObject(r1);
147
+ throw takeFromExternrefTable0(r1);
148
148
  }
149
149
  return SerializableParserResult.__wrap(r0);
150
150
  } finally {
@@ -160,7 +160,7 @@ export function parse_error_report(source_text) {
160
160
  let deferred2_0;
161
161
  let deferred2_1;
162
162
  try {
163
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
163
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
164
164
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
165
165
  const len0 = WASM_VECTOR_LEN;
166
166
  wasm.parse_error_report(retptr, ptr0, len0);
@@ -174,233 +174,212 @@ export function parse_error_report(source_text) {
174
174
  wasm.__wbindgen_export3(deferred2_0, deferred2_1, 1);
175
175
  }
176
176
  }
177
- export function __wbg_Error_30c8987f7c2ed4e2(arg0, arg1) {
177
+ export function __wbg_Error_208446807d0d1e30(arg0, arg1) {
178
178
  const ret = Error(getStringFromWasm0(arg0, arg1));
179
- return addHeapObject(ret);
179
+ return ret;
180
180
  }
181
- export function __wbg_Number_14af1003b8dd5ead(arg0) {
182
- const ret = Number(getObject(arg0));
181
+ export function __wbg_Number_ff192a72a0dcdf6d(arg0) {
182
+ const ret = Number(arg0);
183
183
  return ret;
184
184
  }
185
- export function __wbg___wbindgen_boolean_get_5b446f51afd21013(arg0) {
186
- const v = getObject(arg0);
185
+ export function __wbg___wbindgen_boolean_get_4f1baf9a00be3c74(arg0) {
186
+ const v = arg0;
187
187
  const ret = typeof(v) === 'boolean' ? v : undefined;
188
188
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
189
189
  }
190
- export function __wbg___wbindgen_debug_string_4687d8d8c2017d52(arg0, arg1) {
191
- const ret = debugString(getObject(arg1));
190
+ export function __wbg___wbindgen_debug_string_f249a2a76caa9a55(arg0, arg1) {
191
+ const ret = debugString(arg1);
192
192
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
193
193
  const len1 = WASM_VECTOR_LEN;
194
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
195
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
194
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
195
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
196
196
  }
197
- export function __wbg___wbindgen_in_92f62ee1427d9e49(arg0, arg1) {
198
- const ret = getObject(arg0) in getObject(arg1);
197
+ export function __wbg___wbindgen_in_3f58a9d3b3a7eed2(arg0, arg1) {
198
+ const ret = arg0 in arg1;
199
199
  return ret;
200
200
  }
201
- export function __wbg___wbindgen_is_object_3c45d4f2dde4e749(arg0) {
202
- const val = getObject(arg0);
201
+ export function __wbg___wbindgen_is_object_8b968c3ab8e96595(arg0) {
202
+ const val = arg0;
203
203
  const ret = typeof(val) === 'object' && val !== null;
204
204
  return ret;
205
205
  }
206
- export function __wbg___wbindgen_is_string_90b56bc79aad6f6c(arg0) {
207
- const ret = typeof(getObject(arg0)) === 'string';
206
+ export function __wbg___wbindgen_is_string_fc456fee5d3317de(arg0) {
207
+ const ret = typeof(arg0) === 'string';
208
208
  return ret;
209
209
  }
210
- export function __wbg___wbindgen_is_undefined_8865fb403f8fe9d8(arg0) {
211
- const ret = getObject(arg0) === undefined;
210
+ export function __wbg___wbindgen_is_undefined_be5b34249ff1fc15(arg0) {
211
+ const ret = arg0 === undefined;
212
212
  return ret;
213
213
  }
214
- export function __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461(arg0, arg1) {
215
- const ret = getObject(arg0) == getObject(arg1);
214
+ export function __wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36(arg0, arg1) {
215
+ const ret = arg0 == arg1;
216
216
  return ret;
217
217
  }
218
- export function __wbg___wbindgen_number_get_2e0e7dee9f701a71(arg0, arg1) {
219
- const obj = getObject(arg1);
218
+ export function __wbg___wbindgen_number_get_934b640d0889af78(arg0, arg1) {
219
+ const obj = arg1;
220
220
  const ret = typeof(obj) === 'number' ? obj : undefined;
221
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
222
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
221
+ getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
222
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
223
223
  }
224
- export function __wbg___wbindgen_string_get_0380ccaa2f57f0d9(arg0, arg1) {
225
- const obj = getObject(arg1);
224
+ export function __wbg___wbindgen_string_get_7ce8eee7fd327545(arg0, arg1) {
225
+ const obj = arg1;
226
226
  const ret = typeof(obj) === 'string' ? obj : undefined;
227
227
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
228
228
  var len1 = WASM_VECTOR_LEN;
229
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
230
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
229
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
230
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
231
231
  }
232
- export function __wbg___wbindgen_throw_41e9ee4f547fc59a(arg0, arg1) {
232
+ export function __wbg___wbindgen_throw_4c88d8bf264fd984(arg0, arg1) {
233
233
  throw new Error(getStringFromWasm0(arg0, arg1));
234
234
  }
235
- export function __wbg_entries_fb6397112b1de25f(arg0) {
236
- const ret = Object.entries(getObject(arg0));
237
- return addHeapObject(ret);
235
+ export function __wbg_entries_7bb1459bd9b5c2b9(arg0) {
236
+ const ret = Object.entries(arg0);
237
+ return ret;
238
238
  }
239
- export function __wbg_get_6c896e0571ddae51(arg0, arg1) {
240
- const ret = getObject(arg0)[arg1 >>> 0];
241
- return addHeapObject(ret);
239
+ export function __wbg_get_d7176cfb76d71114(arg0, arg1) {
240
+ const ret = arg0[arg1 >>> 0];
241
+ return ret;
242
242
  }
243
- export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
244
- const ret = getObject(arg0)[getObject(arg1)];
245
- return addHeapObject(ret);
243
+ export function __wbg_get_with_ref_key_fc601247060b7204(arg0, arg1) {
244
+ const ret = arg0[arg1];
245
+ return ret;
246
246
  }
247
- export function __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8(arg0) {
247
+ export function __wbg_instanceof_ArrayBuffer_12cdaa4161423e6b(arg0) {
248
248
  let result;
249
249
  try {
250
- result = getObject(arg0) instanceof ArrayBuffer;
250
+ result = arg0 instanceof ArrayBuffer;
251
251
  } catch (_) {
252
252
  result = false;
253
253
  }
254
254
  const ret = result;
255
255
  return ret;
256
256
  }
257
- export function __wbg_instanceof_Uint8Array_828cef2aaacafc31(arg0) {
257
+ export function __wbg_instanceof_Uint8Array_d7aeb0dcb3108fea(arg0) {
258
258
  let result;
259
259
  try {
260
- result = getObject(arg0) instanceof Uint8Array;
260
+ result = arg0 instanceof Uint8Array;
261
261
  } catch (_) {
262
262
  result = false;
263
263
  }
264
264
  const ret = result;
265
265
  return ret;
266
266
  }
267
- export function __wbg_isSafeInteger_717808ad6a54bd9e(arg0) {
268
- const ret = Number.isSafeInteger(getObject(arg0));
267
+ export function __wbg_isSafeInteger_1a35ba4d31e71d38(arg0) {
268
+ const ret = Number.isSafeInteger(arg0);
269
269
  return ret;
270
270
  }
271
- export function __wbg_length_7f3c00c40364105e(arg0) {
272
- const ret = getObject(arg0).length;
271
+ export function __wbg_length_186163212ffe79c3(arg0) {
272
+ const ret = arg0.length;
273
273
  return ret;
274
274
  }
275
- export function __wbg_length_d4bdea10311bd9cf(arg0) {
276
- const ret = getObject(arg0).length;
275
+ export function __wbg_length_b03a0fabb109b1e9(arg0) {
276
+ const ret = arg0.length;
277
277
  return ret;
278
278
  }
279
- export function __wbg_new_1dbf7428bba60a42(arg0) {
280
- const ret = new Uint8Array(getObject(arg0));
281
- return addHeapObject(ret);
282
- }
283
- export function __wbg_new_617a8cdb8bb1130e() {
284
- const ret = new Object();
285
- return addHeapObject(ret);
279
+ export function __wbg_new_13de428334042d26(arg0) {
280
+ const ret = new Uint8Array(arg0);
281
+ return ret;
286
282
  }
287
- export function __wbg_new_ee2291f50781bf1d() {
283
+ export function __wbg_new_37eb45aaf5eeb820() {
288
284
  const ret = new Array();
289
- return addHeapObject(ret);
285
+ return ret;
290
286
  }
291
- export function __wbg_prototypesetcall_bc27214492979395(arg0, arg1, arg2) {
292
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
287
+ export function __wbg_new_cd4348290afae586() {
288
+ const ret = new Object();
289
+ return ret;
293
290
  }
294
- export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
295
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
291
+ export function __wbg_prototypesetcall_13162965d1fe7aa3(arg0, arg1, arg2) {
292
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
296
293
  }
297
- export function __wbg_set_bea140a88be9b277(arg0, arg1, arg2) {
298
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
294
+ export function __wbg_set_d2d33b52458e984a(arg0, arg1, arg2) {
295
+ arg0[arg1 >>> 0] = arg2;
296
+ }
297
+ export function __wbg_set_e4b9a833d288759a(arg0, arg1, arg2) {
298
+ arg0[arg1] = arg2;
299
299
  }
300
300
  export function __wbindgen_generic_0000000000000001(arg0) {
301
301
  // Cast intrinsic for `F64 -> Externref`.
302
302
  const ret = arg0;
303
- return addHeapObject(ret);
303
+ return ret;
304
304
  }
305
305
  export function __wbindgen_generic_0000000000000002(arg0, arg1) {
306
306
  // Cast intrinsic for `Ref(String) -> Externref`.
307
307
  const ret = getStringFromWasm0(arg0, arg1);
308
- return addHeapObject(ret);
308
+ return ret;
309
309
  }
310
310
  export function __wbindgen_generic_0000000000000003(arg0) {
311
311
  // Cast intrinsic for `U64 -> Externref`.
312
312
  const ret = BigInt.asUintN(64, arg0);
313
- return addHeapObject(ret);
314
- }
315
- export function __wbindgen_object_clone_ref(arg0) {
316
- const ret = getObject(arg0);
317
- return addHeapObject(ret);
313
+ return ret;
318
314
  }
319
- export function __wbindgen_object_drop_ref(arg0) {
320
- takeObject(arg0);
315
+ export function __wbindgen_init_externref_table() {
316
+ const table = wasm.__wbindgen_externrefs;
317
+ table.set(0, undefined);
318
+ table.set(1024, undefined);
319
+ table.set(1025, null);
320
+ table.set(1026, true);
321
+ table.set(1027, false);
321
322
  }
322
323
  const SerializableParserResultFinalization = (typeof FinalizationRegistry === 'undefined')
323
324
  ? { register: () => {}, unregister: () => {} }
324
325
  : new FinalizationRegistry(ptr => wasm.__wbg_serializableparserresult_free(ptr, 1));
325
326
 
326
- function addHeapObject(obj) {
327
- if (heap_next === heap.length) heap.push(heap.length + 1);
328
- const idx = heap_next;
329
- heap_next = heap[idx];
330
-
331
- heap[idx] = obj;
332
- return idx;
333
- }
334
-
335
327
  function debugString(val) {
336
- // primitive types
337
- const type = typeof val;
338
- if (type == 'number' || type == 'boolean' || val == null) {
339
- return `${val}`;
340
- }
341
- if (type == 'string') {
342
- return `"${val}"`;
343
- }
344
- if (type == 'symbol') {
345
- const description = val.description;
346
- if (description == null) {
347
- return 'Symbol';
348
- } else {
349
- return `Symbol(${description})`;
350
- }
351
- }
352
- if (type == 'function') {
353
- const name = val.name;
354
- if (typeof name == 'string' && name.length > 0) {
355
- return `Function(${name})`;
356
- } else {
357
- return 'Function';
358
- }
359
- }
360
- // objects
361
- if (Array.isArray(val)) {
362
- const length = val.length;
363
- let debug = '[';
364
- if (length > 0) {
365
- debug += debugString(val[0]);
366
- }
367
- for(let i = 1; i < length; i++) {
368
- debug += ', ' + debugString(val[i]);
369
- }
370
- debug += ']';
371
- return debug;
372
- }
373
- // Test for built-in
374
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
375
- let className;
376
- if (builtInMatches && builtInMatches.length > 1) {
377
- className = builtInMatches[1];
378
- } else {
379
- // Failed to match the standard '[object ClassName]'
380
- return toString.call(val);
381
- }
382
- if (className == 'Object') {
383
- // we're a user defined class or Object
384
- // JSON.stringify avoids problems with cycles, and is generally much
385
- // easier than looping through ownProperties of `val`.
386
- try {
387
- return 'Object(' + JSON.stringify(val) + ')';
388
- } catch (_) {
389
- return 'Object';
328
+ switch (typeof val) {
329
+ // primitive types
330
+ case 'number':
331
+ case 'boolean':
332
+ case 'undefined':
333
+ return `${val}`;
334
+ case 'string':
335
+ return JSON.stringify(val);
336
+ case 'bigint':
337
+ return `${val}n`;
338
+ case 'symbol':
339
+ return val.description !== undefined
340
+ ? `Symbol(${val.description})`
341
+ : 'Symbol';
342
+ case 'function':
343
+ return typeof val.name === 'string' && val.name !== ''
344
+ ? `Function(${val.name})`
345
+ : 'Function';
346
+ case 'object': {
347
+ if (val === null) {
348
+ return 'null';
349
+ }
350
+ // objects
351
+ if (Array.isArray(val)) {
352
+ return '[' + Array.from(val, debugString).join(', ') + ']';
353
+ }
354
+ // errors
355
+ if (val instanceof Error) {
356
+ return `${val.name}: ${val.message}\n${val.stack}`;
357
+ }
358
+
359
+ const toStringOutput = toString.call(val);
360
+ // Test for built-in
361
+ const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
362
+
363
+ // Failed to match the standard '[object ClassName]'
364
+ if (className === undefined) {
365
+ return toStringOutput;
366
+ }
367
+ if (className === 'Object') {
368
+ // we're a user defined class or Object
369
+ // JSON.stringify avoids problems with cycles, and is generally much
370
+ // easier than looping through ownProperties of `val`.
371
+ try {
372
+ return 'Object(' + JSON.stringify(val) + ')';
373
+ } catch (_) {
374
+ return 'Object';
375
+ }
376
+ }
377
+ // TODO we could test for more things here, like `Set`s and `Map`s.
378
+ return className;
390
379
  }
380
+ // Per MDN: 'This list of values is exhaustive.'
381
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
391
382
  }
392
- // errors
393
- if (val instanceof Error) {
394
- return `${val.name}: ${val.message}\n${val.stack}`;
395
- }
396
- // TODO we could test for more things here, like `Set`s and `Map`s.
397
- return className;
398
- }
399
-
400
- function dropObject(idx) {
401
- if (idx < 1028) return;
402
- heap[idx] = heap_next;
403
- heap_next = idx;
404
383
  }
405
384
 
406
385
  function getArrayJsValueFromWasm0(ptr, len) {
@@ -408,8 +387,9 @@ function getArrayJsValueFromWasm0(ptr, len) {
408
387
  const mem = getDataViewMemory0();
409
388
  const result = [];
410
389
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
411
- result.push(takeObject(mem.getUint32(i, true)));
390
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
412
391
  }
392
+ wasm.__wbindgen_export5(ptr, len);
413
393
  return result;
414
394
  }
415
395
 
@@ -427,7 +407,8 @@ function getDataViewMemory0() {
427
407
  }
428
408
 
429
409
  function getStringFromWasm0(ptr, len) {
430
- return decodeText(ptr >>> 0, len);
410
+ ptr = ptr >>> 0;
411
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
431
412
  }
432
413
 
433
414
  let cachedUint8ArrayMemory0 = null;
@@ -438,13 +419,6 @@ function getUint8ArrayMemory0() {
438
419
  return cachedUint8ArrayMemory0;
439
420
  }
440
421
 
441
- function getObject(idx) { return heap[idx]; }
442
-
443
- let heap = new Array(1024).fill(undefined);
444
- heap.push(undefined, null, true, false);
445
-
446
- let heap_next = heap.length;
447
-
448
422
  function isLikeNone(x) {
449
423
  return x === undefined || x === null;
450
424
  }
@@ -486,24 +460,24 @@ function passStringToWasm0(arg, malloc, realloc) {
486
460
  return ptr;
487
461
  }
488
462
 
489
- function takeObject(idx) {
490
- const ret = getObject(idx);
491
- dropObject(idx);
492
- return ret;
463
+ function takeFromExternrefTable0(idx) {
464
+ const value = wasm.__wbindgen_externrefs.get(idx);
465
+ wasm.__wbindgen_export4(idx);
466
+ return value;
493
467
  }
494
468
 
495
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
469
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
496
470
  cachedTextDecoder.decode();
497
471
  const MAX_SAFARI_DECODE_BYTES = 2146435072;
498
472
  let numBytesDecoded = 0;
499
- function decodeText(ptr, len) {
500
- numBytesDecoded += len;
473
+ function decodeText(bytes) {
474
+ numBytesDecoded += bytes.length;
501
475
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
502
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
476
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
503
477
  cachedTextDecoder.decode();
504
- numBytesDecoded = len;
478
+ numBytesDecoded = bytes.length;
505
479
  }
506
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
480
+ return cachedTextDecoder.decode(bytes);
507
481
  }
508
482
 
509
483
  const cachedTextEncoder = new TextEncoder();
Binary file
@@ -2,16 +2,19 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const __wbg_serializableparserresult_free: (a: number, b: number) => void;
5
- export const format: (a: number, b: number, c: number, d: number) => void;
5
+ export const format: (a: number, b: number, c: number, d: any) => void;
6
6
  export const lex: (a: number, b: number, c: number) => void;
7
7
  export const main: () => void;
8
8
  export const minify: (a: number, b: number, c: number) => void;
9
9
  export const parse: (a: number, b: number, c: number) => void;
10
10
  export const parse_error_report: (a: number, b: number, c: number) => void;
11
- export const serializableparserresult_ast: (a: number) => number;
11
+ export const serializableparserresult_ast: (a: number) => any;
12
12
  export const serializableparserresult_diagnostics: (a: number, b: number) => void;
13
13
  export const __wbindgen_export: (a: number, b: number) => number;
14
14
  export const __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
15
- export const __wbindgen_add_to_stack_pointer: (a: number) => number;
16
15
  export const __wbindgen_export3: (a: number, b: number, c: number) => void;
16
+ export const __wbindgen_externrefs: WebAssembly.Table;
17
+ export const __wbindgen_add_to_stack_pointer: (a: number) => number;
18
+ export const __wbindgen_export4: (a: number) => void;
19
+ export const __wbindgen_export5: (a: number, b: number) => void;
17
20
  export const __wbindgen_start: () => void;
@@ -24,14 +24,14 @@ export class SerializableParserResult {
24
24
  */
25
25
  get ast() {
26
26
  const ret = wasm.serializableparserresult_ast(this.__wbg_ptr);
27
- return takeObject(ret);
27
+ return ret;
28
28
  }
29
29
  /**
30
30
  * @returns {any[]}
31
31
  */
32
32
  get diagnostics() {
33
33
  try {
34
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
34
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
35
35
  wasm.serializableparserresult_diagnostics(retptr, this.__wbg_ptr);
36
36
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
37
37
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
@@ -54,10 +54,10 @@ export function format(source_text, options) {
54
54
  let deferred3_0;
55
55
  let deferred3_1;
56
56
  try {
57
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
57
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
58
58
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
59
59
  const len0 = WASM_VECTOR_LEN;
60
- wasm.format(retptr, ptr0, len0, addHeapObject(options));
60
+ wasm.format(retptr, ptr0, len0, options);
61
61
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
62
62
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
63
63
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -66,7 +66,7 @@ export function format(source_text, options) {
66
66
  var len2 = r1;
67
67
  if (r3) {
68
68
  ptr2 = 0; len2 = 0;
69
- throw takeObject(r2);
69
+ throw takeFromExternrefTable0(r2);
70
70
  }
71
71
  deferred3_0 = ptr2;
72
72
  deferred3_1 = len2;
@@ -83,7 +83,7 @@ export function format(source_text, options) {
83
83
  */
84
84
  export function lex(source_text) {
85
85
  try {
86
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
86
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
87
87
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
88
88
  const len0 = WASM_VECTOR_LEN;
89
89
  wasm.lex(retptr, ptr0, len0);
@@ -91,9 +91,9 @@ export function lex(source_text) {
91
91
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
92
92
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
93
93
  if (r2) {
94
- throw takeObject(r1);
94
+ throw takeFromExternrefTable0(r1);
95
95
  }
96
- return takeObject(r0);
96
+ return takeFromExternrefTable0(r0);
97
97
  } finally {
98
98
  wasm.__wbindgen_add_to_stack_pointer(16);
99
99
  }
@@ -111,7 +111,7 @@ export function minify(source_text) {
111
111
  let deferred3_0;
112
112
  let deferred3_1;
113
113
  try {
114
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
114
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
115
115
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
116
116
  const len0 = WASM_VECTOR_LEN;
117
117
  wasm.minify(retptr, ptr0, len0);
@@ -123,7 +123,7 @@ export function minify(source_text) {
123
123
  var len2 = r1;
124
124
  if (r3) {
125
125
  ptr2 = 0; len2 = 0;
126
- throw takeObject(r2);
126
+ throw takeFromExternrefTable0(r2);
127
127
  }
128
128
  deferred3_0 = ptr2;
129
129
  deferred3_1 = len2;
@@ -140,7 +140,7 @@ export function minify(source_text) {
140
140
  */
141
141
  export function parse(source_text) {
142
142
  try {
143
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
143
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
144
144
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
145
145
  const len0 = WASM_VECTOR_LEN;
146
146
  wasm.parse(retptr, ptr0, len0);
@@ -148,7 +148,7 @@ export function parse(source_text) {
148
148
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
149
149
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
150
150
  if (r2) {
151
- throw takeObject(r1);
151
+ throw takeFromExternrefTable0(r1);
152
152
  }
153
153
  return SerializableParserResult.__wrap(r0);
154
154
  } finally {
@@ -164,7 +164,7 @@ export function parse_error_report(source_text) {
164
164
  let deferred2_0;
165
165
  let deferred2_1;
166
166
  try {
167
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
167
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16) >>> 0;
168
168
  const ptr0 = passStringToWasm0(source_text, wasm.__wbindgen_export, wasm.__wbindgen_export2);
169
169
  const len0 = WASM_VECTOR_LEN;
170
170
  wasm.parse_error_report(retptr, ptr0, len0);
@@ -181,150 +181,151 @@ export function parse_error_report(source_text) {
181
181
  function __wbg_get_imports() {
182
182
  const import0 = {
183
183
  __proto__: null,
184
- __wbg_Error_30c8987f7c2ed4e2: function(arg0, arg1) {
184
+ __wbg_Error_208446807d0d1e30: function(arg0, arg1) {
185
185
  const ret = Error(getStringFromWasm0(arg0, arg1));
186
- return addHeapObject(ret);
186
+ return ret;
187
187
  },
188
- __wbg_Number_14af1003b8dd5ead: function(arg0) {
189
- const ret = Number(getObject(arg0));
188
+ __wbg_Number_ff192a72a0dcdf6d: function(arg0) {
189
+ const ret = Number(arg0);
190
190
  return ret;
191
191
  },
192
- __wbg___wbindgen_boolean_get_5b446f51afd21013: function(arg0) {
193
- const v = getObject(arg0);
192
+ __wbg___wbindgen_boolean_get_4f1baf9a00be3c74: function(arg0) {
193
+ const v = arg0;
194
194
  const ret = typeof(v) === 'boolean' ? v : undefined;
195
195
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
196
196
  },
197
- __wbg___wbindgen_debug_string_4687d8d8c2017d52: function(arg0, arg1) {
198
- const ret = debugString(getObject(arg1));
197
+ __wbg___wbindgen_debug_string_f249a2a76caa9a55: function(arg0, arg1) {
198
+ const ret = debugString(arg1);
199
199
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
200
200
  const len1 = WASM_VECTOR_LEN;
201
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
202
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
201
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
202
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
203
203
  },
204
- __wbg___wbindgen_in_92f62ee1427d9e49: function(arg0, arg1) {
205
- const ret = getObject(arg0) in getObject(arg1);
204
+ __wbg___wbindgen_in_3f58a9d3b3a7eed2: function(arg0, arg1) {
205
+ const ret = arg0 in arg1;
206
206
  return ret;
207
207
  },
208
- __wbg___wbindgen_is_object_3c45d4f2dde4e749: function(arg0) {
209
- const val = getObject(arg0);
208
+ __wbg___wbindgen_is_object_8b968c3ab8e96595: function(arg0) {
209
+ const val = arg0;
210
210
  const ret = typeof(val) === 'object' && val !== null;
211
211
  return ret;
212
212
  },
213
- __wbg___wbindgen_is_string_90b56bc79aad6f6c: function(arg0) {
214
- const ret = typeof(getObject(arg0)) === 'string';
213
+ __wbg___wbindgen_is_string_fc456fee5d3317de: function(arg0) {
214
+ const ret = typeof(arg0) === 'string';
215
215
  return ret;
216
216
  },
217
- __wbg___wbindgen_is_undefined_8865fb403f8fe9d8: function(arg0) {
218
- const ret = getObject(arg0) === undefined;
217
+ __wbg___wbindgen_is_undefined_be5b34249ff1fc15: function(arg0) {
218
+ const ret = arg0 === undefined;
219
219
  return ret;
220
220
  },
221
- __wbg___wbindgen_jsval_loose_eq_677f21e468d6b461: function(arg0, arg1) {
222
- const ret = getObject(arg0) == getObject(arg1);
221
+ __wbg___wbindgen_jsval_loose_eq_b2f214e2e4b30e36: function(arg0, arg1) {
222
+ const ret = arg0 == arg1;
223
223
  return ret;
224
224
  },
225
- __wbg___wbindgen_number_get_2e0e7dee9f701a71: function(arg0, arg1) {
226
- const obj = getObject(arg1);
225
+ __wbg___wbindgen_number_get_934b640d0889af78: function(arg0, arg1) {
226
+ const obj = arg1;
227
227
  const ret = typeof(obj) === 'number' ? obj : undefined;
228
- getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
229
- getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
228
+ getDataViewMemory0().setFloat64((arg0 >>> 0) + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
229
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, !isLikeNone(ret), true);
230
230
  },
231
- __wbg___wbindgen_string_get_0380ccaa2f57f0d9: function(arg0, arg1) {
232
- const obj = getObject(arg1);
231
+ __wbg___wbindgen_string_get_7ce8eee7fd327545: function(arg0, arg1) {
232
+ const obj = arg1;
233
233
  const ret = typeof(obj) === 'string' ? obj : undefined;
234
234
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
235
235
  var len1 = WASM_VECTOR_LEN;
236
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
237
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
236
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 1, len1, true);
237
+ getDataViewMemory0().setInt32((arg0 >>> 0) + 4 * 0, ptr1, true);
238
238
  },
239
- __wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
239
+ __wbg___wbindgen_throw_4c88d8bf264fd984: function(arg0, arg1) {
240
240
  throw new Error(getStringFromWasm0(arg0, arg1));
241
241
  },
242
- __wbg_entries_fb6397112b1de25f: function(arg0) {
243
- const ret = Object.entries(getObject(arg0));
244
- return addHeapObject(ret);
242
+ __wbg_entries_7bb1459bd9b5c2b9: function(arg0) {
243
+ const ret = Object.entries(arg0);
244
+ return ret;
245
245
  },
246
- __wbg_get_6c896e0571ddae51: function(arg0, arg1) {
247
- const ret = getObject(arg0)[arg1 >>> 0];
248
- return addHeapObject(ret);
246
+ __wbg_get_d7176cfb76d71114: function(arg0, arg1) {
247
+ const ret = arg0[arg1 >>> 0];
248
+ return ret;
249
249
  },
250
- __wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
251
- const ret = getObject(arg0)[getObject(arg1)];
252
- return addHeapObject(ret);
250
+ __wbg_get_with_ref_key_fc601247060b7204: function(arg0, arg1) {
251
+ const ret = arg0[arg1];
252
+ return ret;
253
253
  },
254
- __wbg_instanceof_ArrayBuffer_a99f175873e5d9b8: function(arg0) {
254
+ __wbg_instanceof_ArrayBuffer_12cdaa4161423e6b: function(arg0) {
255
255
  let result;
256
256
  try {
257
- result = getObject(arg0) instanceof ArrayBuffer;
257
+ result = arg0 instanceof ArrayBuffer;
258
258
  } catch (_) {
259
259
  result = false;
260
260
  }
261
261
  const ret = result;
262
262
  return ret;
263
263
  },
264
- __wbg_instanceof_Uint8Array_828cef2aaacafc31: function(arg0) {
264
+ __wbg_instanceof_Uint8Array_d7aeb0dcb3108fea: function(arg0) {
265
265
  let result;
266
266
  try {
267
- result = getObject(arg0) instanceof Uint8Array;
267
+ result = arg0 instanceof Uint8Array;
268
268
  } catch (_) {
269
269
  result = false;
270
270
  }
271
271
  const ret = result;
272
272
  return ret;
273
273
  },
274
- __wbg_isSafeInteger_717808ad6a54bd9e: function(arg0) {
275
- const ret = Number.isSafeInteger(getObject(arg0));
274
+ __wbg_isSafeInteger_1a35ba4d31e71d38: function(arg0) {
275
+ const ret = Number.isSafeInteger(arg0);
276
276
  return ret;
277
277
  },
278
- __wbg_length_7f3c00c40364105e: function(arg0) {
279
- const ret = getObject(arg0).length;
278
+ __wbg_length_186163212ffe79c3: function(arg0) {
279
+ const ret = arg0.length;
280
280
  return ret;
281
281
  },
282
- __wbg_length_d4bdea10311bd9cf: function(arg0) {
283
- const ret = getObject(arg0).length;
282
+ __wbg_length_b03a0fabb109b1e9: function(arg0) {
283
+ const ret = arg0.length;
284
284
  return ret;
285
285
  },
286
- __wbg_new_1dbf7428bba60a42: function(arg0) {
287
- const ret = new Uint8Array(getObject(arg0));
288
- return addHeapObject(ret);
289
- },
290
- __wbg_new_617a8cdb8bb1130e: function() {
291
- const ret = new Object();
292
- return addHeapObject(ret);
286
+ __wbg_new_13de428334042d26: function(arg0) {
287
+ const ret = new Uint8Array(arg0);
288
+ return ret;
293
289
  },
294
- __wbg_new_ee2291f50781bf1d: function() {
290
+ __wbg_new_37eb45aaf5eeb820: function() {
295
291
  const ret = new Array();
296
- return addHeapObject(ret);
292
+ return ret;
293
+ },
294
+ __wbg_new_cd4348290afae586: function() {
295
+ const ret = new Object();
296
+ return ret;
297
297
  },
298
- __wbg_prototypesetcall_bc27214492979395: function(arg0, arg1, arg2) {
299
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
298
+ __wbg_prototypesetcall_13162965d1fe7aa3: function(arg0, arg1, arg2) {
299
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
300
300
  },
301
- __wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
302
- getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
301
+ __wbg_set_d2d33b52458e984a: function(arg0, arg1, arg2) {
302
+ arg0[arg1 >>> 0] = arg2;
303
303
  },
304
- __wbg_set_bea140a88be9b277: function(arg0, arg1, arg2) {
305
- getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
304
+ __wbg_set_e4b9a833d288759a: function(arg0, arg1, arg2) {
305
+ arg0[arg1] = arg2;
306
306
  },
307
307
  __wbindgen_generic_0000000000000001: function(arg0) {
308
308
  // Cast intrinsic for `F64 -> Externref`.
309
309
  const ret = arg0;
310
- return addHeapObject(ret);
310
+ return ret;
311
311
  },
312
312
  __wbindgen_generic_0000000000000002: function(arg0, arg1) {
313
313
  // Cast intrinsic for `Ref(String) -> Externref`.
314
314
  const ret = getStringFromWasm0(arg0, arg1);
315
- return addHeapObject(ret);
315
+ return ret;
316
316
  },
317
317
  __wbindgen_generic_0000000000000003: function(arg0) {
318
318
  // Cast intrinsic for `U64 -> Externref`.
319
319
  const ret = BigInt.asUintN(64, arg0);
320
- return addHeapObject(ret);
321
- },
322
- __wbindgen_object_clone_ref: function(arg0) {
323
- const ret = getObject(arg0);
324
- return addHeapObject(ret);
320
+ return ret;
325
321
  },
326
- __wbindgen_object_drop_ref: function(arg0) {
327
- takeObject(arg0);
322
+ __wbindgen_init_externref_table: function() {
323
+ const table = wasm.__wbindgen_externrefs;
324
+ table.set(0, undefined);
325
+ table.set(1024, undefined);
326
+ table.set(1025, null);
327
+ table.set(1026, true);
328
+ table.set(1027, false);
328
329
  },
329
330
  };
330
331
  return {
@@ -337,84 +338,62 @@ const SerializableParserResultFinalization = (typeof FinalizationRegistry === 'u
337
338
  ? { register: () => {}, unregister: () => {} }
338
339
  : new FinalizationRegistry(ptr => wasm.__wbg_serializableparserresult_free(ptr, 1));
339
340
 
340
- function addHeapObject(obj) {
341
- if (heap_next === heap.length) heap.push(heap.length + 1);
342
- const idx = heap_next;
343
- heap_next = heap[idx];
341
+ function debugString(val) {
342
+ switch (typeof val) {
343
+ // primitive types
344
+ case 'number':
345
+ case 'boolean':
346
+ case 'undefined':
347
+ return `${val}`;
348
+ case 'string':
349
+ return JSON.stringify(val);
350
+ case 'bigint':
351
+ return `${val}n`;
352
+ case 'symbol':
353
+ return val.description !== undefined
354
+ ? `Symbol(${val.description})`
355
+ : 'Symbol';
356
+ case 'function':
357
+ return typeof val.name === 'string' && val.name !== ''
358
+ ? `Function(${val.name})`
359
+ : 'Function';
360
+ case 'object': {
361
+ if (val === null) {
362
+ return 'null';
363
+ }
364
+ // objects
365
+ if (Array.isArray(val)) {
366
+ return '[' + Array.from(val, debugString).join(', ') + ']';
367
+ }
368
+ // errors
369
+ if (val instanceof Error) {
370
+ return `${val.name}: ${val.message}\n${val.stack}`;
371
+ }
344
372
 
345
- heap[idx] = obj;
346
- return idx;
347
- }
373
+ const toStringOutput = toString.call(val);
374
+ // Test for built-in
375
+ const className = /\[object ([^\]]+)\]/.exec(toStringOutput)?.[1];
348
376
 
349
- function debugString(val) {
350
- // primitive types
351
- const type = typeof val;
352
- if (type == 'number' || type == 'boolean' || val == null) {
353
- return `${val}`;
354
- }
355
- if (type == 'string') {
356
- return `"${val}"`;
357
- }
358
- if (type == 'symbol') {
359
- const description = val.description;
360
- if (description == null) {
361
- return 'Symbol';
362
- } else {
363
- return `Symbol(${description})`;
364
- }
365
- }
366
- if (type == 'function') {
367
- const name = val.name;
368
- if (typeof name == 'string' && name.length > 0) {
369
- return `Function(${name})`;
370
- } else {
371
- return 'Function';
372
- }
373
- }
374
- // objects
375
- if (Array.isArray(val)) {
376
- const length = val.length;
377
- let debug = '[';
378
- if (length > 0) {
379
- debug += debugString(val[0]);
380
- }
381
- for(let i = 1; i < length; i++) {
382
- debug += ', ' + debugString(val[i]);
383
- }
384
- debug += ']';
385
- return debug;
386
- }
387
- // Test for built-in
388
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
389
- let className;
390
- if (builtInMatches && builtInMatches.length > 1) {
391
- className = builtInMatches[1];
392
- } else {
393
- // Failed to match the standard '[object ClassName]'
394
- return toString.call(val);
395
- }
396
- if (className == 'Object') {
397
- // we're a user defined class or Object
398
- // JSON.stringify avoids problems with cycles, and is generally much
399
- // easier than looping through ownProperties of `val`.
400
- try {
401
- return 'Object(' + JSON.stringify(val) + ')';
402
- } catch (_) {
403
- return 'Object';
377
+ // Failed to match the standard '[object ClassName]'
378
+ if (className === undefined) {
379
+ return toStringOutput;
380
+ }
381
+ if (className === 'Object') {
382
+ // we're a user defined class or Object
383
+ // JSON.stringify avoids problems with cycles, and is generally much
384
+ // easier than looping through ownProperties of `val`.
385
+ try {
386
+ return 'Object(' + JSON.stringify(val) + ')';
387
+ } catch (_) {
388
+ return 'Object';
389
+ }
390
+ }
391
+ // TODO we could test for more things here, like `Set`s and `Map`s.
392
+ return className;
404
393
  }
394
+ // Per MDN: 'This list of values is exhaustive.'
395
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof#description
405
396
  }
406
- // errors
407
- if (val instanceof Error) {
408
- return `${val.name}: ${val.message}\n${val.stack}`;
409
- }
410
- // TODO we could test for more things here, like `Set`s and `Map`s.
411
- return className;
412
- }
413
-
414
- function dropObject(idx) {
415
- if (idx < 1028) return;
416
- heap[idx] = heap_next;
417
- heap_next = idx;
418
397
  }
419
398
 
420
399
  function getArrayJsValueFromWasm0(ptr, len) {
@@ -422,8 +401,9 @@ function getArrayJsValueFromWasm0(ptr, len) {
422
401
  const mem = getDataViewMemory0();
423
402
  const result = [];
424
403
  for (let i = ptr; i < ptr + 4 * len; i += 4) {
425
- result.push(takeObject(mem.getUint32(i, true)));
404
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
426
405
  }
406
+ wasm.__wbindgen_export5(ptr, len);
427
407
  return result;
428
408
  }
429
409
 
@@ -441,7 +421,8 @@ function getDataViewMemory0() {
441
421
  }
442
422
 
443
423
  function getStringFromWasm0(ptr, len) {
444
- return decodeText(ptr >>> 0, len);
424
+ ptr = ptr >>> 0;
425
+ return decodeText(getUint8ArrayMemory0().subarray(ptr, ptr + len));
445
426
  }
446
427
 
447
428
  let cachedUint8ArrayMemory0 = null;
@@ -452,13 +433,6 @@ function getUint8ArrayMemory0() {
452
433
  return cachedUint8ArrayMemory0;
453
434
  }
454
435
 
455
- function getObject(idx) { return heap[idx]; }
456
-
457
- let heap = new Array(1024).fill(undefined);
458
- heap.push(undefined, null, true, false);
459
-
460
- let heap_next = heap.length;
461
-
462
436
  function isLikeNone(x) {
463
437
  return x === undefined || x === null;
464
438
  }
@@ -500,16 +474,16 @@ function passStringToWasm0(arg, malloc, realloc) {
500
474
  return ptr;
501
475
  }
502
476
 
503
- function takeObject(idx) {
504
- const ret = getObject(idx);
505
- dropObject(idx);
506
- return ret;
477
+ function takeFromExternrefTable0(idx) {
478
+ const value = wasm.__wbindgen_externrefs.get(idx);
479
+ wasm.__wbindgen_export4(idx);
480
+ return value;
507
481
  }
508
482
 
509
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
483
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true });
510
484
  cachedTextDecoder.decode();
511
- function decodeText(ptr, len) {
512
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
485
+ function decodeText(bytes) {
486
+ return cachedTextDecoder.decode(bytes);
513
487
  }
514
488
 
515
489
  const cachedTextEncoder = new TextEncoder();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "csskit",
3
- "version": "0.0.37-canary.edf34f2724",
3
+ "version": "0.0.37",
4
4
  "description": "Refreshing CSS",
5
5
  "keywords": [],
6
6
  "repository": "https://github.com/csskit/csskit",
@@ -48,11 +48,11 @@
48
48
  "test:wasm": "node --test tests/bundle.test.js"
49
49
  },
50
50
  "optionalDependencies": {
51
- "csskit-darwin-arm64": "0.0.37-canary.edf34f2724",
52
- "csskit-darwin-x64": "0.0.37-canary.edf34f2724",
53
- "csskit-linux-arm64": "0.0.37-canary.edf34f2724",
54
- "csskit-linux-x64": "0.0.37-canary.edf34f2724",
55
- "csskit-win32-arm64": "0.0.37-canary.edf34f2724",
56
- "csskit-win32-x64": "0.0.37-canary.edf34f2724"
51
+ "csskit-darwin-arm64": "0.0.37",
52
+ "csskit-darwin-x64": "0.0.37",
53
+ "csskit-linux-arm64": "0.0.37",
54
+ "csskit-linux-x64": "0.0.37",
55
+ "csskit-win32-arm64": "0.0.37",
56
+ "csskit-win32-x64": "0.0.37"
57
57
  }
58
58
  }