You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
863 B
41 lines
863 B
/*!
|
|
Copyright (c) 2015 Jed Watson.
|
|
Based on code that is Copyright 2013-2015, Facebook, Inc.
|
|
All rights reserved.
|
|
*/
|
|
/* global define */
|
|
|
|
(function () {
|
|
'use strict';
|
|
|
|
var canUseDOM = !!(
|
|
typeof window !== 'undefined' &&
|
|
window.document &&
|
|
window.document.createElement
|
|
);
|
|
|
|
var ExecutionEnvironment = {
|
|
|
|
canUseDOM: canUseDOM,
|
|
|
|
canUseWorkers: typeof Worker !== 'undefined',
|
|
|
|
canUseEventListeners:
|
|
canUseDOM && !!(window.addEventListener || window.attachEvent),
|
|
|
|
canUseViewport: canUseDOM && !!window.screen
|
|
|
|
};
|
|
|
|
if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {
|
|
define(function () {
|
|
return ExecutionEnvironment;
|
|
});
|
|
} else if (typeof module !== 'undefined' && module.exports) {
|
|
module.exports = ExecutionEnvironment;
|
|
} else {
|
|
window.ExecutionEnvironment = ExecutionEnvironment;
|
|
}
|
|
|
|
}());
|