mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 12:47:49 +00:00
Simplify the _.support.dom check.
This commit is contained in:
20
lodash.js
20
lodash.js
@@ -690,14 +690,6 @@
|
||||
*/
|
||||
support.argsObject = arguments.constructor == Object && !(arguments instanceof Array);
|
||||
|
||||
/**
|
||||
* Detect if the DOM is supported.
|
||||
*
|
||||
* @memberOf _.support
|
||||
* @type boolean
|
||||
*/
|
||||
support.dom = !!document && typeof document == 'object' && reNative.test(clearTimeout) && reNative.test(setTimeout);
|
||||
|
||||
/**
|
||||
* Detect if `name` or `message` properties of `Error.prototype` are
|
||||
* enumerable by default. (IE < 9, Safari < 5.1)
|
||||
@@ -790,6 +782,18 @@
|
||||
*/
|
||||
support.unindexedChars = ('x'[0] + Object('x')[0]) != 'xx';
|
||||
|
||||
/**
|
||||
* Detect if the DOM is supported.
|
||||
*
|
||||
* @memberOf _.support
|
||||
* @type boolean
|
||||
*/
|
||||
try {
|
||||
support.dom = document.createDocumentFragment().nodeType === 11;
|
||||
} catch(e) {
|
||||
support.dom = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect if a DOM node's [[Class]] is resolvable (all but IE < 9)
|
||||
* and that the JS engine errors when attempting to coerce an object to
|
||||
|
||||
Reference in New Issue
Block a user