Skip to content

Commit

Permalink
src: replace new Array creation
Browse files Browse the repository at this point in the history
PR-URL: #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>
  • Loading branch information
koh110 authored and rvagg committed Nov 28, 2018
1 parent c15efce commit 955a8a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/bootstrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 955a8a7

Please sign in to comment.