File tree 3 files changed +6
-53
lines changed
3 files changed +6
-53
lines changed Original file line number Diff line number Diff line change @@ -310,8 +310,6 @@ let knownGlobals = [
310
310
clearImmediate ,
311
311
clearInterval ,
312
312
clearTimeout ,
313
- console ,
314
- constructor , // Enumerable in V8 3.21.
315
313
global ,
316
314
process ,
317
315
setImmediate ,
@@ -341,29 +339,6 @@ if (global.COUNTER_NET_SERVER_CONNECTION) {
341
339
knownGlobals . push ( COUNTER_HTTP_CLIENT_RESPONSE ) ;
342
340
}
343
341
344
- if ( global . ArrayBuffer ) {
345
- knownGlobals . push ( ArrayBuffer ) ;
346
- knownGlobals . push ( Int8Array ) ;
347
- knownGlobals . push ( Uint8Array ) ;
348
- knownGlobals . push ( Uint8ClampedArray ) ;
349
- knownGlobals . push ( Int16Array ) ;
350
- knownGlobals . push ( Uint16Array ) ;
351
- knownGlobals . push ( Int32Array ) ;
352
- knownGlobals . push ( Uint32Array ) ;
353
- knownGlobals . push ( Float32Array ) ;
354
- knownGlobals . push ( Float64Array ) ;
355
- knownGlobals . push ( DataView ) ;
356
- }
357
-
358
- // Harmony features.
359
- if ( global . Proxy ) {
360
- knownGlobals . push ( Proxy ) ;
361
- }
362
-
363
- if ( global . Symbol ) {
364
- knownGlobals . push ( Symbol ) ;
365
- }
366
-
367
342
if ( process . env . NODE_TEST_KNOWN_GLOBALS ) {
368
343
const knownFromEnv = process . env . NODE_TEST_KNOWN_GLOBALS . split ( ',' ) ;
369
344
allowGlobals ( ...knownFromEnv ) ;
Original file line number Diff line number Diff line change @@ -8,8 +8,6 @@ let knownGlobals = [
8
8
clearImmediate ,
9
9
clearInterval ,
10
10
clearTimeout ,
11
- console ,
12
- constructor , // Enumerable in V8 3.21.
13
11
global ,
14
12
process ,
15
13
setImmediate ,
@@ -50,29 +48,6 @@ export function leakedGlobals() {
50
48
knownGlobals . push ( COUNTER_HTTP_CLIENT_RESPONSE ) ;
51
49
}
52
50
53
- if ( global . ArrayBuffer ) {
54
- knownGlobals . push ( ArrayBuffer ) ;
55
- knownGlobals . push ( Int8Array ) ;
56
- knownGlobals . push ( Uint8Array ) ;
57
- knownGlobals . push ( Uint8ClampedArray ) ;
58
- knownGlobals . push ( Int16Array ) ;
59
- knownGlobals . push ( Uint16Array ) ;
60
- knownGlobals . push ( Int32Array ) ;
61
- knownGlobals . push ( Uint32Array ) ;
62
- knownGlobals . push ( Float32Array ) ;
63
- knownGlobals . push ( Float64Array ) ;
64
- knownGlobals . push ( DataView ) ;
65
- }
66
-
67
- // Harmony features.
68
- if ( global . Proxy ) {
69
- knownGlobals . push ( Proxy ) ;
70
- }
71
-
72
- if ( global . Symbol ) {
73
- knownGlobals . push ( Symbol ) ;
74
- }
75
-
76
51
const leaked = [ ] ;
77
52
78
53
for ( const val in global ) {
Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
- // copy console accessor because requiring ../common touches it
2
+ // Copy console accessor because requiring ../common touches it
3
3
const consoleDescriptor = Object . getOwnPropertyDescriptor ( global , 'console' ) ;
4
- delete global . console ;
5
- global . console = { } ;
4
+ Object . defineProperty ( global , 'console' , {
5
+ configurable : true ,
6
+ writable : true ,
7
+ value : { }
8
+ } ) ;
6
9
7
10
require ( '../common' ) ;
8
11
You can’t perform that action at this time.
0 commit comments