Skip to content

Commit 13b8011

Browse files
committed
test: remove usage of deprecated V8 APIs in addons
PR-URL: #22704 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent e85aa19 commit 13b8011

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

test/addons/async-hello-world/binding.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void Method(const v8::FunctionCallbackInfo<v8::Value>& args) {
7373
async_req* req = new async_req;
7474
req->req.data = req;
7575

76-
req->input = args[0]->IntegerValue();
76+
req->input = args[0].As<v8::Integer>()->Value();
7777
req->output = 0;
7878
req->isolate = isolate;
7979
req->context = node::EmitAsyncInit(isolate, v8::Object::New(isolate), "test");

test/addons/buffer-free-callback/binding.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ void Alloc(const v8::FunctionCallbackInfo<v8::Value>& args) {
1515
v8::Isolate* isolate = args.GetIsolate();
1616
alive++;
1717

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

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

2424
args.GetReturnValue().Set(node::Buffer::New(
2525
isolate,
2626
aligned,
27-
args[0]->IntegerValue(),
27+
args[0].As<v8::Integer>()->Value(),
2828
FreeCallback,
2929
nullptr).ToLocalChecked());
3030
}

test/addons/stringbytes-external-exceed-max/binding.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

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

1010
void* buffer = malloc(size);

0 commit comments

Comments
 (0)