Skip to content

Commit a431989

Browse files
committedDec 20, 2019
src: update for Node 13 compat
1 parent 735da93 commit a431989

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed
 

‎.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ language: node_js
66
before_install:
77
- export JOBS=max
88
node_js:
9-
- 6
10-
- 8
119
- 10
1210
- 12
11+
- lts/*
12+
- current
1313
notifications:
1414
email:
1515
- rod@vagg.org

‎bignum.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ using namespace std;
5555
Nan::ThrowTypeError("Argument " #I " must be a uint64"); \
5656
return; \
5757
} \
58-
uint64_t VAR = info[I]->ToInteger(info.GetIsolate()->GetCurrentContext()).ToLocalChecked()->Value();
58+
uint64_t VAR = Nan::To<v8::Integer>(info[I]).ToLocalChecked()->Value();
5959

6060
#define REQ_BOOL_ARG(I, VAR) \
6161
if (info.Length() <= (I) || !info[I]->IsBoolean()) { \
6262
Nan::ThrowTypeError("Argument " #I " must be a boolean"); \
6363
return; \
6464
} \
65-
bool VAR = info[I]->ToBoolean(info.GetIsolate()->GetCurrentContext()).ToLocalChecked()->Value();
65+
bool VAR = Nan::To<v8::Boolean>(info[I]).ToLocalChecked()->Value();
6666

6767
#define WRAP_RESULT(RES, VAR) \
6868
Local<Value> arg[1] = { Nan::New<External>(static_cast<BigNum*>(RES)) }; \
@@ -292,7 +292,7 @@ void BigNum::Initialize(v8::Local<v8::Object> target) {
292292
Nan::SetPrototypeMethod(tmpl, "isbitset", IsBitSet);
293293

294294
v8::Isolate *isolate = v8::Isolate::GetCurrent();
295-
target->Set(Nan::New("BigNum").ToLocalChecked(), tmpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked());
295+
Nan::Set(target, Nan::New("BigNum").ToLocalChecked(), tmpl->GetFunction(isolate->GetCurrentContext()).ToLocalChecked());
296296
}
297297

298298
BigNum::BigNum(const Nan::Utf8String& str, uint64_t base) : Nan::ObjectWrap (),
@@ -422,8 +422,8 @@ NAN_METHOD(BigNum::New)
422422
return;
423423
}
424424

425-
Nan::Utf8String str(obj->ToObject(currentContext).ToLocalChecked()->Get(Nan::New("num").ToLocalChecked())->ToString(currentContext).ToLocalChecked());
426-
base = Nan::To<int64_t>(obj->ToObject(currentContext).ToLocalChecked()->Get(Nan::New("base").ToLocalChecked())).FromJust();
425+
Nan::Utf8String str(Nan::Get(obj->ToObject(currentContext).ToLocalChecked(), Nan::New("num").ToLocalChecked()).ToLocalChecked()->ToString(currentContext).ToLocalChecked());
426+
base = Nan::To<int64_t>(Nan::Get(obj->ToObject(currentContext).ToLocalChecked(), Nan::New("base").ToLocalChecked()).ToLocalChecked()).FromJust();
427427

428428
bignum = new BigNum(str, base);
429429
}

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"dependencies": {
2525
"bindings": "~1.3.0",
26-
"nan": "~2.13.2",
26+
"nan": "^2.14.0",
2727
"prebuild-install": "~4.0.0",
2828
"safe-buffer": "~5.1.2"
2929
},

0 commit comments

Comments
 (0)
Please sign in to comment.