Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: remove usage of deprecated V8 APIs in addons #22704

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/addons/async-hello-world/binding.cc
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
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
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