src: replace create new Array

PR-URL: https://github.com/nodejs/node/pull/24618
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
This commit is contained in:
kohta ito 2018-11-24 17:02:10 +09:00 committed by Gireesh Punathil
parent 32b0958c58
commit 1dfa1a2acb

View File

@ -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) {