File tree 3 files changed +40
-1
lines changed
3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 26
26
setupProcessICUVersions ( ) ;
27
27
28
28
setupGlobalVariables ( ) ;
29
- if ( ! process . _noBrowserGlobals ) {
29
+ const browserGlobals = ! process . _noBrowserGlobals ;
30
+ if ( browserGlobals ) {
30
31
setupGlobalTimeouts ( ) ;
31
32
setupGlobalConsole ( ) ;
32
33
}
40
41
NativeModule . require ( 'internal/process/warning' ) . setup ( ) ;
41
42
NativeModule . require ( 'internal/process/next_tick' ) . setup ( ) ;
42
43
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
+ }
43
60
_process . setupKillAndExit ( ) ;
44
61
_process . setupSignalHandlers ( ) ;
45
62
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