File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ let warn = true;
7777
7878Object . defineProperty ( fs , 'promises' , {
7979 configurable : true ,
80- enumerable : true ,
80+ enumerable : false ,
8181 get ( ) {
8282 if ( warn ) {
8383 warn = false ;
Original file line number Diff line number Diff line change @@ -5,7 +5,8 @@ const assert = require('assert');
55const tmpdir = require ( '../common/tmpdir' ) ;
66const fixtures = require ( '../common/fixtures' ) ;
77const path = require ( 'path' ) ;
8- const fsPromises = require ( 'fs' ) . promises ;
8+ const fs = require ( 'fs' ) ;
9+ const fsPromises = fs . promises ;
910const {
1011 access,
1112 chmod,
@@ -38,6 +39,10 @@ const tmpDir = tmpdir.path;
3839
3940common . crashOnUnhandledRejection ( ) ;
4041
42+ // fs.promises should not be enumerable as long as it causes a warning to be
43+ // emitted.
44+ assert . strictEqual ( Object . keys ( fs ) . includes ( 'promises' ) , false ) ;
45+
4146{
4247 access ( __filename , 'r' )
4348 . then ( common . mustCall ( ) )
You can’t perform that action at this time.
0 commit comments