Skip to content

Commit

Permalink
test: remove usage of deprecated V8 APIs in addons
Browse files Browse the repository at this point in the history
PR-URL: nodejs#22704
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
targos committed Sep 7, 2018
1 parent 1a57ad2 commit 8518548
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/addons/async-hello-world/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
async_req* req = new async_req;
req->req.data = req;

req->input = args[0]->IntegerValue();
req->input = args[0].As<v8::Integer>()->Value();
req->output = 0;
req->isolate = isolate;
req->context = node::EmitAsyncInit(isolate, v8::Object::New(isolate), "test");
Expand Down
6 changes: 3 additions & 3 deletions test/addons/buffer-free-callback/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ void Alloc(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
alive++;

uintptr_t alignment = args[1]->IntegerValue();
uintptr_t offset = args[2]->IntegerValue();
uintptr_t alignment = args[1].As<v8::Integer>()->Value();
uintptr_t offset = args[2].As<v8::Integer>()->Value();

uintptr_t static_offset = reinterpret_cast<uintptr_t>(buf) % alignment;
char* aligned = buf + (alignment - static_offset) + offset;

args.GetReturnValue().Set(node::Buffer::New(
isolate,
aligned,
args[0]->IntegerValue(),
args[0].As<v8::Integer>()->Value(),
FreeCallback,
nullptr).ToLocalChecked());
}
Expand Down
2 changes: 1 addition & 1 deletion test/addons/stringbytes-external-exceed-max/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

void EnsureAllocation(const v8::FunctionCallbackInfo<v8::Value> &args) {
v8::Isolate* isolate = args.GetIsolate();
uintptr_t size = args[0]->IntegerValue();
uintptr_t size = args[0].As<v8::Integer>()->Value();
v8::Local<v8::Boolean> success;

void* buffer = malloc(size);
Expand Down

0 comments on commit 8518548

Please sign in to comment.