handle count with number properly in packet test

This commit is contained in:
Romain Beaumont 2019-12-29 23:17:38 +01:00
parent c0ae9b1546
commit 4604330586
No known key found for this signature in database
GPG key ID: DB60E388B3BCF286

View file

@ -44,7 +44,9 @@ const values = {
buffer: Buffer.alloc(8), buffer: Buffer.alloc(8),
array: function (typeArgs, context) { array: function (typeArgs, context) {
let count let count
if (typeof typeArgs.count === 'object') { if (typeof typeArgs.count === 'number') {
count = typeArgs.count
} else if (typeof typeArgs.count === 'object') {
count = evalCount(typeArgs.count, context) count = evalCount(typeArgs.count, context)
} else if (typeArgs.count !== undefined) { } else if (typeArgs.count !== undefined) {
count = getField(typeArgs.count, context) count = getField(typeArgs.count, context)