src: replace new Array creation
PR-URL: https://github.com/nodejs/node/pull/24601 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Shingo Inoue <leko.noor@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
parent
519923fbf9
commit
d564347989
@ -50,11 +50,12 @@ void SetupNextTick(const FunctionCallbackInfo<Value>& args) {
|
||||
.ToLocalChecked();
|
||||
run_microtasks_fn->SetName(FIXED_ONE_BYTE_STRING(isolate, "runMicrotasks"));
|
||||
|
||||
Local<Array> ret = Array::New(isolate, 2);
|
||||
ret->Set(context, 0, env->tick_info()->fields().GetJSArray()).FromJust();
|
||||
ret->Set(context, 1, run_microtasks_fn).FromJust();
|
||||
Local<Value> ret[] = {
|
||||
env->tick_info()->fields().GetJSArray(),
|
||||
run_microtasks_fn
|
||||
};
|
||||
|
||||
args.GetReturnValue().Set(ret);
|
||||
args.GetReturnValue().Set(Array::New(isolate, ret, arraysize(ret)));
|
||||
}
|
||||
|
||||
void PromiseRejectCallback(PromiseRejectMessage message) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user