Skip to content

Commit

Permalink
restore compatibility with node 0.10*
Browse files Browse the repository at this point in the history
Use Nan::To() in the necessary places.

Signed-off-by: John Levon <john.levon@joyent.com>
  • Loading branch information
John Levon committed May 19, 2020
1 parent 3125353 commit 6968864
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions fs-ext.cc
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ static NAN_METHOD(Flock) {
store_data_t* flock_data = new store_data_t();

flock_data->fs_op = FS_OP_FLOCK;
flock_data->fd = info[0].As<v8::Int32>()->Value();
flock_data->oper = info[1].As<v8::Int32>()->Value();
flock_data->fd = Nan::To<int32_t>(info[0]).FromJust();
flock_data->oper = Nan::To<int32_t>(info[1]).FromJust();

if (info[2]->IsFunction()) {
flock_data->cb = new Nan::Callback((Local<Function>) info[2].As<Function>());
Expand Down Expand Up @@ -398,10 +398,10 @@ static NAN_METHOD(Seek) {
return THROW_BAD_ARGS;
}

int fd = info[0].As<v8::Int32>()->Value();
int fd = Nan::To<int32_t>(info[0]).FromJust();
ASSERT_OFFSET(info[1]);
off_t offs = GET_OFFSET(info[1]);
int whence = info[2].As<v8::Int32>()->Value();
int whence = Nan::To<int32_t>(info[2]).FromJust();

if ( ! info[3]->IsFunction()) {
#ifdef _WIN32
Expand Down Expand Up @@ -440,9 +440,9 @@ static NAN_METHOD(Fcntl) {
return THROW_BAD_ARGS;
}

int fd = info[0].As<v8::Int32>()->Value();
int cmd = info[1].As<v8::Int32>()->Value();
int arg = info[2].As<v8::Int32>()->Value();
int fd = Nan::To<int32_t>(info[0]).FromJust();
int cmd = Nan::To<int32_t>(info[1]).FromJust();
int arg = Nan::To<int32_t>(info[2]).FromJust();

if ( ! info[3]->IsFunction()) {
int result = fcntl(fd, cmd, arg);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"flock",
"seek"
],
"version": "2.0.0",
"version": "2.0.1",
"homepage": "https://github.com/baudehlo/node-fs-ext/",
"repository": {
"type": "git",
Expand Down

0 comments on commit 6968864

Please sign in to comment.