From f513effd47fee9bb5f7e799da9da002f3d4fe1b2 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Tue, 22 Jul 2014 22:53:38 -0700 Subject: [PATCH] Make Float64Array mock more accurately handle its arg signature. --- test/index.html | 4 +++- test/test.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/index.html b/test/index.html index b49d07047..8f5bfde82 100644 --- a/test/index.html +++ b/test/index.html @@ -146,7 +146,9 @@ if (!window.Float64Array && window.Uint8Array) { Float64Array = (function() { function Float64Array(buffer, byteOffset, length) { - return new Uint8Array(buffer, byteOffset || 0, length || buffer.byteLength); + return arguments.length == 1 + ? new Uint8Array(buffer) + : new Uint8Array(buffer, byteOffset || 0, length || buffer.byteLength); } setProperty(Float64Array, 'BYTES_PER_ELEMENT', 8); setProperty(Float64Array, 'toString', createToString('Float64Array')); diff --git a/test/test.js b/test/test.js index 1fcc5d65b..abc4487af 100644 --- a/test/test.js +++ b/test/test.js @@ -413,7 +413,9 @@ if (!root.Float64Array) { setProperty(root, 'Float64Array', (function() { function Float64Array(buffer, byteOffset, length) { - return new Uint8Array(buffer, byteOffset || 0, length || buffer.byteLength); + return arguments.length == 1 + ? new Uint8Array(buffer) + : new Uint8Array(buffer, byteOffset || 0, length || buffer.byteLength); } setProperty(Float64Array, 'BYTES_PER_ELEMENT', 8); setProperty(Float64Array, 'toString', createToString('Float64Array'));