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 9
9
const { isBrowser} = require ( '../common' ) ;
10
10
const assert = require ( '../../assert' ) ;
11
11
12
+ const isNode14 = process . versions . node . indexOf ( '.' ) > 1 && process . versions . node . slice ( 0 , 2 ) >= 14 ;
13
+
12
14
// Disable colored output to prevent color codes from breaking assertion
13
15
// message comparisons. This should only be an issue when process.stdout
14
16
// is a TTY.
15
17
if ( process . stdout && process . stdout . isTTY )
16
18
process . env . NODE_DISABLE_COLORS = '1' ;
17
19
18
20
// Turn off no-restricted-properties because we are testing deepEqual!
19
- /* eslint-disable no-restricted-properties */
21
+
20
22
21
23
// See https://github.com/nodejs/node/issues/10258
22
24
{
@@ -46,7 +48,7 @@ if (process.stdout && process.stdout.isTTY)
46
48
) ;
47
49
}
48
50
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
50
52
const fakeGlobal = { } ;
51
53
Object . setPrototypeOf ( fakeGlobal , Object . getPrototypeOf ( global ) ) ;
52
54
Object . keys ( global ) . forEach ( prop => {
@@ -59,7 +61,7 @@ if (!isBrowser) { // At the moment global has its own type tag
59
61
}
60
62
61
63
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
63
65
const fakeProcess = { } ;
64
66
Object . setPrototypeOf ( fakeProcess , Object . getPrototypeOf ( process ) ) ;
65
67
Object . keys ( process ) . forEach ( prop => {
You can’t perform that action at this time.
0 commit comments