mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57:50 +00:00
Fix edge issue with Opera 10.53-10.60.
Former-commit-id: 60014a8e3855bcbf0e4c6f47461123cacafcf668
This commit is contained in:
@@ -339,7 +339,7 @@
|
|||||||
// the following branch is for iterating arrays and array-like objects
|
// the following branch is for iterating arrays and array-like objects
|
||||||
'<% if (arrayBranch) { %>' +
|
'<% if (arrayBranch) { %>' +
|
||||||
'var length = iteratee.length; index = -1;' +
|
'var length = iteratee.length; index = -1;' +
|
||||||
' <% if (objectBranch) { %>\nif (length === length >>> 0) {<% } %>' +
|
' <% if (objectBranch) { %>\nif (length > -1 && length === length >>> 0) {<% } %>' +
|
||||||
|
|
||||||
// add support for accessing string characters by index if needed
|
// add support for accessing string characters by index if needed
|
||||||
' <% if (noCharByIndex) { %>\n' +
|
' <% if (noCharByIndex) { %>\n' +
|
||||||
@@ -2146,7 +2146,8 @@
|
|||||||
if(thisArg) {
|
if(thisArg) {
|
||||||
callback = iteratorBind(callback, thisArg);
|
callback = iteratorBind(callback, thisArg);
|
||||||
}
|
}
|
||||||
if (length === length >>> 0) {
|
// Opera 10.53-10.60 JITted `length >>> 0` returns the wrong value for negative numbers
|
||||||
|
if (length > -1 && length === length >>> 0) {
|
||||||
var iteratee = noCharByIndex && toString.call(collection) == stringClass
|
var iteratee = noCharByIndex && toString.call(collection) == stringClass
|
||||||
? collection.split('')
|
? collection.split('')
|
||||||
: collection;
|
: collection;
|
||||||
@@ -2286,7 +2287,7 @@
|
|||||||
return collection.toArray();
|
return collection.toArray();
|
||||||
}
|
}
|
||||||
var length = collection.length;
|
var length = collection.length;
|
||||||
if (length === length >>> 0) {
|
if (length > -1 && length === length >>> 0) {
|
||||||
return (noArraySliceOnStrings ? toString.call(collection) == stringClass : typeof collection == 'string')
|
return (noArraySliceOnStrings ? toString.call(collection) == stringClass : typeof collection == 'string')
|
||||||
? collection.split('')
|
? collection.split('')
|
||||||
: slice.call(collection);
|
: slice.call(collection);
|
||||||
|
|||||||
@@ -494,6 +494,10 @@
|
|||||||
|
|
||||||
_.forEach(object, function(value, key) { keys.push(key); });
|
_.forEach(object, function(value, key) { keys.push(key); });
|
||||||
deepEqual(keys, ['length']);
|
deepEqual(keys, ['length']);
|
||||||
|
|
||||||
|
keys = []; object.length = Math.pow(2, 32);
|
||||||
|
_.forEach(object, function(value, key) { keys.push(key); });
|
||||||
|
deepEqual(keys, ['length']);
|
||||||
});
|
});
|
||||||
|
|
||||||
_.each([
|
_.each([
|
||||||
|
|||||||
Reference in New Issue
Block a user