1
1
let wasm ;
2
2
3
- function isLikeNone ( x ) {
4
- return x === undefined || x === null ;
5
- }
6
-
7
- let cachedFloat64Memory0 = null ;
8
-
9
- function getFloat64Memory0 ( ) {
10
- if ( cachedFloat64Memory0 === null || cachedFloat64Memory0 . byteLength === 0 ) {
11
- cachedFloat64Memory0 = new Float64Array ( wasm . memory . buffer ) ;
12
- }
13
- return cachedFloat64Memory0 ;
14
- }
15
-
16
- let cachedInt32Memory0 = null ;
17
-
18
- function getInt32Memory0 ( ) {
19
- if ( cachedInt32Memory0 === null || cachedInt32Memory0 . byteLength === 0 ) {
20
- cachedInt32Memory0 = new Int32Array ( wasm . memory . buffer ) ;
21
- }
22
- return cachedInt32Memory0 ;
23
- }
24
-
25
3
function debugString ( val ) {
26
4
// primitive types
27
5
const type = typeof val ;
@@ -98,7 +76,7 @@ function getUint8Memory0() {
98
76
return cachedUint8Memory0 ;
99
77
}
100
78
101
- const cachedTextEncoder = new TextEncoder ( 'utf-8' ) ;
79
+ const cachedTextEncoder = ( typeof TextEncoder !== 'undefined' ? new TextEncoder ( 'utf-8' ) : { encode : ( ) => { throw Error ( 'TextEncoder not available' ) } } ) ;
102
80
103
81
const encodeString = ( typeof cachedTextEncoder . encodeInto === 'function'
104
82
? function ( arg , view ) {
@@ -117,14 +95,14 @@ function passStringToWasm0(arg, malloc, realloc) {
117
95
118
96
if ( realloc === undefined ) {
119
97
const buf = cachedTextEncoder . encode ( arg ) ;
120
- const ptr = malloc ( buf . length ) ;
98
+ const ptr = malloc ( buf . length , 1 ) >>> 0 ;
121
99
getUint8Memory0 ( ) . subarray ( ptr , ptr + buf . length ) . set ( buf ) ;
122
100
WASM_VECTOR_LEN = buf . length ;
123
101
return ptr ;
124
102
}
125
103
126
104
let len = arg . length ;
127
- let ptr = malloc ( len ) ;
105
+ let ptr = malloc ( len , 1 ) >>> 0 ;
128
106
129
107
const mem = getUint8Memory0 ( ) ;
130
108
@@ -140,7 +118,7 @@ function passStringToWasm0(arg, malloc, realloc) {
140
118
if ( offset !== 0 ) {
141
119
arg = arg . slice ( offset ) ;
142
120
}
143
- ptr = realloc ( ptr , len , len = offset + arg . length * 3 ) ;
121
+ ptr = realloc ( ptr , len , len = offset + arg . length * 3 , 1 ) >>> 0 ;
144
122
const view = getUint8Memory0 ( ) . subarray ( ptr + offset , ptr + len ) ;
145
123
const ret = encodeString ( arg , view ) ;
146
124
@@ -151,11 +129,21 @@ function passStringToWasm0(arg, malloc, realloc) {
151
129
return ptr ;
152
130
}
153
131
154
- const cachedTextDecoder = new TextDecoder ( 'utf-8' , { ignoreBOM : true , fatal : true } ) ;
132
+ let cachedInt32Memory0 = null ;
155
133
156
- cachedTextDecoder . decode ( ) ;
134
+ function getInt32Memory0 ( ) {
135
+ if ( cachedInt32Memory0 === null || cachedInt32Memory0 . byteLength === 0 ) {
136
+ cachedInt32Memory0 = new Int32Array ( wasm . memory . buffer ) ;
137
+ }
138
+ return cachedInt32Memory0 ;
139
+ }
140
+
141
+ const cachedTextDecoder = ( typeof TextDecoder !== 'undefined' ? new TextDecoder ( 'utf-8' , { ignoreBOM : true , fatal : true } ) : { decode : ( ) => { throw Error ( 'TextDecoder not available' ) } } ) ;
142
+
143
+ if ( typeof TextDecoder !== 'undefined' ) { cachedTextDecoder . decode ( ) ; } ;
157
144
158
145
function getStringFromWasm0 ( ptr , len ) {
146
+ ptr = ptr >>> 0 ;
159
147
return cachedTextDecoder . decode ( getUint8Memory0 ( ) . subarray ( ptr , ptr + len ) ) ;
160
148
}
161
149
@@ -187,7 +175,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
187
175
CLOSURE_DTORS . register ( real , state , state ) ;
188
176
return real ;
189
177
}
190
- function __wbg_adapter_20 ( arg0 , arg1 , arg2 ) {
178
+ function __wbg_adapter_18 ( arg0 , arg1 , arg2 ) {
191
179
wasm . closure5_externref_shim ( arg0 , arg1 , arg2 ) ;
192
180
}
193
181
@@ -216,7 +204,11 @@ function handleError(f, args) {
216
204
}
217
205
}
218
206
219
- async function load ( module , imports ) {
207
+ function isLikeNone ( x ) {
208
+ return x === undefined || x === null ;
209
+ }
210
+
211
+ async function __wbg_load ( module , imports ) {
220
212
if ( typeof Response === 'function' && module instanceof Response ) {
221
213
if ( typeof WebAssembly . instantiateStreaming === 'function' ) {
222
214
try {
@@ -247,7 +239,7 @@ async function load(module, imports) {
247
239
}
248
240
}
249
241
250
- function getImports ( ) {
242
+ function __wbg_get_imports ( ) {
251
243
const imports = { } ;
252
244
imports . wbg = { } ;
253
245
imports . wbg . __wbg_classList_c4ebb3813d3a2f5d = function ( arg0 ) {
@@ -282,15 +274,6 @@ function getImports() {
282
274
const ret = arg0 . currentTarget ;
283
275
return isLikeNone ( ret ) ? 0 : addToExternrefTable0 ( ret ) ;
284
276
} ;
285
- imports . wbg . __wbindgen_cb_drop = function ( arg0 ) {
286
- const obj = arg0 . original ;
287
- if ( obj . cnt -- == 1 ) {
288
- obj . a = 0 ;
289
- return true ;
290
- }
291
- const ret = false ;
292
- return ret ;
293
- } ;
294
277
imports . wbg . __wbg_setAttribute_79c9562d32d05e66 = function ( ) { return handleError ( function ( arg0 , arg1 , arg2 , arg3 , arg4 ) {
295
278
var v0 = getCachedStringFromWasm0 ( arg1 , arg2 ) ;
296
279
var v1 = getCachedStringFromWasm0 ( arg3 , arg4 ) ;
@@ -328,40 +311,6 @@ function getImports() {
328
311
imports . wbg . __wbg_replaceWith_047ccd5d5d7fe68c = function ( ) { return handleError ( function ( arg0 , arg1 ) {
329
312
arg0 . replaceWith ( arg1 ) ;
330
313
} , arguments ) } ;
331
- imports . wbg . __wbg_setonpopstate_3231b4d447477861 = function ( arg0 , arg1 ) {
332
- arg0 . onpopstate = arg1 ;
333
- } ;
334
- imports . wbg . __wbg_location_797a1856892cc2de = function ( arg0 ) {
335
- const ret = arg0 . location ;
336
- return ret ;
337
- } ;
338
- imports . wbg . __wbg_baseURI_183bb1b65bdb30f8 = function ( ) { return handleError ( function ( arg0 , arg1 ) {
339
- const ret = arg1 . baseURI ;
340
- var ptr0 = isLikeNone ( ret ) ? 0 : passStringToWasm0 ( ret , wasm . __wbindgen_malloc , wasm . __wbindgen_realloc ) ;
341
- var len0 = WASM_VECTOR_LEN ;
342
- getInt32Memory0 ( ) [ arg0 / 4 + 1 ] = len0 ;
343
- getInt32Memory0 ( ) [ arg0 / 4 + 0 ] = ptr0 ;
344
- } , arguments ) } ;
345
- imports . wbg . __wbg_href_bb86bb94d1c6861b = function ( ) { return handleError ( function ( arg0 , arg1 ) {
346
- const ret = arg1 . href ;
347
- const ptr0 = passStringToWasm0 ( ret , wasm . __wbindgen_malloc , wasm . __wbindgen_realloc ) ;
348
- const len0 = WASM_VECTOR_LEN ;
349
- getInt32Memory0 ( ) [ arg0 / 4 + 1 ] = len0 ;
350
- getInt32Memory0 ( ) [ arg0 / 4 + 0 ] = ptr0 ;
351
- } , arguments ) } ;
352
- imports . wbg . __wbg_pathname_7b2f7ba43a0fdd6e = function ( ) { return handleError ( function ( arg0 , arg1 ) {
353
- const ret = arg1 . pathname ;
354
- const ptr0 = passStringToWasm0 ( ret , wasm . __wbindgen_malloc , wasm . __wbindgen_realloc ) ;
355
- const len0 = WASM_VECTOR_LEN ;
356
- getInt32Memory0 ( ) [ arg0 / 4 + 1 ] = len0 ;
357
- getInt32Memory0 ( ) [ arg0 / 4 + 0 ] = ptr0 ;
358
- } , arguments ) } ;
359
- imports . wbg . __wbindgen_number_get = function ( arg0 , arg1 ) {
360
- const obj = arg1 ;
361
- const ret = typeof ( obj ) === 'number' ? obj : undefined ;
362
- getFloat64Memory0 ( ) [ arg0 / 8 + 1 ] = isLikeNone ( ret ) ? 0 : ret ;
363
- getInt32Memory0 ( ) [ arg0 / 4 + 0 ] = ! isLikeNone ( ret ) ;
364
- } ;
365
314
imports . wbg . __wbg_createElement_e2a0e21263eb5416 = function ( ) { return handleError ( function ( arg0 , arg1 , arg2 ) {
366
315
var v0 = getCachedStringFromWasm0 ( arg1 , arg2 ) ;
367
316
const ret = arg0 . createElement ( v0 ) ;
@@ -380,10 +329,10 @@ function getImports() {
380
329
} ;
381
330
imports . wbg . __wbindgen_debug_string = function ( arg0 , arg1 ) {
382
331
const ret = debugString ( arg1 ) ;
383
- const ptr0 = passStringToWasm0 ( ret , wasm . __wbindgen_malloc , wasm . __wbindgen_realloc ) ;
384
- const len0 = WASM_VECTOR_LEN ;
385
- getInt32Memory0 ( ) [ arg0 / 4 + 1 ] = len0 ;
386
- getInt32Memory0 ( ) [ arg0 / 4 + 0 ] = ptr0 ;
332
+ const ptr1 = passStringToWasm0 ( ret , wasm . __wbindgen_malloc , wasm . __wbindgen_realloc ) ;
333
+ const len1 = WASM_VECTOR_LEN ;
334
+ getInt32Memory0 ( ) [ arg0 / 4 + 1 ] = len1 ;
335
+ getInt32Memory0 ( ) [ arg0 / 4 + 0 ] = ptr1 ;
387
336
} ;
388
337
imports . wbg . __wbindgen_throw = function ( arg0 , arg1 ) {
389
338
throw new Error ( getStringFromWasm0 ( arg0 , arg1 ) ) ;
@@ -396,6 +345,15 @@ function getImports() {
396
345
const ret = Promise . resolve ( arg0 ) ;
397
346
return ret ;
398
347
} ;
348
+ imports . wbg . __wbindgen_cb_drop = function ( arg0 ) {
349
+ const obj = arg0 . original ;
350
+ if ( obj . cnt -- == 1 ) {
351
+ obj . a = 0 ;
352
+ return true ;
353
+ }
354
+ const ret = false ;
355
+ return ret ;
356
+ } ;
399
357
imports . wbg . __wbg_then_ec5db6d509eb475f = function ( arg0 , arg1 ) {
400
358
const ret = arg0 . then ( arg1 ) ;
401
359
return ret ;
@@ -439,16 +397,12 @@ function getImports() {
439
397
const ret = result ;
440
398
return ret ;
441
399
} ;
442
- imports . wbg . __wbindgen_closure_wrapper127 = function ( arg0 , arg1 , arg2 ) {
443
- const ret = makeMutClosure ( arg0 , arg1 , 6 , __wbg_adapter_20 ) ;
400
+ imports . wbg . __wbindgen_closure_wrapper123 = function ( arg0 , arg1 , arg2 ) {
401
+ const ret = makeMutClosure ( arg0 , arg1 , 6 , __wbg_adapter_18 ) ;
444
402
return ret ;
445
403
} ;
446
- imports . wbg . __wbindgen_closure_wrapper233 = function ( arg0 , arg1 , arg2 ) {
447
- const ret = makeMutClosure ( arg0 , arg1 , 6 , __wbg_adapter_20 ) ;
448
- return ret ;
449
- } ;
450
- imports . wbg . __wbindgen_closure_wrapper839 = function ( arg0 , arg1 , arg2 ) {
451
- const ret = makeMutClosure ( arg0 , arg1 , 6 , __wbg_adapter_20 ) ;
404
+ imports . wbg . __wbindgen_closure_wrapper797 = function ( arg0 , arg1 , arg2 ) {
405
+ const ret = makeMutClosure ( arg0 , arg1 , 6 , __wbg_adapter_18 ) ;
452
406
return ret ;
453
407
} ;
454
408
imports . wbg . __wbindgen_init_externref_table = function ( ) {
@@ -465,14 +419,13 @@ function getImports() {
465
419
return imports ;
466
420
}
467
421
468
- function initMemory ( imports , maybe_memory ) {
422
+ function __wbg_init_memory ( imports , maybe_memory ) {
469
423
470
424
}
471
425
472
- function finalizeInit ( instance , module ) {
426
+ function __wbg_finalize_init ( instance , module ) {
473
427
wasm = instance . exports ;
474
- init . __wbindgen_wasm_module = module ;
475
- cachedFloat64Memory0 = null ;
428
+ __wbg_init . __wbindgen_wasm_module = module ;
476
429
cachedInt32Memory0 = null ;
477
430
cachedUint8Memory0 = null ;
478
431
@@ -481,35 +434,39 @@ function finalizeInit(instance, module) {
481
434
}
482
435
483
436
function initSync ( module ) {
484
- const imports = getImports ( ) ;
437
+ if ( wasm !== undefined ) return wasm ;
438
+
439
+ const imports = __wbg_get_imports ( ) ;
485
440
486
- initMemory ( imports ) ;
441
+ __wbg_init_memory ( imports ) ;
487
442
488
443
if ( ! ( module instanceof WebAssembly . Module ) ) {
489
444
module = new WebAssembly . Module ( module ) ;
490
445
}
491
446
492
447
const instance = new WebAssembly . Instance ( module , imports ) ;
493
448
494
- return finalizeInit ( instance , module ) ;
449
+ return __wbg_finalize_init ( instance , module ) ;
495
450
}
496
451
497
- async function init ( input ) {
452
+ async function __wbg_init ( input ) {
453
+ if ( wasm !== undefined ) return wasm ;
454
+
498
455
if ( typeof input === 'undefined' ) {
499
- input = new URL ( 'js-framework-benchmark-silkenweb-c1debd87db51acf2_bg .wasm' , import . meta. url ) ;
456
+ input = new URL ( 'js-framework-benchmark-silkenweb-fa1762b6e678dcf6_bg .wasm' , import . meta. url ) ;
500
457
}
501
- const imports = getImports ( ) ;
458
+ const imports = __wbg_get_imports ( ) ;
502
459
503
460
if ( typeof input === 'string' || ( typeof Request === 'function' && input instanceof Request ) || ( typeof URL === 'function' && input instanceof URL ) ) {
504
461
input = fetch ( input ) ;
505
462
}
506
463
507
- initMemory ( imports ) ;
464
+ __wbg_init_memory ( imports ) ;
508
465
509
- const { instance, module } = await load ( await input , imports ) ;
466
+ const { instance, module } = await __wbg_load ( await input , imports ) ;
510
467
511
- return finalizeInit ( instance , module ) ;
468
+ return __wbg_finalize_init ( instance , module ) ;
512
469
}
513
470
514
471
export { initSync }
515
- export default init ;
472
+ export default __wbg_init ;
0 commit comments