File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -135,11 +135,16 @@ LibraryJSEventLoop = {
135
135
{ { { runtimeKeepalivePop ( ) } } }
136
136
callUserCallback ( ( ) => {
137
137
if ( { { { makeDynCall ( 'idp' , 'cb' ) } } } ( t , userData ) ) {
138
+ { { { runtimeKeepalivePush ( ) } } }
138
139
// Save a little bit of code space: modern browsers should treat
139
140
// negative setTimeout as timeout of 0
140
141
// (https://stackoverflow.com/questions/8430966/is-calling-settimeout-with-a-negative-delay-ok)
141
- { { { runtimeKeepalivePush ( ) } } }
142
- setTimeout ( tick , n - _emscripten_get_now ( ) ) ;
142
+ var remaining = n - _emscripten_get_now ( ) ;
143
+ #if ENVIRONMENT_MAY_BE_NODE
144
+ // Recent revsions of node, however, give TimeoutNegativeWarning
145
+ remaining = Math . max ( 0 , remaining ) ;
146
+ #endif
147
+ setTimeout ( tick , remaining ) ;
143
148
}
144
149
} ) ;
145
150
}
You can’t perform that action at this time.
0 commit comments