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 authored and Michaël Zasso committed 2018-11-29 15:40:07 +01:00
1 parent b1d3747b5b
commit b554ff7620
1 file changed
+5 -4
+5 -4
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) {