@@ -393,13 +393,12 @@ addToLibrary({
393
393
// Used to implement the native `abort` symbol. Note that we use the
394
394
// JavaScript `abort` helper in order to implement this function, but we use a
395
395
// distinct name here to avoid confusing the two.
396
- _abort_js : ( ) => {
396
+ _abort_js : ( ) =>
397
397
#if ASSERTIONS
398
- abort ( 'native code called abort()' ) ;
398
+ abort ( 'native code called abort()' ) ,
399
399
#else
400
- abort ( '' ) ;
400
+ abort ( '' ) ,
401
401
#endif
402
- } ,
403
402
#endif
404
403
405
404
// This object can be modified by the user during startup, which affects
@@ -443,9 +442,8 @@ addToLibrary({
443
442
// assert.h
444
443
// ==========================================================================
445
444
446
- __assert_fail : ( condition , filename , line , func ) = > {
447
- abort ( `Assertion failed: ${ UTF8ToString ( condition ) } , at: ` + [ filename ? UTF8ToString ( filename ) : 'unknown filename' , line , func ? UTF8ToString ( func ) : 'unknown function' ] ) ;
448
- } ,
445
+ __assert_fail : ( condition , filename , line , func ) = >
446
+ abort ( `Assertion failed: ${ UTF8ToString ( condition ) } , at: ` + [ filename ? UTF8ToString ( filename ) : 'unknown filename' , line , func ? UTF8ToString ( func ) : 'unknown function' ] ) ,
449
447
#endif
450
448
451
449
#if STACK_OVERFLOW_CHECK >= 2
@@ -662,9 +660,7 @@ addToLibrary({
662
660
$strError : ( errno ) => errno + '' ,
663
661
#else
664
662
$strError__deps : [ 'strerror' , '$UTF8ToString' ] ,
665
- $strError : ( errno ) => {
666
- return UTF8ToString ( _strerror ( errno ) ) ;
667
- } ,
663
+ $strError : ( errno ) => UTF8ToString ( _strerror ( errno ) ) ,
668
664
#endif
669
665
670
666
#if PROXY_POSIX_SOCKETS == 0
@@ -681,9 +677,8 @@ addToLibrary({
681
677
}
682
678
return ( b [ 0 ] | ( b [ 1 ] << 8 ) | ( b [ 2 ] << 16 ) | ( b [ 3 ] << 24 ) ) >>> 0 ;
683
679
} ,
684
- $inetNtop4 : ( addr ) => {
685
- return ( addr & 0xff ) + '.' + ( ( addr >> 8 ) & 0xff ) + '.' + ( ( addr >> 16 ) & 0xff ) + '.' + ( ( addr >> 24 ) & 0xff )
686
- } ,
680
+ $inetNtop4 : ( addr ) =>
681
+ ( addr & 0xff ) + '.' + ( ( addr >> 8 ) & 0xff ) + '.' + ( ( addr >> 16 ) & 0xff ) + '.' + ( ( addr >> 24 ) & 0xff ) ,
687
682
$inetPton6__deps : [ 'htons' , '$jstoi_q' ] ,
688
683
$inetPton6 : ( str ) => {
689
684
var words ;
@@ -1724,9 +1719,7 @@ addToLibrary({
1724
1719
return ___cxa_throw ( ex , 0 , 0 ) ;
1725
1720
} ,
1726
1721
1727
- _Unwind_DeleteException : ( ex ) => {
1728
- err ( 'TODO: Unwind_DeleteException' ) ;
1729
- } ,
1722
+ _Unwind_DeleteException : ( ex ) => err ( 'TODO: Unwind_DeleteException' ) ,
1730
1723
#endif
1731
1724
1732
1725
// special runtime support
@@ -1743,29 +1736,28 @@ addToLibrary({
1743
1736
} ,
1744
1737
#endif
1745
1738
1746
- $getExecutableName : ( ) = > {
1747
1739
#if MINIMAL_RUNTIME // MINIMAL_RUNTIME does not have a global runtime variable thisProgram
1740
+ $getExecutableName : ( ) = > {
1748
1741
#if ENVIRONMENT_MAY_BE_NODE
1749
1742
if ( ENVIRONMENT_IS_NODE && process . argv . length > 1 ) {
1750
1743
return process . argv [ 1 ] . replace ( / \\ / g, '/' ) ;
1751
1744
}
1752
1745
#endif
1753
1746
return "./this.program" ;
1747
+ } ,
1754
1748
#else
1755
- return thisProgram || './this.program' ;
1749
+ $getExecutableName : ( ) => thisProgram || './this.program' ,
1756
1750
#endif
1757
- } ,
1758
1751
1759
- $listenOnce : ( object , event , func ) => {
1752
+ $listenOnce : ( object , event , func ) =>
1760
1753
#if MIN_CHROME_VERSION < 55 || MIN_FIREFOX_VERSION < 50 // https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
1761
1754
object . addEventListener ( event , function handler ( ) {
1762
1755
func ( ) ;
1763
1756
object . removeEventListener ( event , handler ) ;
1764
- } ) ;
1757
+ } ) ,
1765
1758
#else
1766
- object . addEventListener ( event , func , { 'once' : true } ) ;
1759
+ object . addEventListener ( event , func , { 'once' : true } ) ,
1767
1760
#endif
1768
- } ,
1769
1761
1770
1762
// Receives a Web Audio context plus a set of elements to listen for user
1771
1763
// input events on, and registers a context resume() for them. This lets
@@ -1999,9 +1991,7 @@ addToLibrary({
1999
1991
// Use program_invocation_short_name and program_invocation_name in compiled
2000
1992
// programs. This function is for implementing them.
2001
1993
_emscripten_get_progname__deps : [ '$getExecutableName' , '$stringToUTF8' ] ,
2002
- _emscripten_get_progname : ( str , len ) = > {
2003
- stringToUTF8 ( getExecutableName ( ) , str , len ) ;
2004
- } ,
1994
+ _emscripten_get_progname : ( str , len ) = > stringToUTF8 ( getExecutableName ( ) , str , len ) ,
2005
1995
2006
1996
emscripten_console_log : ( str ) = > {
2007
1997
#if ASSERTIONS
0 commit comments