fs: return blksize on stats object
Oversight to not pass blksize to fs.Stats on initialization. Also added a test to make sure the object property has been set. Since now on Windows both blksize and blocks will simply be set to undefined.
This commit is contained in:
parent
940974ed03
commit
c7f424e44b
@ -125,6 +125,7 @@ fs.Stats = function(
|
||||
uid,
|
||||
gid,
|
||||
rdev,
|
||||
blksize,
|
||||
ino,
|
||||
size,
|
||||
blocks,
|
||||
@ -138,6 +139,7 @@ fs.Stats = function(
|
||||
this.uid = uid;
|
||||
this.gid = gid;
|
||||
this.rdev = rdev;
|
||||
this.blksize = blksize;
|
||||
this.ino = ino;
|
||||
this.size = size;
|
||||
this.blocks = blocks;
|
||||
|
@ -400,6 +400,7 @@ Local<Value> BuildStatsObject(Environment* env, const uv_stat_t* s) {
|
||||
uid,
|
||||
gid,
|
||||
rdev,
|
||||
blksize,
|
||||
ino,
|
||||
size,
|
||||
blocks,
|
||||
|
@ -36,6 +36,11 @@ fs.stat('.', function(err, stats) {
|
||||
assert(this === global);
|
||||
});
|
||||
|
||||
fs.stat('.', function(err, stats) {
|
||||
assert.ok(stats.hasOwnProperty('blksize'));
|
||||
assert.ok(stats.hasOwnProperty('blocks'));
|
||||
});
|
||||
|
||||
fs.lstat('.', function(err, stats) {
|
||||
if (err) {
|
||||
got_error = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user