@netlify/edge-bundler 8.8.0 → 8.8.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/deno/lib/common.ts +3 -3
- package/deno/lib/stage2.ts +2 -2
- package/deno/vendor/deno.land/std@0.178.0/_util/asserts.ts +25 -0
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/_util/os.ts +4 -3
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/_constants.ts +1 -1
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/_interface.ts +1 -1
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/_util.ts +63 -2
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/common.ts +1 -1
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/glob.ts +10 -5
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/mod.ts +20 -2
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/posix.ts +76 -105
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/separator.ts +1 -1
- package/deno/vendor/deno.land/{std@0.127.0 → std@0.178.0}/path/win32.ts +36 -82
- package/deno/vendor/deno.land/x/{eszip@v0.28.0 → eszip@v0.37.0}/eszip_wasm.generated.js +350 -114
- package/deno/vendor/deno.land/x/eszip@v0.37.0/eszip_wasm_bg.wasm +0 -0
- package/deno/vendor/deno.land/x/{eszip@v0.28.0 → eszip@v0.37.0}/loader.ts +1 -1
- package/deno/vendor/deno.land/x/{eszip@v0.28.0 → eszip@v0.37.0}/mod.ts +4 -2
- package/dist/test/util.js +1 -1
- package/package.json +1 -1
- package/deno/vendor/deno.land/std@0.127.0/_util/assert.ts +0 -15
- package/deno/vendor/deno.land/x/eszip@v0.28.0/eszip_wasm_bg.wasm +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @generated file from wasmbuild -- do not edit
|
|
2
2
|
// deno-lint-ignore-file
|
|
3
3
|
// deno-fmt-ignore-file
|
|
4
|
-
// source-hash:
|
|
4
|
+
// source-hash: 89edd81d716c7387c15968a0de6fbb8736997e92
|
|
5
5
|
let wasm;
|
|
6
6
|
|
|
7
7
|
const heap = new Array(32).fill(undefined);
|
|
@@ -12,9 +12,32 @@ function getObject(idx) {
|
|
|
12
12
|
return heap[idx];
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
function isLikeNone(x) {
|
|
16
|
+
return x === undefined || x === null;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let cachedFloat64Memory0 = new Float64Array();
|
|
20
|
+
|
|
21
|
+
function getFloat64Memory0() {
|
|
22
|
+
if (cachedFloat64Memory0.byteLength === 0) {
|
|
23
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
24
|
+
}
|
|
25
|
+
return cachedFloat64Memory0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
let cachedInt32Memory0 = new Int32Array();
|
|
29
|
+
|
|
30
|
+
function getInt32Memory0() {
|
|
31
|
+
if (cachedInt32Memory0.byteLength === 0) {
|
|
32
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
33
|
+
}
|
|
34
|
+
return cachedInt32Memory0;
|
|
35
|
+
}
|
|
36
|
+
|
|
15
37
|
let WASM_VECTOR_LEN = 0;
|
|
16
38
|
|
|
17
|
-
let cachedUint8Memory0;
|
|
39
|
+
let cachedUint8Memory0 = new Uint8Array();
|
|
40
|
+
|
|
18
41
|
function getUint8Memory0() {
|
|
19
42
|
if (cachedUint8Memory0.byteLength === 0) {
|
|
20
43
|
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
@@ -65,19 +88,27 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
65
88
|
return ptr;
|
|
66
89
|
}
|
|
67
90
|
|
|
68
|
-
|
|
69
|
-
return x === undefined || x === null;
|
|
70
|
-
}
|
|
91
|
+
let heap_next = heap.length;
|
|
71
92
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
93
|
+
function addHeapObject(obj) {
|
|
94
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
95
|
+
const idx = heap_next;
|
|
96
|
+
heap_next = heap[idx];
|
|
97
|
+
|
|
98
|
+
heap[idx] = obj;
|
|
99
|
+
return idx;
|
|
78
100
|
}
|
|
79
101
|
|
|
80
|
-
|
|
102
|
+
const cachedTextDecoder = new TextDecoder("utf-8", {
|
|
103
|
+
ignoreBOM: true,
|
|
104
|
+
fatal: true,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
cachedTextDecoder.decode();
|
|
108
|
+
|
|
109
|
+
function getStringFromWasm0(ptr, len) {
|
|
110
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
111
|
+
}
|
|
81
112
|
|
|
82
113
|
function dropObject(idx) {
|
|
83
114
|
if (idx < 36) return;
|
|
@@ -91,24 +122,78 @@ function takeObject(idx) {
|
|
|
91
122
|
return ret;
|
|
92
123
|
}
|
|
93
124
|
|
|
94
|
-
|
|
95
|
-
ignoreBOM: true,
|
|
96
|
-
fatal: true,
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
cachedTextDecoder.decode();
|
|
125
|
+
let cachedBigInt64Memory0 = new BigInt64Array();
|
|
100
126
|
|
|
101
|
-
function
|
|
102
|
-
|
|
127
|
+
function getBigInt64Memory0() {
|
|
128
|
+
if (cachedBigInt64Memory0.byteLength === 0) {
|
|
129
|
+
cachedBigInt64Memory0 = new BigInt64Array(wasm.memory.buffer);
|
|
130
|
+
}
|
|
131
|
+
return cachedBigInt64Memory0;
|
|
103
132
|
}
|
|
104
133
|
|
|
105
|
-
function
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
134
|
+
function debugString(val) {
|
|
135
|
+
// primitive types
|
|
136
|
+
const type = typeof val;
|
|
137
|
+
if (type == "number" || type == "boolean" || val == null) {
|
|
138
|
+
return `${val}`;
|
|
139
|
+
}
|
|
140
|
+
if (type == "string") {
|
|
141
|
+
return `"${val}"`;
|
|
142
|
+
}
|
|
143
|
+
if (type == "symbol") {
|
|
144
|
+
const description = val.description;
|
|
145
|
+
if (description == null) {
|
|
146
|
+
return "Symbol";
|
|
147
|
+
} else {
|
|
148
|
+
return `Symbol(${description})`;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
if (type == "function") {
|
|
152
|
+
const name = val.name;
|
|
153
|
+
if (typeof name == "string" && name.length > 0) {
|
|
154
|
+
return `Function(${name})`;
|
|
155
|
+
} else {
|
|
156
|
+
return "Function";
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// objects
|
|
160
|
+
if (Array.isArray(val)) {
|
|
161
|
+
const length = val.length;
|
|
162
|
+
let debug = "[";
|
|
163
|
+
if (length > 0) {
|
|
164
|
+
debug += debugString(val[0]);
|
|
165
|
+
}
|
|
166
|
+
for (let i = 1; i < length; i++) {
|
|
167
|
+
debug += ", " + debugString(val[i]);
|
|
168
|
+
}
|
|
169
|
+
debug += "]";
|
|
170
|
+
return debug;
|
|
171
|
+
}
|
|
172
|
+
// Test for built-in
|
|
173
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
174
|
+
let className;
|
|
175
|
+
if (builtInMatches.length > 1) {
|
|
176
|
+
className = builtInMatches[1];
|
|
177
|
+
} else {
|
|
178
|
+
// Failed to match the standard '[object ClassName]'
|
|
179
|
+
return toString.call(val);
|
|
180
|
+
}
|
|
181
|
+
if (className == "Object") {
|
|
182
|
+
// we're a user defined class or Object
|
|
183
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
184
|
+
// easier than looping through ownProperties of `val`.
|
|
185
|
+
try {
|
|
186
|
+
return "Object(" + JSON.stringify(val) + ")";
|
|
187
|
+
} catch (_) {
|
|
188
|
+
return "Object";
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
// errors
|
|
192
|
+
if (val instanceof Error) {
|
|
193
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
194
|
+
}
|
|
195
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
196
|
+
return className;
|
|
112
197
|
}
|
|
113
198
|
|
|
114
199
|
const CLOSURE_DTORS = new FinalizationRegistry((state) => {
|
|
@@ -139,9 +224,9 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
139
224
|
CLOSURE_DTORS.register(real, state, state);
|
|
140
225
|
return real;
|
|
141
226
|
}
|
|
142
|
-
function
|
|
227
|
+
function __wbg_adapter_40(arg0, arg1, arg2) {
|
|
143
228
|
wasm
|
|
144
|
-
.
|
|
229
|
+
._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hdb89611f6af59487(
|
|
145
230
|
arg0,
|
|
146
231
|
arg1,
|
|
147
232
|
addHeapObject(arg2),
|
|
@@ -177,8 +262,8 @@ function handleError(f, args) {
|
|
|
177
262
|
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
178
263
|
}
|
|
179
264
|
}
|
|
180
|
-
function
|
|
181
|
-
wasm.
|
|
265
|
+
function __wbg_adapter_98(arg0, arg1, arg2, arg3) {
|
|
266
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h73ff6ec860ceda5d(
|
|
182
267
|
arg0,
|
|
183
268
|
arg1,
|
|
184
269
|
addHeapObject(arg2),
|
|
@@ -276,6 +361,21 @@ export class Parser {
|
|
|
276
361
|
|
|
277
362
|
const imports = {
|
|
278
363
|
__wbindgen_placeholder__: {
|
|
364
|
+
__wbindgen_in: function (arg0, arg1) {
|
|
365
|
+
const ret = getObject(arg0) in getObject(arg1);
|
|
366
|
+
return ret;
|
|
367
|
+
},
|
|
368
|
+
__wbindgen_number_get: function (arg0, arg1) {
|
|
369
|
+
const obj = getObject(arg1);
|
|
370
|
+
const ret = typeof (obj) === "number" ? obj : undefined;
|
|
371
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
372
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
373
|
+
},
|
|
374
|
+
__wbindgen_boolean_get: function (arg0) {
|
|
375
|
+
const v = getObject(arg0);
|
|
376
|
+
const ret = typeof (v) === "boolean" ? (v ? 1 : 0) : 2;
|
|
377
|
+
return ret;
|
|
378
|
+
},
|
|
279
379
|
__wbindgen_string_get: function (arg0, arg1) {
|
|
280
380
|
const obj = getObject(arg1);
|
|
281
381
|
const ret = typeof (obj) === "string" ? obj : undefined;
|
|
@@ -290,26 +390,40 @@ const imports = {
|
|
|
290
390
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
291
391
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
292
392
|
},
|
|
293
|
-
|
|
294
|
-
|
|
393
|
+
__wbindgen_is_bigint: function (arg0) {
|
|
394
|
+
const ret = typeof (getObject(arg0)) === "bigint";
|
|
395
|
+
return ret;
|
|
396
|
+
},
|
|
397
|
+
__wbindgen_is_object: function (arg0) {
|
|
398
|
+
const val = getObject(arg0);
|
|
399
|
+
const ret = typeof (val) === "object" && val !== null;
|
|
400
|
+
return ret;
|
|
401
|
+
},
|
|
402
|
+
__wbindgen_bigint_from_i64: function (arg0) {
|
|
403
|
+
const ret = arg0;
|
|
404
|
+
return addHeapObject(ret);
|
|
405
|
+
},
|
|
406
|
+
__wbindgen_bigint_from_u64: function (arg0) {
|
|
407
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
408
|
+
return addHeapObject(ret);
|
|
409
|
+
},
|
|
410
|
+
__wbg_new_1d9a920c6bfc44a8: function () {
|
|
411
|
+
const ret = new Array();
|
|
412
|
+
return addHeapObject(ret);
|
|
295
413
|
},
|
|
296
414
|
__wbindgen_string_new: function (arg0, arg1) {
|
|
297
415
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
298
416
|
return addHeapObject(ret);
|
|
299
417
|
},
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
const ptr0 = passStringToWasm0(
|
|
304
|
-
ret,
|
|
305
|
-
wasm.__wbindgen_malloc,
|
|
306
|
-
wasm.__wbindgen_realloc,
|
|
307
|
-
);
|
|
308
|
-
const len0 = WASM_VECTOR_LEN;
|
|
309
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
310
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
418
|
+
__wbg_push_740e4b286702d964: function (arg0, arg1) {
|
|
419
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
420
|
+
return ret;
|
|
311
421
|
},
|
|
312
|
-
|
|
422
|
+
__wbg_length_6e3bbe7c8bd4dbd8: function (arg0) {
|
|
423
|
+
const ret = getObject(arg0).length;
|
|
424
|
+
return ret;
|
|
425
|
+
},
|
|
426
|
+
__wbg_new_8d2af00bc1e329ee: function (arg0, arg1) {
|
|
313
427
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
314
428
|
return addHeapObject(ret);
|
|
315
429
|
},
|
|
@@ -317,11 +431,11 @@ const imports = {
|
|
|
317
431
|
const ret = wasm.memory;
|
|
318
432
|
return addHeapObject(ret);
|
|
319
433
|
},
|
|
320
|
-
|
|
434
|
+
__wbg_buffer_3f3d764d4747d564: function (arg0) {
|
|
321
435
|
const ret = getObject(arg0).buffer;
|
|
322
436
|
return addHeapObject(ret);
|
|
323
437
|
},
|
|
324
|
-
|
|
438
|
+
__wbg_newwithbyteoffsetandlength_d9aa266703cb98be: function (
|
|
325
439
|
arg0,
|
|
326
440
|
arg1,
|
|
327
441
|
arg2,
|
|
@@ -329,59 +443,62 @@ const imports = {
|
|
|
329
443
|
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
330
444
|
return addHeapObject(ret);
|
|
331
445
|
},
|
|
332
|
-
|
|
446
|
+
__wbg_new_8c3f0052272a457a: function (arg0) {
|
|
333
447
|
const ret = new Uint8Array(getObject(arg0));
|
|
334
448
|
return addHeapObject(ret);
|
|
335
449
|
},
|
|
336
|
-
|
|
337
|
-
const ret =
|
|
338
|
-
|
|
450
|
+
__wbg_String_91fba7ded13ba54c: function (arg0, arg1) {
|
|
451
|
+
const ret = String(getObject(arg1));
|
|
452
|
+
const ptr0 = passStringToWasm0(
|
|
453
|
+
ret,
|
|
454
|
+
wasm.__wbindgen_malloc,
|
|
455
|
+
wasm.__wbindgen_realloc,
|
|
456
|
+
);
|
|
457
|
+
const len0 = WASM_VECTOR_LEN;
|
|
458
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
459
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
339
460
|
},
|
|
340
|
-
|
|
341
|
-
const ret = getObject(arg0)
|
|
461
|
+
__wbindgen_jsval_eq: function (arg0, arg1) {
|
|
462
|
+
const ret = getObject(arg0) === getObject(arg1);
|
|
342
463
|
return ret;
|
|
343
464
|
},
|
|
344
|
-
|
|
345
|
-
const ret =
|
|
465
|
+
__wbindgen_error_new: function (arg0, arg1) {
|
|
466
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
467
|
+
return addHeapObject(ret);
|
|
468
|
+
},
|
|
469
|
+
__wbg_iterator_6f9d4f28845f426c: function () {
|
|
470
|
+
const ret = Symbol.iterator;
|
|
346
471
|
return addHeapObject(ret);
|
|
347
472
|
},
|
|
348
|
-
|
|
473
|
+
__wbg_newwithlength_f5933855e4f48a19: function (arg0) {
|
|
349
474
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
350
475
|
return addHeapObject(ret);
|
|
351
476
|
},
|
|
352
|
-
|
|
477
|
+
__wbg_read_1bddf8e8af59d1d6: function (arg0, arg1) {
|
|
353
478
|
const ret = getObject(arg0).read(getObject(arg1));
|
|
354
479
|
return addHeapObject(ret);
|
|
355
480
|
},
|
|
356
|
-
|
|
481
|
+
__wbg_done_1c9555f2eaa593e9: function (arg0) {
|
|
357
482
|
const ret = getObject(arg0).done;
|
|
358
483
|
return ret;
|
|
359
484
|
},
|
|
360
|
-
|
|
361
|
-
const val = getObject(arg0);
|
|
362
|
-
const ret = typeof (val) === "object" && val !== null;
|
|
363
|
-
return ret;
|
|
364
|
-
},
|
|
365
|
-
__wbg_toString_81e19471abb6dc98: function (arg0) {
|
|
485
|
+
__wbg_toString_7be108a12ef03bc2: function (arg0) {
|
|
366
486
|
const ret = getObject(arg0).toString();
|
|
367
487
|
return addHeapObject(ret);
|
|
368
488
|
},
|
|
369
|
-
|
|
489
|
+
__wbg_value_a5e55ed0660d29ac: function (arg0) {
|
|
370
490
|
const ret = getObject(arg0).value;
|
|
371
491
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
372
492
|
},
|
|
373
|
-
|
|
493
|
+
__wbg_byteLength_87a0436a74adc26c: function (arg0) {
|
|
374
494
|
const ret = getObject(arg0).byteLength;
|
|
375
495
|
return ret;
|
|
376
496
|
},
|
|
377
|
-
|
|
497
|
+
__wbg_length_9e1ae1900cb0fbd5: function (arg0) {
|
|
378
498
|
const ret = getObject(arg0).length;
|
|
379
499
|
return ret;
|
|
380
500
|
},
|
|
381
|
-
|
|
382
|
-
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
383
|
-
},
|
|
384
|
-
__wbg_call_8e1338b908441bd2: function () {
|
|
501
|
+
__wbg_call_3999bee59e9f7719: function () {
|
|
385
502
|
return handleError(function (arg0, arg1, arg2, arg3) {
|
|
386
503
|
const ret = getObject(arg0).call(
|
|
387
504
|
getObject(arg1),
|
|
@@ -391,14 +508,18 @@ const imports = {
|
|
|
391
508
|
return addHeapObject(ret);
|
|
392
509
|
}, arguments);
|
|
393
510
|
},
|
|
394
|
-
|
|
511
|
+
__wbg_resolve_99fe17964f31ffc0: function (arg0) {
|
|
512
|
+
const ret = Promise.resolve(getObject(arg0));
|
|
513
|
+
return addHeapObject(ret);
|
|
514
|
+
},
|
|
515
|
+
__wbg_new_9962f939219f1820: function (arg0, arg1) {
|
|
395
516
|
try {
|
|
396
517
|
var state0 = { a: arg0, b: arg1 };
|
|
397
518
|
var cb0 = (arg0, arg1) => {
|
|
398
519
|
const a = state0.a;
|
|
399
520
|
state0.a = 0;
|
|
400
521
|
try {
|
|
401
|
-
return
|
|
522
|
+
return __wbg_adapter_98(a, state0.b, arg0, arg1);
|
|
402
523
|
} finally {
|
|
403
524
|
state0.a = a;
|
|
404
525
|
}
|
|
@@ -409,11 +530,11 @@ const imports = {
|
|
|
409
530
|
state0.a = state0.b = 0;
|
|
410
531
|
}
|
|
411
532
|
},
|
|
412
|
-
|
|
533
|
+
__wbg_new_abda76e883ba8a5f: function () {
|
|
413
534
|
const ret = new Error();
|
|
414
535
|
return addHeapObject(ret);
|
|
415
536
|
},
|
|
416
|
-
|
|
537
|
+
__wbg_stack_658279fe44541cf6: function (arg0, arg1) {
|
|
417
538
|
const ret = getObject(arg1).stack;
|
|
418
539
|
const ptr0 = passStringToWasm0(
|
|
419
540
|
ret,
|
|
@@ -424,19 +545,116 @@ const imports = {
|
|
|
424
545
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
425
546
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
426
547
|
},
|
|
427
|
-
|
|
548
|
+
__wbg_error_f851667af71bcfc6: function (arg0, arg1) {
|
|
428
549
|
try {
|
|
429
550
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
430
551
|
} finally {
|
|
431
552
|
wasm.__wbindgen_free(arg0, arg1);
|
|
432
553
|
}
|
|
433
554
|
},
|
|
434
|
-
|
|
555
|
+
__wbindgen_object_drop_ref: function (arg0) {
|
|
556
|
+
takeObject(arg0);
|
|
557
|
+
},
|
|
558
|
+
__wbindgen_is_function: function (arg0) {
|
|
559
|
+
const ret = typeof (getObject(arg0)) === "function";
|
|
560
|
+
return ret;
|
|
561
|
+
},
|
|
562
|
+
__wbg_get_57245cc7d7c7619d: function (arg0, arg1) {
|
|
563
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
564
|
+
return addHeapObject(ret);
|
|
565
|
+
},
|
|
566
|
+
__wbg_next_aaef7c8aa5e212ac: function () {
|
|
567
|
+
return handleError(function (arg0) {
|
|
568
|
+
const ret = getObject(arg0).next();
|
|
569
|
+
return addHeapObject(ret);
|
|
570
|
+
}, arguments);
|
|
571
|
+
},
|
|
572
|
+
__wbg_done_1b73b0672e15f234: function (arg0) {
|
|
573
|
+
const ret = getObject(arg0).done;
|
|
574
|
+
return ret;
|
|
575
|
+
},
|
|
576
|
+
__wbg_value_1ccc36bc03462d71: function (arg0) {
|
|
577
|
+
const ret = getObject(arg0).value;
|
|
578
|
+
return addHeapObject(ret);
|
|
579
|
+
},
|
|
580
|
+
__wbg_get_765201544a2b6869: function () {
|
|
581
|
+
return handleError(function (arg0, arg1) {
|
|
582
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
583
|
+
return addHeapObject(ret);
|
|
584
|
+
}, arguments);
|
|
585
|
+
},
|
|
586
|
+
__wbg_call_97ae9d8645dc388b: function () {
|
|
587
|
+
return handleError(function (arg0, arg1) {
|
|
588
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
589
|
+
return addHeapObject(ret);
|
|
590
|
+
}, arguments);
|
|
591
|
+
},
|
|
592
|
+
__wbg_next_579e583d33566a86: function (arg0) {
|
|
593
|
+
const ret = getObject(arg0).next;
|
|
594
|
+
return addHeapObject(ret);
|
|
595
|
+
},
|
|
596
|
+
__wbg_isArray_27c46c67f498e15d: function (arg0) {
|
|
597
|
+
const ret = Array.isArray(getObject(arg0));
|
|
598
|
+
return ret;
|
|
599
|
+
},
|
|
600
|
+
__wbg_call_168da88779e35f61: function () {
|
|
435
601
|
return handleError(function (arg0, arg1, arg2) {
|
|
436
602
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
437
603
|
return addHeapObject(ret);
|
|
438
604
|
}, arguments);
|
|
439
605
|
},
|
|
606
|
+
__wbg_isSafeInteger_dfa0593e8d7ac35a: function (arg0) {
|
|
607
|
+
const ret = Number.isSafeInteger(getObject(arg0));
|
|
608
|
+
return ret;
|
|
609
|
+
},
|
|
610
|
+
__wbg_set_83db9690f9353e79: function (arg0, arg1, arg2) {
|
|
611
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
612
|
+
},
|
|
613
|
+
__wbindgen_jsval_loose_eq: function (arg0, arg1) {
|
|
614
|
+
const ret = getObject(arg0) == getObject(arg1);
|
|
615
|
+
return ret;
|
|
616
|
+
},
|
|
617
|
+
__wbg_instanceof_Uint8Array_971eeda69eb75003: function (arg0) {
|
|
618
|
+
let result;
|
|
619
|
+
try {
|
|
620
|
+
result = getObject(arg0) instanceof Uint8Array;
|
|
621
|
+
} catch {
|
|
622
|
+
result = false;
|
|
623
|
+
}
|
|
624
|
+
const ret = result;
|
|
625
|
+
return ret;
|
|
626
|
+
},
|
|
627
|
+
__wbg_instanceof_ArrayBuffer_e5e48f4762c5610b: function (arg0) {
|
|
628
|
+
let result;
|
|
629
|
+
try {
|
|
630
|
+
result = getObject(arg0) instanceof ArrayBuffer;
|
|
631
|
+
} catch {
|
|
632
|
+
result = false;
|
|
633
|
+
}
|
|
634
|
+
const ret = result;
|
|
635
|
+
return ret;
|
|
636
|
+
},
|
|
637
|
+
__wbg_entries_65a76a413fc91037: function (arg0) {
|
|
638
|
+
const ret = Object.entries(getObject(arg0));
|
|
639
|
+
return addHeapObject(ret);
|
|
640
|
+
},
|
|
641
|
+
__wbindgen_bigint_get_as_i64: function (arg0, arg1) {
|
|
642
|
+
const v = getObject(arg1);
|
|
643
|
+
const ret = typeof (v) === "bigint" ? v : undefined;
|
|
644
|
+
getBigInt64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0n : ret;
|
|
645
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
646
|
+
},
|
|
647
|
+
__wbindgen_debug_string: function (arg0, arg1) {
|
|
648
|
+
const ret = debugString(getObject(arg1));
|
|
649
|
+
const ptr0 = passStringToWasm0(
|
|
650
|
+
ret,
|
|
651
|
+
wasm.__wbindgen_malloc,
|
|
652
|
+
wasm.__wbindgen_realloc,
|
|
653
|
+
);
|
|
654
|
+
const len0 = WASM_VECTOR_LEN;
|
|
655
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
656
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
657
|
+
},
|
|
440
658
|
__wbindgen_throw: function (arg0, arg1) {
|
|
441
659
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
442
660
|
},
|
|
@@ -449,38 +667,44 @@ const imports = {
|
|
|
449
667
|
const ret = false;
|
|
450
668
|
return ret;
|
|
451
669
|
},
|
|
452
|
-
|
|
670
|
+
__wbg_then_11f7a54d67b4bfad: function (arg0, arg1) {
|
|
453
671
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
454
672
|
return addHeapObject(ret);
|
|
455
673
|
},
|
|
456
|
-
|
|
674
|
+
__wbg_then_cedad20fbbd9418a: function (arg0, arg1, arg2) {
|
|
457
675
|
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
458
676
|
return addHeapObject(ret);
|
|
459
677
|
},
|
|
460
|
-
|
|
461
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
678
|
+
__wbindgen_closure_wrapper7365: function (arg0, arg1, arg2) {
|
|
679
|
+
const ret = makeMutClosure(arg0, arg1, 272, __wbg_adapter_40);
|
|
462
680
|
return addHeapObject(ret);
|
|
463
681
|
},
|
|
464
682
|
},
|
|
465
683
|
};
|
|
466
684
|
|
|
467
|
-
const wasm_url = new URL("eszip_wasm_bg.wasm", import.meta.url);
|
|
468
|
-
|
|
469
685
|
/**
|
|
470
686
|
* Decompression callback
|
|
471
687
|
*
|
|
472
|
-
* @callback
|
|
688
|
+
* @callback DecompressCallback
|
|
473
689
|
* @param {Uint8Array} compressed
|
|
474
690
|
* @return {Uint8Array} decompressed
|
|
475
691
|
*/
|
|
476
692
|
|
|
693
|
+
/**
|
|
694
|
+
* Options for instantiating a Wasm instance.
|
|
695
|
+
* @typedef {Object} InstantiateOptions
|
|
696
|
+
* @property {URL=} url - Optional url to the Wasm file to instantiate.
|
|
697
|
+
* @property {DecompressCallback=} decompress - Callback to decompress the
|
|
698
|
+
* raw Wasm file bytes before instantiating.
|
|
699
|
+
*/
|
|
700
|
+
|
|
477
701
|
/** Instantiates an instance of the Wasm module returning its functions.
|
|
478
702
|
* @remarks It is safe to call this multiple times and once successfully
|
|
479
703
|
* loaded it will always return a reference to the same object.
|
|
480
|
-
* @param {
|
|
704
|
+
* @param {InstantiateOptions=} opts
|
|
481
705
|
*/
|
|
482
|
-
export async function instantiate(
|
|
483
|
-
return (await instantiateWithInstance(
|
|
706
|
+
export async function instantiate(opts) {
|
|
707
|
+
return (await instantiateWithInstance(opts)).exports;
|
|
484
708
|
}
|
|
485
709
|
|
|
486
710
|
let instanceWithExports;
|
|
@@ -489,20 +713,20 @@ let lastLoadPromise;
|
|
|
489
713
|
/** Instantiates an instance of the Wasm module along with its exports.
|
|
490
714
|
* @remarks It is safe to call this multiple times and once successfully
|
|
491
715
|
* loaded it will always return a reference to the same object.
|
|
492
|
-
* @param {
|
|
716
|
+
* @param {InstantiateOptions=} opts
|
|
493
717
|
* @returns {Promise<{
|
|
494
718
|
* instance: WebAssembly.Instance;
|
|
495
719
|
* exports: { build: typeof build; Parser : typeof Parser }
|
|
496
720
|
* }>}
|
|
497
721
|
*/
|
|
498
|
-
export function instantiateWithInstance(
|
|
722
|
+
export function instantiateWithInstance(opts) {
|
|
499
723
|
if (instanceWithExports != null) {
|
|
500
724
|
return Promise.resolve(instanceWithExports);
|
|
501
725
|
}
|
|
502
726
|
if (lastLoadPromise == null) {
|
|
503
727
|
lastLoadPromise = (async () => {
|
|
504
728
|
try {
|
|
505
|
-
const instance = (await instantiateModule(
|
|
729
|
+
const instance = (await instantiateModule(opts ?? {})).instance;
|
|
506
730
|
wasm = instance.exports;
|
|
507
731
|
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
508
732
|
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
@@ -528,36 +752,48 @@ export function isInstantiated() {
|
|
|
528
752
|
return instanceWithExports != null;
|
|
529
753
|
}
|
|
530
754
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
755
|
+
/**
|
|
756
|
+
* @param {InstantiateOptions} opts
|
|
757
|
+
*/
|
|
758
|
+
async function instantiateModule(opts) {
|
|
759
|
+
const wasmUrl = opts.url ?? new URL("eszip_wasm_bg.wasm", import.meta.url);
|
|
760
|
+
const decompress = opts.decompress;
|
|
761
|
+
const isFile = wasmUrl.protocol === "file:";
|
|
762
|
+
|
|
763
|
+
// make file urls work in Node via dnt
|
|
764
|
+
const isNode = globalThis.process?.versions?.node != null;
|
|
765
|
+
if (isNode && isFile) {
|
|
766
|
+
// the deno global will be shimmed by dnt
|
|
767
|
+
const wasmCode = await Deno.readFile(wasmUrl);
|
|
768
|
+
return WebAssembly.instantiate(
|
|
769
|
+
decompress ? decompress(wasmCode) : wasmCode,
|
|
770
|
+
imports,
|
|
771
|
+
);
|
|
772
|
+
}
|
|
537
773
|
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
const wasmCode = await Deno.readFile(wasm_url);
|
|
542
|
-
return WebAssembly.instantiate(
|
|
543
|
-
!transform ? wasmCode : transform(wasmCode),
|
|
544
|
-
imports,
|
|
545
|
-
);
|
|
546
|
-
}
|
|
774
|
+
switch (wasmUrl.protocol) {
|
|
775
|
+
case "file:":
|
|
547
776
|
case "https:":
|
|
548
777
|
case "http:": {
|
|
549
|
-
if (
|
|
550
|
-
|
|
778
|
+
if (isFile) {
|
|
779
|
+
if (typeof Deno !== "object") {
|
|
780
|
+
throw new Error("file urls are not supported in this environment");
|
|
781
|
+
}
|
|
782
|
+
if ("permissions" in Deno) {
|
|
783
|
+
await Deno.permissions.request({ name: "read", path: wasmUrl });
|
|
784
|
+
}
|
|
785
|
+
} else if (typeof Deno === "object" && "permissions" in Deno) {
|
|
786
|
+
await Deno.permissions.request({ name: "net", host: wasmUrl.host });
|
|
551
787
|
}
|
|
552
|
-
const wasmResponse = await fetch(
|
|
553
|
-
if (
|
|
788
|
+
const wasmResponse = await fetch(wasmUrl);
|
|
789
|
+
if (decompress) {
|
|
554
790
|
const wasmCode = new Uint8Array(await wasmResponse.arrayBuffer());
|
|
555
|
-
return WebAssembly.instantiate(
|
|
791
|
+
return WebAssembly.instantiate(decompress(wasmCode), imports);
|
|
556
792
|
}
|
|
557
793
|
if (
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
794
|
+
isFile ||
|
|
795
|
+
wasmResponse.headers.get("content-type")?.toLowerCase()
|
|
796
|
+
.startsWith("application/wasm")
|
|
561
797
|
) {
|
|
562
798
|
return WebAssembly.instantiateStreaming(wasmResponse, imports);
|
|
563
799
|
} else {
|
|
@@ -568,6 +804,6 @@ async function instantiateModule(transform) {
|
|
|
568
804
|
}
|
|
569
805
|
}
|
|
570
806
|
default:
|
|
571
|
-
throw new Error(`Unsupported protocol: ${
|
|
807
|
+
throw new Error(`Unsupported protocol: ${wasmUrl.protocol}`);
|
|
572
808
|
}
|
|
573
809
|
}
|
|
Binary file
|
|
@@ -17,7 +17,7 @@ export interface LoadResponseModule {
|
|
|
17
17
|
export interface LoadResponseExternalBuiltIn {
|
|
18
18
|
/** The loaded module is either _external_ or _built-in_ to the runtime. */
|
|
19
19
|
kind: "external" | "builtIn";
|
|
20
|
-
/** The
|
|
20
|
+
/** The string URL of the resource. If there were redirects, the final
|
|
21
21
|
* specifier should be set here, otherwise the requested specifier. */
|
|
22
22
|
specifier: string;
|
|
23
23
|
}
|