Files
lodash/support.js
John-David Dalton 81e41ca0c8 Bump to v3.9.0.
2015-12-16 17:50:42 -08:00

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;
});