Remove bufferClone fork.

This commit is contained in:
jdalton
2015-05-26 11:22:06 -07:00
parent 255da0a0d7
commit ae0bb54b2d

View File

@@ -761,7 +761,6 @@
/** Native method references. */ /** Native method references. */
var ArrayBuffer = getNative(context, 'ArrayBuffer'), var ArrayBuffer = getNative(context, 'ArrayBuffer'),
bufferSlice = getNative(ArrayBuffer && new ArrayBuffer(0), 'slice'),
ceil = Math.ceil, ceil = Math.ceil,
clearTimeout = context.clearTimeout, clearTimeout = context.clearTimeout,
floor = Math.floor, floor = Math.floor,
@@ -3030,12 +3029,7 @@
* @param {ArrayBuffer} buffer The array buffer to clone. * @param {ArrayBuffer} buffer The array buffer to clone.
* @returns {ArrayBuffer} Returns the cloned array buffer. * @returns {ArrayBuffer} Returns the cloned array buffer.
*/ */
function bufferClone(buffer) { var bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function(buffer) {
return bufferSlice.call(buffer, 0);
}
if (!bufferSlice) {
// PhantomJS has `ArrayBuffer` and `Uint8Array` but not `Float64Array`.
bufferClone = !(ArrayBuffer && Uint8Array) ? constant(null) : function(buffer) {
var byteLength = buffer.byteLength, var byteLength = buffer.byteLength,
floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0, floatLength = Float64Array ? floor(byteLength / FLOAT64_BYTES_PER_ELEMENT) : 0,
offset = floatLength * FLOAT64_BYTES_PER_ELEMENT, offset = floatLength * FLOAT64_BYTES_PER_ELEMENT,
@@ -3051,7 +3045,6 @@
} }
return result; return result;
}; };
}
/** /**
* Creates an array that is the composition of partially applied arguments, * Creates an array that is the composition of partially applied arguments,