Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80736 views
1
/** Used to detect DOM support. */
2
var document = (document = global.window) ? document.document : null;
3
4
/**
5
* An object environment feature flags.
6
*
7
* @static
8
* @memberOf _
9
* @type Object
10
*/
11
var support = {};
12
13
(function(x) {
14
var Ctor = function() { this.x = x; },
15
object = { '0': x, 'length': x },
16
props = [];
17
18
Ctor.prototype = { 'valueOf': x, 'y': x };
19
for (var key in new Ctor) { props.push(key); }
20
21
/**
22
* Detect if the DOM is supported.
23
*
24
* @memberOf _.support
25
* @type boolean
26
*/
27
try {
28
support.dom = document.createDocumentFragment().nodeType === 11;
29
} catch(e) {
30
support.dom = false;
31
}
32
}(1, 0));
33
34
module.exports = support;
35
36