mirror of https://github.com/nodejs/node.git
test: remove usage of deprecated V8 APIs in addons
PR-URL: https://github.com/nodejs/node/pull/22704 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>pull/22450/head
parent
1a57ad22d6
commit
8518548a79
|
@ -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");
|
||||
|
|
|
@ -15,8 +15,8 @@ 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;
|
||||
|
@ -24,7 +24,7 @@ void Alloc(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
|||
args.GetReturnValue().Set(node::Buffer::New(
|
||||
isolate,
|
||||
aligned,
|
||||
args[0]->IntegerValue(),
|
||||
args[0].As<v8::Integer>()->Value(),
|
||||
FreeCallback,
|
||||
nullptr).ToLocalChecked());
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue