8
8
var LibraryEmbind = {
9
9
$UnboundTypeError : class extends Error { } ,
10
10
$PureVirtualError : class extends Error { } ,
11
- $GenericWireTypeSize : { { { 2 * POINTER_SIZE } } } ,
12
11
#if EMBIND_AOT
13
12
$InvokerFunctions : '<<< EMBIND_AOT_INVOKERS >>>' ,
14
13
#endif
15
14
// If register_type is used, emval will be registered multiple times for
16
15
// different type id's, but only a single type object is needed on the JS side
17
16
// for all of them. Store the type for reuse.
18
- $EmValType__deps : [ '_emval_decref' , '$Emval' , '$readPointer' , '$GenericWireTypeSize' ] ,
17
+ $EmValType__deps : [ '_emval_decref' , '$Emval' , '$readPointer' ] ,
19
18
$EmValType : `{
20
19
name: 'emscripten::val',
21
20
'fromWireType': (handle) => {
@@ -24,7 +23,6 @@ var LibraryEmbind = {
24
23
return rv;
25
24
},
26
25
'toWireType': (destructors, value) => Emval.toHandle(value),
27
- argPackAdvance: GenericWireTypeSize,
28
26
'readValueFromPointer': readPointer,
29
27
destructorFunction: null, // This type does not need a destructor
30
28
@@ -199,11 +197,6 @@ var LibraryEmbind = {
199
197
$registerType__deps : [ '$sharedRegisterType' ] ,
200
198
$registerType__docs : '/** @param {Object=} options */' ,
201
199
$registerType : function ( rawType , registeredInstance , options = { } ) {
202
- #if ASSERTIONS
203
- if ( registeredInstance . argPackAdvance === undefined ) {
204
- throw new TypeError ( 'registerType registeredInstance requires argPackAdvance' ) ;
205
- }
206
- #endif
207
200
return sharedRegisterType ( rawType , registeredInstance , options ) ;
208
201
} ,
209
202
@@ -213,15 +206,14 @@ var LibraryEmbind = {
213
206
registerType ( rawType , {
214
207
isVoid : true , // void return values can be optimized out sometimes
215
208
name,
216
- argPackAdvance : 0 ,
217
209
'fromWireType' : ( ) => undefined ,
218
210
// TODO: assert if anything else is given?
219
211
'toWireType' : ( destructors , o ) => undefined ,
220
212
} ) ;
221
213
} ,
222
214
223
215
_embind_register_bool__docs : '/** @suppress {globalThis} */' ,
224
- _embind_register_bool__deps : [ '$AsciiToString' , '$registerType' , '$GenericWireTypeSize' ] ,
216
+ _embind_register_bool__deps : [ '$AsciiToString' , '$registerType' ] ,
225
217
_embind_register_bool : ( rawType , name , trueValue , falseValue ) => {
226
218
name = AsciiToString ( name ) ;
227
219
registerType ( rawType , {
@@ -234,7 +226,6 @@ var LibraryEmbind = {
234
226
'toWireType' : function ( destructors , o ) {
235
227
return o ? trueValue : falseValue ;
236
228
} ,
237
- argPackAdvance : GenericWireTypeSize ,
238
229
'readValueFromPointer' : function ( pointer ) {
239
230
return this [ 'fromWireType' ] ( HEAPU8 [ pointer ] ) ;
240
231
} ,
@@ -341,7 +332,6 @@ var LibraryEmbind = {
341
332
// https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue
342
333
return value ;
343
334
} ,
344
- argPackAdvance : GenericWireTypeSize ,
345
335
'readValueFromPointer' : integerReadValueFromPointer ( name , size , minRange !== 0 ) ,
346
336
destructorFunction : null , // This type does not need a destructor
347
337
} ) ;
@@ -393,7 +383,6 @@ var LibraryEmbind = {
393
383
#endif
394
384
return value ;
395
385
} ,
396
- argPackAdvance : GenericWireTypeSize ,
397
386
'readValueFromPointer' : integerReadValueFromPointer ( name , size , ! isUnsignedType ) ,
398
387
destructorFunction : null , // This type does not need a destructor
399
388
} ) ;
@@ -424,7 +413,6 @@ var LibraryEmbind = {
424
413
// https://www.w3.org/TR/wasm-js-api-1/#towebassemblyvalue
425
414
return value ;
426
415
} ,
427
- argPackAdvance : GenericWireTypeSize ,
428
416
'readValueFromPointer' : floatReadValueFromPointer ( name , size ) ,
429
417
destructorFunction : null , // This type does not need a destructor
430
418
} ) ;
@@ -514,7 +502,6 @@ var LibraryEmbind = {
514
502
}
515
503
return base ;
516
504
} ,
517
- argPackAdvance : GenericWireTypeSize ,
518
505
'readValueFromPointer' : readPointer ,
519
506
destructorFunction ( ptr ) {
520
507
_free( ptr ) ;
@@ -570,7 +557,6 @@ var LibraryEmbind = {
570
557
}
571
558
return ptr ;
572
559
} ,
573
- argPackAdvance : GenericWireTypeSize ,
574
560
'readValueFromPointer' : readPointer ,
575
561
destructorFunction ( ptr ) {
576
562
_free ( ptr ) ;
@@ -621,7 +607,6 @@ var LibraryEmbind = {
621
607
registerType ( rawType , {
622
608
name,
623
609
'fromWireType' : decodeMemoryView ,
624
- argPackAdvance : GenericWireTypeSize ,
625
610
'readValueFromPointer' : decodeMemoryView ,
626
611
} , {
627
612
ignoreDuplicateRegistrations : true ,
@@ -949,7 +934,6 @@ var LibraryEmbind = {
949
934
}
950
935
return ptr ;
951
936
} ,
952
- argPackAdvance : GenericWireTypeSize ,
953
937
'readValueFromPointer' : readPointer ,
954
938
destructorFunction : rawDestructor ,
955
939
} ] ;
@@ -1060,7 +1044,6 @@ var LibraryEmbind = {
1060
1044
}
1061
1045
return ptr ;
1062
1046
} ,
1063
- argPackAdvance : GenericWireTypeSize ,
1064
1047
'readValueFromPointer' : readPointer ,
1065
1048
destructorFunction : rawDestructor ,
1066
1049
} ] ;
@@ -1196,7 +1179,6 @@ var LibraryEmbind = {
1196
1179
'$RegisteredPointer' ,
1197
1180
'$readPointer' ,
1198
1181
'$RegisteredPointer_fromWireType' ,
1199
- '$GenericWireTypeSize' ,
1200
1182
] ,
1201
1183
$init_RegisteredPointer : ( ) = > {
1202
1184
Object . assign ( RegisteredPointer . prototype , {
@@ -1209,7 +1191,6 @@ var LibraryEmbind = {
1209
1191
destructor ( ptr ) {
1210
1192
this . rawDestructor ?. ( ptr ) ;
1211
1193
} ,
1212
- argPackAdvance : GenericWireTypeSize ,
1213
1194
'readValueFromPointer' : readPointer ,
1214
1195
'fromWireType' : RegisteredPointer_fromWireType ,
1215
1196
} ) ;
@@ -2233,7 +2214,6 @@ var LibraryEmbind = {
2233
2214
return this . constructor . values [ c ] ;
2234
2215
} ,
2235
2216
'toWireType' : ( destructors , c ) => c . value ,
2236
- argPackAdvance : GenericWireTypeSize ,
2237
2217
'readValueFromPointer' : enumReadValueFromPointer ( name , size , isSigned ) ,
2238
2218
destructorFunction : null ,
2239
2219
} ) ;
0 commit comments