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:
kohta ito authored and Rod Vagg committed 2018-11-28 11:25:34 +11:00
1 parent c15efcec92
commit 955a8a720a
1 file changed
+5 -4
+5 -4
View File
@@ -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) {