mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-29 14:37:49 +00:00
Make Float64Array mock more accurately handle its arg signature.
This commit is contained in:
@@ -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'));
|
||||
|
||||
@@ -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'));
|
||||
|
||||
Reference in New Issue
Block a user