Skip to content

Commit

Permalink
src: replace create new Array
Browse files Browse the repository at this point in the history
PR-URL: #24618
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Shingo Inoue <[email protected]>
Reviewed-By: Gus Caplan <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Masashi Hirano <[email protected]>
  • Loading branch information
koh110 authored and targos committed Nov 29, 2018
1 parent b1d3747 commit b554ff7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/node_serdes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,11 @@ void DeserializerContext::ReadUint64(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = ctx->env()->isolate();
Local<Context> context = ctx->env()->context();

Local<Array> ret = Array::New(isolate, 2);
ret->Set(context, 0, Integer::NewFromUnsigned(isolate, hi)).FromJust();
ret->Set(context, 1, Integer::NewFromUnsigned(isolate, lo)).FromJust();
return args.GetReturnValue().Set(ret);
Local<Value> ret[] = {
Integer::NewFromUnsigned(isolate, hi),
Integer::NewFromUnsigned(isolate, lo)
};
return args.GetReturnValue().Set(Array::New(isolate, ret, arraysize(ret)));
}

void DeserializerContext::ReadDouble(const FunctionCallbackInfo<Value>& args) {
Expand Down

0 comments on commit b554ff7

Please sign in to comment.