mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Rework the noNodeClass inference to detect the JScript quirk too.
Former-commit-id: 3a6b73509490d7e87d2322fe1c09890f5f6b57ea
This commit is contained in:
23
lodash.js
23
lodash.js
@@ -144,8 +144,14 @@
|
|||||||
*/
|
*/
|
||||||
var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx';
|
var noCharByIndex = ('x'[0] + Object('x')[0]) != 'xx';
|
||||||
|
|
||||||
/** Detect if a node's [[Class]] is unresolvable (IE < 9) */
|
/**
|
||||||
var noNodeClass = toString.call(window.document || {}) == objectClass;
|
* Detect if a node's [[Class]] is unresolvable (IE < 9)
|
||||||
|
* and that the JS engine won't error when attempting to coerce an object to
|
||||||
|
* a string without a `toString` property value of `typeof` "function".
|
||||||
|
*/
|
||||||
|
try {
|
||||||
|
var noNodeClass = ({ 'toString': 0 } + '', toString.call(window.document || 0) == objectClass);
|
||||||
|
} catch(e) { }
|
||||||
|
|
||||||
/* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */
|
/* Detect if `Function#bind` exists and is inferred to be fast (all but V8) */
|
||||||
var isBindFast = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera));
|
var isBindFast = nativeBind && /\n|Opera/.test(nativeBind + toString.call(window.opera));
|
||||||
@@ -301,7 +307,7 @@
|
|||||||
*/
|
*/
|
||||||
var iteratorTemplate = template(
|
var iteratorTemplate = template(
|
||||||
// conditional strict mode
|
// conditional strict mode
|
||||||
'<% if (useStrict) { %>\'use strict\';\n<% } %>' +
|
'<% if (useStrict) { %>\'use strict\';\n<% } %>' +
|
||||||
|
|
||||||
// the `iteratee` may be reassigned by the `top` snippet
|
// the `iteratee` may be reassigned by the `top` snippet
|
||||||
'var index, value, iteratee = <%= firstArg %>, ' +
|
'var index, value, iteratee = <%= firstArg %>, ' +
|
||||||
@@ -794,9 +800,11 @@
|
|||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a clone of `value`. If `deep` is `true`, all nested objects, excluding
|
* Creates a clone of `value`. If `deep` is `true`, all nested objects will
|
||||||
* functons and `arguments` objects, will be cloned otherwise they will be
|
* also be cloned otherwise they will be assigned by reference. If a value has
|
||||||
* assigned by reference.
|
* a `clone` method it will be used to perform the clone. Functions, DOM nodes,
|
||||||
|
* `arguments` objects, and object instances created by a constructor other
|
||||||
|
* than `Object` are **not** cloned unless they have a custom `clone` method.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
@@ -1221,7 +1229,8 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Performs a deep comparison between two values to determine if they are
|
* Performs a deep comparison between two values to determine if they are
|
||||||
* equivalent to each other.
|
* equivalent to each other. If a value has an `isEqual` method it will be
|
||||||
|
* used to perform the comparison.
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @memberOf _
|
* @memberOf _
|
||||||
|
|||||||
Reference in New Issue
Block a user