1919// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2020// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
22- /* eslint-disable strict */
22+ 'use strict' ;
2323const common = require ( '../common' ) ;
24+
2425const assert = require ( 'assert' ) ;
2526const fs = require ( 'fs' ) ;
2627
2728fs . stat ( '.' , common . mustCall ( function ( err , stats ) {
2829 assert . ifError ( err ) ;
2930 assert . ok ( stats . mtime instanceof Date ) ;
30- assert . strictEqual ( this , global ) ;
31+ // Confirm that we are not running in the context of the internal binding
32+ // layer.
33+ // Ref: https://github.com/nodejs/node/commit/463d6bac8b349acc462d345a6e298a76f7d06fb1
34+ assert . strictEqual ( this , undefined ) ;
3135} ) ) ;
3236
3337fs . stat ( '.' , common . mustCall ( function ( err , stats ) {
@@ -38,22 +42,31 @@ fs.stat('.', common.mustCall(function(err, stats) {
3842fs . lstat ( '.' , common . mustCall ( function ( err , stats ) {
3943 assert . ifError ( err ) ;
4044 assert . ok ( stats . mtime instanceof Date ) ;
41- assert . strictEqual ( this , global ) ;
45+ // Confirm that we are not running in the context of the internal binding
46+ // layer.
47+ // Ref: https://github.com/nodejs/node/commit/463d6bac8b349acc462d345a6e298a76f7d06fb1
48+ assert . strictEqual ( this , undefined ) ;
4249} ) ) ;
4350
4451// fstat
4552fs . open ( '.' , 'r' , undefined , common . mustCall ( function ( err , fd ) {
46- assert . ok ( ! err ) ;
53+ assert . ifError ( err ) ;
4754 assert . ok ( fd ) ;
4855
4956 fs . fstat ( fd , common . mustCall ( function ( err , stats ) {
5057 assert . ifError ( err ) ;
5158 assert . ok ( stats . mtime instanceof Date ) ;
5259 fs . close ( fd , assert . ifError ) ;
53- assert . strictEqual ( this , global ) ;
60+ // Confirm that we are not running in the context of the internal binding
61+ // layer.
62+ // Ref: https://github.com/nodejs/node/commit/463d6bac8b349acc462d345a6e298a76f7d06fb1
63+ assert . strictEqual ( this , undefined ) ;
5464 } ) ) ;
5565
56- assert . strictEqual ( this , global ) ;
66+ // Confirm that we are not running in the context of the internal binding
67+ // layer.
68+ // Ref: https://github.com/nodejs/node/commit/463d6bac8b349acc462d345a6e298a76f7d06fb1
69+ assert . strictEqual ( this , null ) ;
5770} ) ) ;
5871
5972// fstatSync
@@ -72,13 +85,13 @@ fs.open('.', 'r', undefined, common.mustCall(function(err, fd) {
7285
7386fs . stat ( __filename , common . mustCall ( function ( err , s ) {
7487 assert . ifError ( err ) ;
75- assert . strictEqual ( false , s . isDirectory ( ) ) ;
76- assert . strictEqual ( true , s . isFile ( ) ) ;
77- assert . strictEqual ( false , s . isSocket ( ) ) ;
78- assert . strictEqual ( false , s . isBlockDevice ( ) ) ;
79- assert . strictEqual ( false , s . isCharacterDevice ( ) ) ;
80- assert . strictEqual ( false , s . isFIFO ( ) ) ;
81- assert . strictEqual ( false , s . isSymbolicLink ( ) ) ;
88+ assert . strictEqual ( s . isDirectory ( ) , false ) ;
89+ assert . strictEqual ( s . isFile ( ) , true ) ;
90+ assert . strictEqual ( s . isSocket ( ) , false ) ;
91+ assert . strictEqual ( s . isBlockDevice ( ) , false ) ;
92+ assert . strictEqual ( s . isCharacterDevice ( ) , false ) ;
93+ assert . strictEqual ( s . isFIFO ( ) , false ) ;
94+ assert . strictEqual ( s . isSymbolicLink ( ) , false ) ;
8295 const keys = [
8396 'dev' , 'mode' , 'nlink' , 'uid' ,
8497 'gid' , 'rdev' , 'ino' , 'size' ,
0 commit comments