mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Fix html test runner errors.
This commit is contained in:
@@ -114,6 +114,11 @@
|
|||||||
setProperty(window, '_ArrayBuffer', window.ArrayBuffer);
|
setProperty(window, '_ArrayBuffer', window.ArrayBuffer);
|
||||||
if (window.ArrayBuffer && window.Uint8Array && !new ArrayBuffer(0).slice) {
|
if (window.ArrayBuffer && window.Uint8Array && !new ArrayBuffer(0).slice) {
|
||||||
ArrayBuffer = (function() {
|
ArrayBuffer = (function() {
|
||||||
|
function constant(value) {
|
||||||
|
return function() {
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
}
|
||||||
function ArrayBuffer(byteLength) {
|
function ArrayBuffer(byteLength) {
|
||||||
var buffer = new _ArrayBuffer(byteLength);
|
var buffer = new _ArrayBuffer(byteLength);
|
||||||
buffer.slice = function() {
|
buffer.slice = function() {
|
||||||
@@ -128,16 +133,19 @@
|
|||||||
}
|
}
|
||||||
var reToString = /toString/g,
|
var reToString = /toString/g,
|
||||||
nativeString = Function.prototype.toString.call(toString),
|
nativeString = Function.prototype.toString.call(toString),
|
||||||
bufferToString = _.constant(nativeString.replace(reToString, 'ArrayBuffer')),
|
bufferToString = constant(nativeString.replace(reToString, 'ArrayBuffer')),
|
||||||
sliceToString = _.constant(nativeString.replace(reToString, 'slice'));
|
sliceToString = constant(nativeString.replace(reToString, 'slice'));
|
||||||
|
|
||||||
setProperty(ArrayBuffer, 'toString', bufferToString);
|
setProperty(ArrayBuffer, 'toString', bufferToString);
|
||||||
return ArrayBuffer;
|
return ArrayBuffer;
|
||||||
}());
|
}());
|
||||||
}
|
}
|
||||||
setProperty(window, '_Float64Array', window.Float64Array);
|
setProperty(window, '_Float64Array', window.Float64Array);
|
||||||
Float64Array = window.Float64Array ? function() {} : window.Uint8Array;
|
if (window._ArrayBuffer == window.ArrayBuffer && window._Float64Array) {
|
||||||
|
Float64Array = function() {};
|
||||||
|
} else {
|
||||||
|
Float64Array = window.Uint8Array;
|
||||||
|
}
|
||||||
setProperty(window, 'WinRTError', Error);
|
setProperty(window, 'WinRTError', Error);
|
||||||
|
|
||||||
setProperty(window, 'exports', window);
|
setProperty(window, 'exports', window);
|
||||||
|
|||||||
Reference in New Issue
Block a user