@@ -764,7 +764,10 @@ addToLibrary({
764764 var v4part = '' ;
765765 // check if the 10 high-order bytes are all zeros (first 5 words)
766766 for ( i = 0 ; i < 5 ; i ++ ) {
767- if ( parts [ i ] !== 0 ) { hasipv4 = false ; break ; }
767+ if ( parts [ i ] ) {
768+ hasipv4 = false ;
769+ break ;
770+ }
768771 }
769772
770773 if ( hasipv4 ) {
@@ -777,7 +780,7 @@ addToLibrary({
777780 return str ;
778781 }
779782 // IPv4-compatible IPv6 address if 16-bit value (bytes 11 and 12) == 0x0000 (6th word)
780- if ( parts [ 5 ] === 0 ) {
783+ if ( ! parts [ 5 ] ) {
781784 str = '::' ;
782785 // special case IPv6 addresses
783786 if ( v4part === '0.0.0.0' ) v4part = '' ; // any/unspecified address
@@ -791,7 +794,7 @@ addToLibrary({
791794
792795 // first run to find the longest contiguous zero words
793796 for ( word = 0 ; word < 8 ; word ++ ) {
794- if ( parts [ word ] === 0 ) {
797+ if ( ! parts [ word ] ) {
795798 if ( word - lastzero > 1 ) {
796799 len = 0 ;
797800 }
@@ -807,10 +810,10 @@ addToLibrary({
807810 for ( word = 0 ; word < 8 ; word ++ ) {
808811 if ( longest > 1 ) {
809812 // compress contiguous zeros - to produce '::'
810- if ( parts [ word ] === 0 && word >= zstart && word < ( zstart + longest ) ) {
813+ if ( ! parts [ word ] && word >= zstart && word < ( zstart + longest ) ) {
811814 if ( word === zstart ) {
812815 str += ':' ;
813- if ( zstart === 0 ) str += ':' ; //leading zeros case
816+ if ( ! zstart ) str += ':' ; //leading zeros case
814817 }
815818 continue ;
816819 }
@@ -844,7 +847,7 @@ addToLibrary({
844847 var pathLen = salen - { { { C_STRUCTS . sockaddr_un . sun_path } } } ;
845848 var path = '';
846849 if ( pathLen > 0 ) {
847- if ( HEAPU8 [ pathStart ] === 0 ) {
850+ if ( ! HEAPU8 [ pathStart ] ) {
848851 path = '\0' + UTF8ToString ( pathStart + 1 , pathLen - 1 , /*ignoreNul=*/ true ) ;
849852 } else {
850853 // A pathname address is NUL-terminated; stop at the first NUL.
@@ -894,7 +897,7 @@ addToLibrary({
894897 // terminator), any other path is written NUL-terminated. An empty path
895898 // is the unnamed address (family only).
896899 addr ||= '';
897- var abstract = addr . charCodeAt ( 0 ) === 0 ;
900+ var abstract = ! addr . charCodeAt ( 0 ) ;
898901 // Pathname addresses include the trailing NUL in the reported length;
899902 // abstract addresses do not; an empty address is family-only (unnamed).
900903 var bytes = addr ? lengthBytesUTF8 ( addr ) + ( abstract ? 0 : 1 ) : 0 ;
@@ -1067,10 +1070,10 @@ addToLibrary({
10671070
10681071 // If type or proto are set to zero in hints we should really be returning multiple addrinfo values, but for
10691072 // now default to a TCP STREAM socket so we can at least return a sensible addrinfo given NULL hints.
1070- if ( proto === 0 ) {
1073+ if ( ! proto ) {
10711074 proto = { { { cDefs . IPPROTO_TCP } } } ;
10721075 }
1073- if ( type === 0 ) {
1076+ if ( ! type ) {
10741077 type = { { { cDefs . SOCK_STREAM } } } ;
10751078 }
10761079
@@ -1081,14 +1084,14 @@ addToLibrary({
10811084 { { { cDefs . AI_NUMERICSERV } } } | { { { cDefs . AI_V4MAPPED } } } | { { { cDefs . AI_ALL } } } | { { { cDefs . AI_ADDRCONFIG } } } ) ) {
10821085 return { { { cDefs . EAI_BADFLAGS } } } ;
10831086 }
1084- if ( hint !== 0 && ( { { { makeGetValue ( 'hint' , C_STRUCTS . addrinfo . ai_flags , 'i32' ) } } } & { { { cDefs . AI_CANONNAME } } } ) && ! node ) {
1087+ if ( hint && ( { { { makeGetValue ( 'hint' , C_STRUCTS . addrinfo . ai_flags , 'i32' ) } } } & { { { cDefs . AI_CANONNAME } } } ) && ! node ) {
10851088 return { { { cDefs . EAI_BADFLAGS } } } ;
10861089 }
10871090 if ( flags & { { { cDefs . AI_ADDRCONFIG } } } ) {
10881091 // TODO
10891092 return { { { cDefs . EAI_NONAME } } } ;
10901093 }
1091- if ( type !== 0 && type !== { { { cDefs . SOCK_STREAM } } } && type !== { { { cDefs . SOCK_DGRAM } } } ) {
1094+ if ( type && type !== { { { cDefs . SOCK_STREAM } } } && type !== { { { cDefs . SOCK_DGRAM } } } ) {
10921095 return { { { cDefs . EAI_SOCKTYPE } } } ;
10931096 }
10941097 if ( family !== { { { cDefs . AF_UNSPEC } } } && family !== { { { cDefs . AF_INET } } } && family !== { { { cDefs . AF_INET6 } } } ) {
@@ -1113,7 +1116,7 @@ addToLibrary({
11131116 if ( family === { { { cDefs . AF_UNSPEC } } } ) {
11141117 family = { { { cDefs . AF_INET } } } ;
11151118 }
1116- if ( ( flags & { { { cDefs . AI_PASSIVE } } } ) === 0 ) {
1119+ if ( ! ( flags & { { { cDefs . AI_PASSIVE } } } ) ) {
11171120 if ( family === { { { cDefs . AF_INET } } } ) {
11181121 addr = _htonl ( { { { cDefs . INADDR_LOOPBACK } } } ) ;
11191122 } else {
@@ -1263,7 +1266,7 @@ addToLibrary({
12631266 // to add extra entries from /etc/protocols if desired - though not sure if that'd actually be useful.
12641267 var list = Protocols . list ;
12651268 var map = Protocols . map ;
1266- if ( list . length === 0 ) {
1269+ if ( ! list . length ) {
12671270 var entry = allocprotoent ( 'tcp' , 6 , [ 'TCP' ] ) ;
12681271 list . push ( entry ) ;
12691272 map [ 'tcp' ] = map [ '6' ] = entry ;
@@ -1739,7 +1742,7 @@ addToLibrary({
17391742 var parts = trace . split ( '\n' ) ;
17401743 for ( var i = 0 ; i < parts . length ; i ++ ) {
17411744 var ret = { { { makeDynCall ( 'iii' , 'func' ) } } } ( 0 , arg ) ;
1742- if ( ret !== 0 ) return ;
1745+ if ( ret ) return ;
17431746 }
17441747 } ,
17451748
@@ -2364,7 +2367,7 @@ addToLibrary({
23642367 assert ( id , 'addRunDependency requires an ID' )
23652368 assert ( ! runDependencyTracking [ id ] ) ;
23662369 runDependencyTracking [ id ] = 1 ;
2367- if ( runDependencyWatcher === null && globalThis . setInterval ) {
2370+ if ( ! runDependencyWatcher && globalThis . setInterval ) {
23682371 // Check for missing dependencies every few seconds
23692372 runDependencyWatcher = setInterval ( ( ) => {
23702373 if ( ABORT ) {
0 commit comments