diff --git a/src/node_file.cc b/src/node_file.cc index af3ebdb1214816..255a7da4f36aa0 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -438,47 +438,26 @@ Local BuildStatsObject(Environment* env, const uv_stat_t* s) { // We need to check the return value of Number::New() and Date::New() // and make sure that we bail out when V8 returns an empty handle. - // Unsigned integers. It does not actually seem to be specified whether - // uid and gid are unsigned or not, but in practice they are unsigned, - // and Node’s (F)Chown functions do check their arguments for unsignedness. + // Numbers. #define X(name) \ - Local name = Integer::NewFromUnsigned(env->isolate(), s->st_##name); \ + Local name = Number::New(env->isolate(), \ + static_cast(s->st_##name)); \ if (name.IsEmpty()) \ return Local(); \ X(uid) X(gid) -# if defined(__POSIX__) - X(blksize) -# else - Local blksize = Undefined(env->isolate()); -# endif -#undef X - - // Integers. -#define X(name) \ - Local name = Integer::New(env->isolate(), s->st_##name); \ - if (name.IsEmpty()) \ - return Local(); \ - + X(ino) + X(size) X(dev) X(mode) X(nlink) X(rdev) -#undef X - - // Numbers. -#define X(name) \ - Local name = Number::New(env->isolate(), \ - static_cast(s->st_##name)); \ - if (name.IsEmpty()) \ - return Local(); \ - - X(ino) - X(size) # if defined(__POSIX__) + X(blksize) X(blocks) # else + Local blksize = Undefined(env->isolate()); Local blocks = Undefined(env->isolate()); # endif #undef X