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:
Trevor Norris 2014-04-14 16:35:33 -07:00
parent 940974ed03
commit c7f424e44b
3 changed files with 8 additions and 0 deletions

View File

@ -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;

View File

@ -400,6 +400,7 @@ Local<Value> BuildStatsObject(Environment* env, const uv_stat_t* s) {
uid,
gid,
rdev,
blksize,
ino,
size,
blocks,

View File

@ -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;