mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Fix failing unit tests in various browsers.
Former-commit-id: 9b5c6e82e0dfed79c505f41b66030ede81ca9a1c
This commit is contained in:
17
lodash.js
17
lodash.js
@@ -181,10 +181,11 @@
|
|||||||
// when it encounters a single line comment beginning with the `@` symbol.
|
// when it encounters a single line comment beginning with the `@` symbol.
|
||||||
// The JS engine in Narwhal will generate the function `function anonymous(){//}`
|
// The JS engine in Narwhal will generate the function `function anonymous(){//}`
|
||||||
// and throw a syntax error. In IE, `@` symbols are part of its non-standard
|
// and throw a syntax error. In IE, `@` symbols are part of its non-standard
|
||||||
// conditional compilation support. The `@cc_on` statement activates its
|
// conditional compilation support. The `@cc_on` statement activates its support
|
||||||
// support while the trailing `!` induces a syntax error to exlude it.
|
// while the trailing ` !` induces a syntax error to exlude it. Compatibility
|
||||||
|
// modes in IE > 8 require a space before the `!` to induce a syntax error.
|
||||||
// See http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx
|
// See http://msdn.microsoft.com/en-us/library/121hztk3(v=vs.94).aspx
|
||||||
var useSourceURL = (Function('//@cc_on!')(), true);
|
var useSourceURL = (Function('//@cc_on !')(), true);
|
||||||
} catch(e){ }
|
} catch(e){ }
|
||||||
|
|
||||||
/** Used to identify object classifications that are array-like */
|
/** Used to identify object classifications that are array-like */
|
||||||
@@ -490,10 +491,9 @@
|
|||||||
'init': 'object',
|
'init': 'object',
|
||||||
'top':
|
'top':
|
||||||
'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' +
|
'for (var argsIndex = 1, argsLength = arguments.length; argsIndex < argsLength; argsIndex++) {\n' +
|
||||||
' iteratee = arguments[argsIndex];\n' +
|
' if (iteratee = arguments[argsIndex]) {',
|
||||||
(hasDontEnumBug ? ' if (iteratee) {' : ''),
|
|
||||||
'inLoop': 'result[index] = value',
|
'inLoop': 'result[index] = value',
|
||||||
'bottom': (hasDontEnumBug ? ' }\n' : '') + '}'
|
'bottom': ' }\n}'
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Reusable iterator options for `filter`, `reject`, and `where` */
|
/** Reusable iterator options for `filter`, `reject`, and `where` */
|
||||||
@@ -908,7 +908,7 @@
|
|||||||
thorough.value = !!(BoolProto.clone || NumberProto.clone || StringProto.clone);
|
thorough.value = !!(BoolProto.clone || NumberProto.clone || StringProto.clone);
|
||||||
}
|
}
|
||||||
// use custom `clone` method if available
|
// use custom `clone` method if available
|
||||||
var isObj = typeof value == 'object';
|
var isObj = objectTypes[typeof value];
|
||||||
if ((isObj || thorough.value) && value.clone && toString.call(value.clone) == funcClass) {
|
if ((isObj || thorough.value) && value.clone && toString.call(value.clone) == funcClass) {
|
||||||
thorough.value = null;
|
thorough.value = null;
|
||||||
return value.clone(deep);
|
return value.clone(deep);
|
||||||
@@ -2028,8 +2028,7 @@
|
|||||||
'var destValue, found, isArr, stackLength, recursive = indicator == isPlainObject;\n' +
|
'var destValue, found, isArr, stackLength, recursive = indicator == isPlainObject;\n' +
|
||||||
'if (!recursive) stack = [];\n' +
|
'if (!recursive) stack = [];\n' +
|
||||||
'for (var argsIndex = 1, argsLength = recursive ? 2 : arguments.length; argsIndex < argsLength; argsIndex++) {\n' +
|
'for (var argsIndex = 1, argsLength = recursive ? 2 : arguments.length; argsIndex < argsLength; argsIndex++) {\n' +
|
||||||
' iteratee = arguments[argsIndex];\n' +
|
' if (iteratee = arguments[argsIndex]) {',
|
||||||
(hasDontEnumBug ? ' if (iteratee) {' : ''),
|
|
||||||
'inLoop':
|
'inLoop':
|
||||||
'if (value && ((isArr = isArray(value)) || isPlainObject(value))) {\n' +
|
'if (value && ((isArr = isArray(value)) || isPlainObject(value))) {\n' +
|
||||||
' found = false; stackLength = stack.length;\n' +
|
' found = false; stackLength = stack.length;\n' +
|
||||||
|
|||||||
@@ -753,7 +753,9 @@
|
|||||||
var idoc = (idoc = iframe.contentDocument || iframe.contentWindow).document || idoc;
|
var idoc = (idoc = iframe.contentDocument || iframe.contentWindow).document || idoc;
|
||||||
idoc.write("<script>parent._._object = { 'a': 1, 'b': 2, 'c': 3 };<\/script>");
|
idoc.write("<script>parent._._object = { 'a': 1, 'b': 2, 'c': 3 };<\/script>");
|
||||||
idoc.close();
|
idoc.close();
|
||||||
|
}
|
||||||
|
// ensure `_._object` is assigned (unassigned in Opera 10.00)
|
||||||
|
if (_._object) {
|
||||||
equal(_.isEqual(object, _._object), true);
|
equal(_.isEqual(object, _._object), true);
|
||||||
body.removeChild(iframe);
|
body.removeChild(iframe);
|
||||||
delete _._object;
|
delete _._object;
|
||||||
|
|||||||
Reference in New Issue
Block a user