From 6303c66f514c058259c83cc204268c758cba3aac Mon Sep 17 00:00:00 2001 From: Christoph Diehl Date: Wed, 13 Sep 2017 21:04:58 +0200 Subject: [PATCH] Add types of BufferSource --- lib/make/typed.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/make/typed.js b/lib/make/typed.js index b74f4e3..b541266 100644 --- a/lib/make/typed.js +++ b/lib/make/typed.js @@ -79,21 +79,21 @@ make.typed = { ]) return random.chance(10) ? -value : value }, - arrayBuffer: function(byteLength = null) { + arrayBuffer: function (byteLength = null) { let length = (byteLength !== null) ? byteLength : this.unsignedShort() return 'new ArrayBuffer(' + length + ')' }, - dataView: function(byteLength = null) { + dataView: function (byteLength = null) { let length = (byteLength !== null) ? byteLength : this.unsignedShort() return 'new DataView(' + this.arrayBuffer(length) + ')' }, - typedArray: function(byteLength = null) { + typedArray: function (byteLength = null) { let length = (byteLength !== null) ? byteLength : this.unsignedShort() let arrType = random.item([ 'Int8', 'Uint8', 'Uint8Clamped', 'Int16', 'Uint16', 'Int32', 'Uint32', - 'Float32', 'Float64', + 'Float32', 'Float64' ]) let method = 'new ' + arrType + 'Array' switch (random.number(16)) { @@ -105,7 +105,7 @@ make.typed = { return method + '(' + length + ')' } }, - bufferSource: function() { + bufferSource: function () { return random.choose([ [1, [this.arrayBuffer, this.dataView]], [1, [this.typedArray]]