diff options
author | kohta ito <kohta110@gmail.com> | 2018-11-24 11:02:10 +0300 |
---|---|---|
committer | Gireesh Punathil <gpunathi@in.ibm.com> | 2018-11-29 07:08:52 +0300 |
commit | 1dfa1a2acb5b338518d3be799ed7efcbaf09f7e1 (patch) | |
tree | 29a13d43cedf89b7c301e5feda6f849785228be2 /src/node_serdes.cc | |
parent | 32b0958c58feb37fd0ecbb1fbab4f919fe17f058 (diff) |
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>
Diffstat (limited to 'src/node_serdes.cc')
-rw-r--r-- | src/node_serdes.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/node_serdes.cc b/src/node_serdes.cc index 0a410944458..afeaebdeb29 100644 --- a/src/node_serdes.cc +++ b/src/node_serdes.cc @@ -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) { |