13
13
14
14
// -- jshint doesn't understand library syntax, so we need to mark the symbols exposed here
15
15
/*global getStringOrSymbol, emval_handle_array, Emval, __emval_unregister, count_emval_handles, emval_symbols, emval_free_list, get_first_emval, __emval_decref, emval_newers*/
16
- /*global craftEmvalAllocator, __emval_addMethodCaller , emval_methodCallers, LibraryManager, mergeInto, __emval_allocateDestructors , global, __emval_lookupTypes , makeLegalFunctionName*/
16
+ /*global craftEmvalAllocator, emval_addMethodCaller , emval_methodCallers, LibraryManager, mergeInto, emval_allocateDestructors , global, emval_lookupTypes , makeLegalFunctionName*/
17
17
/*global emval_get_global*/
18
18
19
19
var LibraryEmVal = {
@@ -261,7 +261,7 @@ var LibraryEmVal = {
261
261
} ) ( ) ( 'return this' ) ( ) ;
262
262
} ,
263
263
#endif
264
- _emval_get_global__sig : 'ii ' ,
264
+ _emval_get_global__sig : 'pp ' ,
265
265
_emval_get_global__deps : [ '$Emval' , '$getStringOrSymbol' , '$emval_get_global' ] ,
266
266
_emval_get_global : function ( name ) {
267
267
if ( name === 0 ) {
@@ -279,7 +279,7 @@ var LibraryEmVal = {
279
279
return Emval . toHandle ( Module [ name ] ) ;
280
280
} ,
281
281
282
- _emval_get_property__sig : 'iii ' ,
282
+ _emval_get_property__sig : 'ppp ' ,
283
283
_emval_get_property__deps : [ '$Emval' ] ,
284
284
_emval_get_property : function ( handle , key ) {
285
285
handle = Emval . toValue ( handle ) ;
@@ -296,7 +296,7 @@ var LibraryEmVal = {
296
296
handle [ key ] = value ;
297
297
} ,
298
298
299
- _emval_as__sig : 'iiii ' ,
299
+ _emval_as__sig : 'dppp ' ,
300
300
_emval_as__deps : [ '$Emval' , '$requireRegisteredType' ] ,
301
301
_emval_as : function ( handle , returnType , destructorsRef ) {
302
302
handle = Emval . toValue ( handle ) ;
@@ -308,58 +308,65 @@ var LibraryEmVal = {
308
308
} ,
309
309
310
310
_emval_as_int64__deps : [ '$Emval' , '$requireRegisteredType' ] ,
311
+ _emval_as_int64__sig : 'dppp' ,
311
312
_emval_as_int64 : function ( handle , returnType , destructorsRef ) {
312
313
handle = Emval . toValue ( handle ) ;
313
314
returnType = requireRegisteredType ( returnType , 'emval::as' ) ;
314
315
return returnType [ 'toWireType' ] ( null , handle ) ;
315
316
} ,
316
317
317
318
_emval_as_uint64__deps : [ '$Emval' , '$requireRegisteredType' ] ,
319
+ _emval_as_uint64__sig : 'dppp' ,
318
320
_emval_as_uint64 : function ( handle , returnType , destructorsRef ) {
319
321
handle = Emval . toValue ( handle ) ;
320
322
returnType = requireRegisteredType ( returnType , 'emval::as' ) ;
321
323
return returnType [ 'toWireType' ] ( null , handle ) ;
322
324
} ,
323
325
324
326
_emval_equals__deps : [ '$Emval' ] ,
327
+ _emval_equals__sig : 'ipp' ,
325
328
_emval_equals : function ( first , second ) {
326
329
first = Emval . toValue ( first ) ;
327
330
second = Emval . toValue ( second ) ;
328
331
return first == second ;
329
332
} ,
330
333
331
334
_emval_strictly_equals__deps : [ '$Emval' ] ,
335
+ _emval_strictly_equals__sig : 'ipp' ,
332
336
_emval_strictly_equals : function ( first , second ) {
333
337
first = Emval . toValue ( first ) ;
334
338
second = Emval . toValue ( second ) ;
335
339
return first === second ;
336
340
} ,
337
341
338
342
_emval_greater_than__deps : [ '$Emval' ] ,
343
+ _emval_greater_than__sig : 'ipp' ,
339
344
_emval_greater_than : function ( first , second ) {
340
345
first = Emval . toValue ( first ) ;
341
346
second = Emval . toValue ( second ) ;
342
347
return first > second ;
343
348
} ,
344
349
345
350
_emval_less_than__deps : [ '$Emval' ] ,
351
+ _emval_less_than__sig : 'ipp' ,
346
352
_emval_less_than : function ( first , second ) {
347
353
first = Emval . toValue ( first ) ;
348
354
second = Emval . toValue ( second ) ;
349
355
return first < second ;
350
356
} ,
351
357
352
358
_emval_not__deps : [ '$Emval' ] ,
359
+ _emval_not__sig : 'ip' ,
353
360
_emval_not : function ( object ) {
354
361
object = Emval . toValue ( object ) ;
355
362
return ! object ;
356
363
} ,
357
364
358
- _emval_call__sig : 'iiiii ' ,
359
- _emval_call__deps : [ '_emval_lookupTypes ' , '$Emval' ] ,
365
+ _emval_call__sig : 'ppppp ' ,
366
+ _emval_call__deps : [ '$emval_lookupTypes ' , '$Emval' ] ,
360
367
_emval_call : function ( handle , argCount , argTypes , argv ) {
361
368
handle = Emval . toValue ( handle ) ;
362
- var types = __emval_lookupTypes ( argCount , argTypes ) ;
369
+ var types = emval_lookupTypes ( argCount , argTypes ) ;
363
370
364
371
var args = new Array ( argCount ) ;
365
372
for ( var i = 0 ; i < argCount ; ++ i ) {
@@ -372,18 +379,18 @@ var LibraryEmVal = {
372
379
return Emval . toHandle ( rv ) ;
373
380
} ,
374
381
375
- _emval_lookupTypes__deps : [ '$requireRegisteredType' ] ,
376
- _emval_lookupTypes : function ( argCount , argTypes ) {
382
+ $emval_lookupTypes__deps : [ '$requireRegisteredType' ] ,
383
+ $emval_lookupTypes : function ( argCount , argTypes ) {
377
384
var a = new Array ( argCount ) ;
378
385
for ( var i = 0 ; i < argCount ; ++ i ) {
379
- a [ i ] = requireRegisteredType ( HEAP32 [ ( argTypes >> 2 ) + i ] ,
386
+ a [ i ] = requireRegisteredType ( { { { makeGetValue ( ' argTypes' , 'i * POINTER_SIZE' , '*' ) } } } ,
380
387
"parameter " + i ) ;
381
388
}
382
389
return a ;
383
390
} ,
384
391
385
- _emval_allocateDestructors__deps : [ '$Emval' ] ,
386
- _emval_allocateDestructors : function ( destructorsRef ) {
392
+ $emval_allocateDestructors__deps : [ '$Emval' ] ,
393
+ $emval_allocateDestructors : function ( destructorsRef ) {
387
394
var destructors = [ ] ;
388
395
HEAP32 [ destructorsRef >> 2 ] = Emval . toHandle ( destructors ) ;
389
396
return destructors ;
@@ -393,18 +400,18 @@ var LibraryEmVal = {
393
400
// to have null be a valid method caller.
394
401
$emval_methodCallers : [ undefined ] ,
395
402
396
- _emval_addMethodCaller__deps : [ '$emval_methodCallers' ] ,
397
- _emval_addMethodCaller : function ( caller ) {
403
+ $emval_addMethodCaller__deps : [ '$emval_methodCallers' ] ,
404
+ $emval_addMethodCaller : function ( caller ) {
398
405
var id = emval_methodCallers . length ;
399
406
emval_methodCallers . push ( caller ) ;
400
407
return id ;
401
408
} ,
402
409
403
410
$emval_registeredMethods : [ ] ,
404
- _emval_get_method_caller__sig : 'iii ' ,
405
- _emval_get_method_caller__deps : [ '_emval_addMethodCaller ' , '_emval_lookupTypes ' , '$new_' , '$makeLegalFunctionName' , '$emval_registeredMethods' ] ,
411
+ _emval_get_method_caller__sig : 'ppp ' ,
412
+ _emval_get_method_caller__deps : [ '$emval_addMethodCaller ' , '$emval_lookupTypes ' , '$new_' , '$makeLegalFunctionName' , '$emval_registeredMethods' ] ,
406
413
_emval_get_method_caller : function ( argCount , argTypes ) {
407
- var types = __emval_lookupTypes ( argCount , argTypes ) ;
414
+ var types = emval_lookupTypes ( argCount , argTypes ) ;
408
415
var retType = types [ 0 ] ;
409
416
var signatureName = retType . name + "_$" + types . slice ( 1 ) . map ( function ( t ) { return t . name ; } ) . join ( "_" ) + "$" ;
410
417
var returnId = emval_registeredMethods [ signatureName ] ;
@@ -469,69 +476,76 @@ var LibraryEmVal = {
469
476
params . push ( functionBody ) ;
470
477
var invokerFunction = new_ ( Function , params ) . apply ( null , args ) ;
471
478
#endif
472
- returnId = __emval_addMethodCaller ( invokerFunction ) ;
479
+ returnId = emval_addMethodCaller ( invokerFunction ) ;
473
480
emval_registeredMethods [ signatureName ] = returnId ;
474
481
return returnId ;
475
482
} ,
476
483
477
- _emval_call_method__deps : [ '_emval_allocateDestructors' , '$getStringOrSymbol' , '$emval_methodCallers' , '$Emval' ] ,
484
+ _emval_call_method__deps : [ '$emval_allocateDestructors' , '$getStringOrSymbol' , '$emval_methodCallers' , '$Emval' ] ,
485
+ _emval_call_method__sig : 'dppppp' ,
478
486
_emval_call_method : function ( caller , handle , methodName , destructorsRef , args ) {
479
487
caller = emval_methodCallers [ caller ] ;
480
488
handle = Emval . toValue ( handle ) ;
481
489
methodName = getStringOrSymbol ( methodName ) ;
482
- return caller ( handle , methodName , __emval_allocateDestructors ( destructorsRef ) , args ) ;
490
+ return caller ( handle , methodName , emval_allocateDestructors ( destructorsRef ) , args ) ;
483
491
} ,
484
492
485
- _emval_call_void_method__sig : 'viiii ' ,
486
- _emval_call_void_method__deps : [ '_emval_allocateDestructors ' , '$getStringOrSymbol' , '$emval_methodCallers' , '$Emval' ] ,
493
+ _emval_call_void_method__sig : 'vpppp ' ,
494
+ _emval_call_void_method__deps : [ '$emval_allocateDestructors ' , '$getStringOrSymbol' , '$emval_methodCallers' , '$Emval' ] ,
487
495
_emval_call_void_method : function ( caller , handle , methodName , args ) {
488
496
caller = emval_methodCallers [ caller ] ;
489
497
handle = Emval . toValue ( handle ) ;
490
498
methodName = getStringOrSymbol ( methodName ) ;
491
499
caller ( handle , methodName , null , args ) ;
492
500
} ,
493
501
494
- _emval_typeof__sig : 'ii ' ,
502
+ _emval_typeof__sig : 'pp ' ,
495
503
_emval_typeof__deps : [ '$Emval' ] ,
496
504
_emval_typeof : function ( handle ) {
497
505
handle = Emval . toValue ( handle ) ;
498
506
return Emval . toHandle ( typeof handle ) ;
499
507
} ,
500
508
501
509
_emval_instanceof__deps : [ '$Emval' ] ,
510
+ _emval_instanceof__sig : 'ipp' ,
502
511
_emval_instanceof : function ( object , constructor ) {
503
512
object = Emval . toValue ( object ) ;
504
513
constructor = Emval . toValue ( constructor ) ;
505
514
return object instanceof constructor ;
506
515
} ,
507
516
508
517
_emval_is_number__deps : [ '$Emval' ] ,
518
+ _emval_is_number__sig : 'ip' ,
509
519
_emval_is_number : function ( handle ) {
510
520
handle = Emval . toValue ( handle ) ;
511
521
return typeof handle == 'number' ;
512
522
} ,
513
523
514
524
_emval_is_string__deps : [ '$Emval' ] ,
525
+ _emval_is_string__sig : 'ip' ,
515
526
_emval_is_string : function ( handle ) {
516
527
handle = Emval . toValue ( handle ) ;
517
528
return typeof handle == 'string' ;
518
529
} ,
519
530
520
531
_emval_in__deps : [ '$Emval' ] ,
532
+ _emval_in__sig : 'ipp' ,
521
533
_emval_in : function ( item , object ) {
522
534
item = Emval . toValue ( item ) ;
523
535
object = Emval . toValue ( object ) ;
524
536
return item in object ;
525
537
} ,
526
538
527
539
_emval_delete__deps : [ '$Emval' ] ,
540
+ _emval_delete__sig : 'ipp' ,
528
541
_emval_delete : function ( object , property ) {
529
542
object = Emval . toValue ( object ) ;
530
543
property = Emval . toValue ( property ) ;
531
544
return delete object [ property ] ;
532
545
} ,
533
546
534
547
_emval_throw__deps : [ '$Emval' ] ,
548
+ _emval_throw__sig : 'vp' ,
535
549
_emval_throw : function ( object ) {
536
550
object = Emval . toValue ( object ) ;
537
551
throw object ;
0 commit comments