From 955a8a720a52f76a204c1267cf5bce77ae7bb267 Mon Sep 17 00:00:00 2001 From: kohta ito Date: Sat, 24 Nov 2018 16:30:43 +0900 Subject: [PATCH] src: replace new Array creation PR-URL: https://github.com/nodejs/node/pull/24601 Reviewed-By: Anna Henningsen Reviewed-By: Shingo Inoue Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: Gireesh Punathil --- src/bootstrapper.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index c40b855b9939ca..93c1035617958b 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -50,11 +50,12 @@ void SetupNextTick(const FunctionCallbackInfo& args) { .ToLocalChecked(); run_microtasks_fn->SetName(FIXED_ONE_BYTE_STRING(isolate, "runMicrotasks")); - Local ret = Array::New(isolate, 2); - ret->Set(context, 0, env->tick_info()->fields().GetJSArray()).FromJust(); - ret->Set(context, 1, run_microtasks_fn).FromJust(); + Local 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) {