File tree Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Expand file tree Collapse file tree 3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 2626 setupProcessICUVersions ( ) ;
2727
2828 setupGlobalVariables ( ) ;
29- if ( ! process . _noBrowserGlobals ) {
29+ const browserGlobals = ! process . _noBrowserGlobals ;
30+ if ( browserGlobals ) {
3031 setupGlobalTimeouts ( ) ;
3132 setupGlobalConsole ( ) ;
3233 }
4041 NativeModule . require ( 'internal/process/warning' ) . setup ( ) ;
4142 NativeModule . require ( 'internal/process/next_tick' ) . setup ( ) ;
4243 NativeModule . require ( 'internal/process/stdio' ) . setup ( ) ;
44+ if ( browserGlobals ) {
45+ // Instantiate eagerly in case the first call is under stack overflow
46+ // conditions where instantiation doesn't work.
47+ const console = global . console ;
48+ console . assert ;
49+ console . clear ;
50+ console . count ;
51+ console . countReset ;
52+ console . dir ;
53+ console . error ;
54+ console . log ;
55+ console . time ;
56+ console . timeEnd ;
57+ console . trace ;
58+ console . warn ;
59+ }
4360 _process . setupKillAndExit ( ) ;
4461 _process . setupSignalHandlers ( ) ;
4562 if ( global . __coverage__ )
Original file line number Diff line number Diff line change 1+ // Flags: --stack_trace_limit=3
2+
3+ 'use strict' ;
4+ require ( '../common' ) ;
5+
6+ async function f ( ) {
7+ await f ( ) ;
8+ }
9+
10+ async function g ( ) {
11+ try {
12+ await f ( ) ;
13+ } catch ( e ) {
14+ console . log ( e ) ;
15+ }
16+ }
17+
18+ g ( ) ;
Original file line number Diff line number Diff line change 1+ RangeError: Maximum call stack size exceeded
2+ at f (*test*message*stack_overflow_async.js:*)
3+ at f (*test*message*stack_overflow_async.js:7:*)
4+ at f (*test*message*stack_overflow_async.js:7:*)
You can’t perform that action at this time.
0 commit comments