diff options
author | Joyee Cheung <joyeec9h3@gmail.com> | 2018-03-31 04:02:57 +0800 |
---|---|---|
committer | Joyee Cheung <joyeec9h3@gmail.com> | 2018-04-04 15:25:59 +0800 |
commit | f7049a20068dc8a7e904b7cdd3d5b307b595dd3a (patch) | |
tree | 2feea6b9e576299d541c2c57196ffc96399c2027 /src/env.cc | |
parent | 30fe55e248087664e91928794ef281fbf2ba8c8d (diff) | |
download | android-node-v8-f7049a20068dc8a7e904b7cdd3d5b307b595dd3a.tar.gz android-node-v8-f7049a20068dc8a7e904b7cdd3d5b307b595dd3a.tar.bz2 android-node-v8-f7049a20068dc8a7e904b7cdd3d5b307b595dd3a.zip |
fs: refactor stats array to be more generic
- Pass kFsStatsFieldsLength between JS and C++ instead of using the
magic number 14
- Pass the global stats array to the completion callback of
asynchronous FSReqWrap similar to how the stats arrays are passed
to the FSReqPromise resolvers
- Abstract the stats converter and take an offset to compute the
old stats in fs.watchFile
- Use templates in node::FillStatsArray and FSReqPromise in preparation
for BigInt intergration
- Put the global stat array filler in node_internals.h because it is
shared by node_file.cc and node_stat_watcher.cc
PR-URL: https://github.com/nodejs/node/pull/19714
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r-- | src/env.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/env.cc b/src/env.cc index 16a24260f6..4be70036e3 100644 --- a/src/env.cc +++ b/src/env.cc @@ -104,7 +104,7 @@ Environment::Environment(IsolateData* isolate_data, #endif handle_cleanup_waiting_(0), http_parser_buffer_(nullptr), - fs_stats_field_array_(isolate_, kFsStatsFieldsLength), + fs_stats_field_array_(isolate_, kFsStatsFieldsLength * 2), context_(context->GetIsolate(), context) { // We'll be creating new objects so make sure we've entered the context. v8::HandleScope handle_scope(isolate()); |