environments.js 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  1. /**
  2. * @fileoverview Defines environment settings and globals.
  3. * @author Elan Shanker
  4. */
  5. "use strict";
  6. //------------------------------------------------------------------------------
  7. // Requirements
  8. //------------------------------------------------------------------------------
  9. const globals = require("globals");
  10. //------------------------------------------------------------------------------
  11. // Public Interface
  12. //------------------------------------------------------------------------------
  13. module.exports = {
  14. builtin: {
  15. globals: globals.es5
  16. },
  17. browser: {
  18. /*
  19. * For backward compatibility.
  20. * Remove those on the next major release.
  21. */
  22. globals: Object.assign(
  23. {
  24. AutocompleteErrorEvent: false,
  25. CDATASection: false,
  26. ClientRect: false,
  27. ClientRectList: false,
  28. CSSAnimation: false,
  29. CSSTransition: false,
  30. CSSUnknownRule: false,
  31. CSSViewportRule: false,
  32. Debug: false,
  33. DocumentTimeline: false,
  34. DOMSettableTokenList: false,
  35. ElementTimeControl: false,
  36. FederatedCredential: false,
  37. FileError: false,
  38. HTMLAppletElement: false,
  39. HTMLBlockquoteElement: false,
  40. HTMLIsIndexElement: false,
  41. HTMLKeygenElement: false,
  42. HTMLLayerElement: false,
  43. IDBEnvironment: false,
  44. InputMethodContext: false,
  45. MediaKeyError: false,
  46. MediaKeyEvent: false,
  47. MediaKeys: false,
  48. opera: false,
  49. PasswordCredential: false,
  50. ReadableByteStream: false,
  51. SharedKeyframeList: false,
  52. showModalDialog: false,
  53. SiteBoundCredential: false,
  54. SVGAltGlyphDefElement: false,
  55. SVGAltGlyphElement: false,
  56. SVGAltGlyphItemElement: false,
  57. SVGAnimateColorElement: false,
  58. SVGAnimatedPathData: false,
  59. SVGAnimatedPoints: false,
  60. SVGColor: false,
  61. SVGColorProfileElement: false,
  62. SVGColorProfileRule: false,
  63. SVGCSSRule: false,
  64. SVGCursorElement: false,
  65. SVGDocument: false,
  66. SVGElementInstance: false,
  67. SVGElementInstanceList: false,
  68. SVGEvent: false,
  69. SVGExternalResourcesRequired: false,
  70. SVGFilterPrimitiveStandardAttributes: false,
  71. SVGFitToViewBox: false,
  72. SVGFontElement: false,
  73. SVGFontFaceElement: false,
  74. SVGFontFaceFormatElement: false,
  75. SVGFontFaceNameElement: false,
  76. SVGFontFaceSrcElement: false,
  77. SVGFontFaceUriElement: false,
  78. SVGGlyphElement: false,
  79. SVGGlyphRefElement: false,
  80. SVGHKernElement: false,
  81. SVGICCColor: false,
  82. SVGLangSpace: false,
  83. SVGLocatable: false,
  84. SVGMissingGlyphElement: false,
  85. SVGPaint: false,
  86. SVGPathSeg: false,
  87. SVGPathSegArcAbs: false,
  88. SVGPathSegArcRel: false,
  89. SVGPathSegClosePath: false,
  90. SVGPathSegCurvetoCubicAbs: false,
  91. SVGPathSegCurvetoCubicRel: false,
  92. SVGPathSegCurvetoCubicSmoothAbs: false,
  93. SVGPathSegCurvetoCubicSmoothRel: false,
  94. SVGPathSegCurvetoQuadraticAbs: false,
  95. SVGPathSegCurvetoQuadraticRel: false,
  96. SVGPathSegCurvetoQuadraticSmoothAbs: false,
  97. SVGPathSegCurvetoQuadraticSmoothRel: false,
  98. SVGPathSegLinetoAbs: false,
  99. SVGPathSegLinetoHorizontalAbs: false,
  100. SVGPathSegLinetoHorizontalRel: false,
  101. SVGPathSegLinetoRel: false,
  102. SVGPathSegLinetoVerticalAbs: false,
  103. SVGPathSegLinetoVerticalRel: false,
  104. SVGPathSegList: false,
  105. SVGPathSegMovetoAbs: false,
  106. SVGPathSegMovetoRel: false,
  107. SVGRenderingIntent: false,
  108. SVGStylable: false,
  109. SVGTests: false,
  110. SVGTransformable: false,
  111. SVGTRefElement: false,
  112. SVGURIReference: false,
  113. SVGViewSpec: false,
  114. SVGVKernElement: false,
  115. SVGZoomAndPan: false,
  116. SVGZoomEvent: false,
  117. TimeEvent: false,
  118. XDomainRequest: false,
  119. XMLHttpRequestProgressEvent: false,
  120. XPathException: false,
  121. XPathNamespace: false,
  122. XPathNSResolver: false
  123. },
  124. globals.browser
  125. )
  126. },
  127. node: {
  128. /*
  129. * For backward compatibility.
  130. * Remove those on the next major release.
  131. */
  132. globals: Object.assign(
  133. { arguments: false, GLOBAL: false, root: false },
  134. globals.node
  135. ),
  136. parserOptions: {
  137. ecmaFeatures: {
  138. globalReturn: true
  139. }
  140. }
  141. },
  142. commonjs: {
  143. globals: globals.commonjs,
  144. parserOptions: {
  145. ecmaFeatures: {
  146. globalReturn: true
  147. }
  148. }
  149. },
  150. "shared-node-browser": {
  151. globals: globals["shared-node-browser"]
  152. },
  153. worker: {
  154. globals: globals.worker
  155. },
  156. amd: {
  157. globals: globals.amd
  158. },
  159. mocha: {
  160. globals: globals.mocha
  161. },
  162. jasmine: {
  163. globals: globals.jasmine
  164. },
  165. jest: {
  166. /*
  167. * For backward compatibility.
  168. * Remove those on the next major release.
  169. */
  170. globals: Object.assign(
  171. { check: false, gen: false },
  172. globals.jest
  173. )
  174. },
  175. phantomjs: {
  176. globals: globals.phantomjs
  177. },
  178. jquery: {
  179. globals: globals.jquery
  180. },
  181. qunit: {
  182. globals: globals.qunit
  183. },
  184. prototypejs: {
  185. globals: globals.prototypejs
  186. },
  187. shelljs: {
  188. globals: globals.shelljs
  189. },
  190. meteor: {
  191. globals: globals.meteor
  192. },
  193. mongo: {
  194. globals: globals.mongo
  195. },
  196. protractor: {
  197. globals: globals.protractor
  198. },
  199. applescript: {
  200. globals: globals.applescript
  201. },
  202. nashorn: {
  203. globals: globals.nashorn
  204. },
  205. serviceworker: {
  206. globals: globals.serviceworker
  207. },
  208. atomtest: {
  209. globals: globals.atomtest
  210. },
  211. embertest: {
  212. globals: globals.embertest
  213. },
  214. webextensions: {
  215. globals: globals.webextensions
  216. },
  217. es6: {
  218. globals: globals.es2015,
  219. parserOptions: {
  220. ecmaVersion: 6
  221. }
  222. },
  223. greasemonkey: {
  224. globals: globals.greasemonkey
  225. }
  226. };