diff --git a/package.json b/package.json index 503e10b..513430d 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "byte", "64" ], - "version": "1.3.5", + "version": "2.0.0", "license": "MIT", "author": "Nathan Rajlich (http://tootallnate.net)", "repository": { @@ -27,7 +27,7 @@ "main": "./lib/ref.js", "scripts": { "docs": "node docs/compile", - "test": "mocha -gc --reporter spec --use_strict" + "test": "mocha --gc-global --expose-gc --reporter spec --use_strict" }, "dependencies": { "bindings": "1", @@ -36,10 +36,10 @@ }, "devDependencies": { "dox": "0.9.0", - "highlight.js": "1", + "highlight.js": "9", "jade": "1", - "marked": "0.5.2", + "marked": "0.6.2", "mocha": "*", - "weak": "1" + "weak": "github:lxe/node-weak#node-12" } } diff --git a/src/binding.cc b/src/binding.cc index 7075be1..35d62cf 100644 --- a/src/binding.cc +++ b/src/binding.cc @@ -219,7 +219,7 @@ NAN_METHOD(WriteObject) { Nan::Persistent* pptr = reinterpret_cast*>(ptr); Local val = info[2].As(); - bool persistent = info[3]->BooleanValue(); + bool persistent = info[3]->BooleanValue(v8::Isolate::GetCurrent()->GetCurrentContext()).ToChecked(); if (persistent) { (*pptr).Reset(val); } else { @@ -250,7 +250,7 @@ NAN_METHOD(ReadPointer) { int64_t offset = GetInt64(info[1]); char *ptr = Buffer::Data(buf.As()) + offset; - size_t size = info[2]->Uint32Value(); + size_t size = info[2]->Uint32Value(v8::Isolate::GetCurrent()->GetCurrentContext()).ToChecked(); if (ptr == NULL) { return Nan::ThrowError("readPointer: Cannot read from NULL pointer"); @@ -357,7 +357,7 @@ NAN_METHOD(WriteInt64) { } else if (in->IsString()) { char *endptr, *str; int base = 0; - String::Utf8Value _str(in); + String::Utf8Value _str(v8::Isolate::GetCurrent(), in); str = *_str; errno = 0; /* To distinguish success/failure after call */ @@ -444,7 +444,7 @@ NAN_METHOD(WriteUInt64) { } else if (in->IsString()) { char *endptr, *str; int base = 0; - String::Utf8Value _str(in); + String::Utf8Value _str(v8::Isolate::GetCurrent(), in); str = *_str; errno = 0; /* To distinguish success/failure after call */ @@ -518,7 +518,7 @@ NAN_METHOD(ReinterpretBuffer) { return Nan::ThrowError("reinterpret: Cannot reinterpret from NULL pointer"); } - size_t size = info[1]->Uint32Value(); + size_t size = info[1]->Uint32Value(v8::Isolate::GetCurrent()->GetCurrentContext()).ToChecked(); info.GetReturnValue().Set(WrapPointer(ptr, size)); } @@ -547,7 +547,7 @@ NAN_METHOD(ReinterpretBufferUntilZeros) { return Nan::ThrowError("reinterpretUntilZeros: Cannot reinterpret from NULL pointer"); } - uint32_t numZeros = info[1]->Uint32Value(); + uint32_t numZeros = info[1]->Uint32Value(v8::Isolate::GetCurrent()->GetCurrentContext()).ToChecked(); uint32_t i = 0; size_t size = 0; bool end = false;