File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 99const { isBrowser} = require ( '../common' ) ;
1010const assert = require ( '../../assert' ) ;
1111
12+ const isNode14 = process . versions . node . indexOf ( '.' ) > 1 && process . versions . node . slice ( 0 , 2 ) >= 14 ;
13+
1214// Disable colored output to prevent color codes from breaking assertion
1315// message comparisons. This should only be an issue when process.stdout
1416// is a TTY.
1517if ( process . stdout && process . stdout . isTTY )
1618 process . env . NODE_DISABLE_COLORS = '1' ;
1719
1820// Turn off no-restricted-properties because we are testing deepEqual!
19- /* eslint-disable no-restricted-properties */
21+
2022
2123// See https://github.com/nodejs/node/issues/10258
2224{
@@ -46,7 +48,7 @@ if (process.stdout && process.stdout.isTTY)
4648 ) ;
4749}
4850
49- if ( ! isBrowser ) { // At the moment global has its own type tag
51+ if ( ! isBrowser && isNode14 ) { // At the moment global has its own type tag
5052 const fakeGlobal = { } ;
5153 Object . setPrototypeOf ( fakeGlobal , Object . getPrototypeOf ( global ) ) ;
5254 Object . keys ( global ) . forEach ( prop => {
@@ -59,7 +61,7 @@ if (!isBrowser) { // At the moment global has its own type tag
5961}
6062
6163
62- if ( ! isBrowser ) { // At the moment process has its own type tag
64+ if ( ! isBrowser && isNode14 ) { // At the moment process has its own type tag
6365 const fakeProcess = { } ;
6466 Object . setPrototypeOf ( fakeProcess , Object . getPrototypeOf ( process ) ) ;
6567 Object . keys ( process ) . forEach ( prop => {
You can’t perform that action at this time.
0 commit comments