mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 07:17:50 +00:00
38 lines
780 B
JavaScript
38 lines
780 B
JavaScript
define(['./internal/root'], function(root) {
|
|
|
|
/** Used to detect DOM support. */
|
|
var document = (document = root.window) ? document.document : null;
|
|
|
|
/**
|
|
* An object environment feature flags.
|
|
*
|
|
* @static
|
|
* @memberOf _
|
|
* @type Object
|
|
*/
|
|
var support = {};
|
|
|
|
(function(x) {
|
|
var Ctor = function() { this.x = x; },
|
|
object = { '0': x, 'length': x },
|
|
props = [];
|
|
|
|
Ctor.prototype = { 'valueOf': x, 'y': x };
|
|
for (var key in new Ctor) { props.push(key); }
|
|
|
|
/**
|
|
* Detect if the DOM is supported.
|
|
*
|
|
* @memberOf _.support
|
|
* @type boolean
|
|
*/
|
|
try {
|
|
support.dom = document.createDocumentFragment().nodeType === 11;
|
|
} catch(e) {
|
|
support.dom = false;
|
|
}
|
|
}(1, 0));
|
|
|
|
return support;
|
|
});
|