globals.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. /**
  2. * @fileoverview Globals for ecmaVersion/sourceType
  3. * @author Nicholas C. Zakas
  4. */
  5. "use strict";
  6. //-----------------------------------------------------------------------------
  7. // Globals
  8. //-----------------------------------------------------------------------------
  9. const commonjs = {
  10. exports: true,
  11. global: false,
  12. module: false,
  13. require: false
  14. };
  15. const es3 = {
  16. Array: false,
  17. Boolean: false,
  18. constructor: false,
  19. Date: false,
  20. decodeURI: false,
  21. decodeURIComponent: false,
  22. encodeURI: false,
  23. encodeURIComponent: false,
  24. Error: false,
  25. escape: false,
  26. eval: false,
  27. EvalError: false,
  28. Function: false,
  29. hasOwnProperty: false,
  30. Infinity: false,
  31. isFinite: false,
  32. isNaN: false,
  33. isPrototypeOf: false,
  34. Math: false,
  35. NaN: false,
  36. Number: false,
  37. Object: false,
  38. parseFloat: false,
  39. parseInt: false,
  40. propertyIsEnumerable: false,
  41. RangeError: false,
  42. ReferenceError: false,
  43. RegExp: false,
  44. String: false,
  45. SyntaxError: false,
  46. toLocaleString: false,
  47. toString: false,
  48. TypeError: false,
  49. undefined: false,
  50. unescape: false,
  51. URIError: false,
  52. valueOf: false
  53. };
  54. const es5 = {
  55. ...es3,
  56. JSON: false
  57. };
  58. const es2015 = {
  59. ...es5,
  60. ArrayBuffer: false,
  61. DataView: false,
  62. Float32Array: false,
  63. Float64Array: false,
  64. Int16Array: false,
  65. Int32Array: false,
  66. Int8Array: false,
  67. Intl: false,
  68. Map: false,
  69. Promise: false,
  70. Proxy: false,
  71. Reflect: false,
  72. Set: false,
  73. Symbol: false,
  74. Uint16Array: false,
  75. Uint32Array: false,
  76. Uint8Array: false,
  77. Uint8ClampedArray: false,
  78. WeakMap: false,
  79. WeakSet: false
  80. };
  81. // no new globals in ES2016
  82. const es2016 = {
  83. ...es2015
  84. };
  85. const es2017 = {
  86. ...es2016,
  87. Atomics: false,
  88. SharedArrayBuffer: false
  89. };
  90. // no new globals in ES2018
  91. const es2018 = {
  92. ...es2017
  93. };
  94. // no new globals in ES2019
  95. const es2019 = {
  96. ...es2018
  97. };
  98. const es2020 = {
  99. ...es2019,
  100. BigInt: false,
  101. BigInt64Array: false,
  102. BigUint64Array: false,
  103. globalThis: false
  104. };
  105. const es2021 = {
  106. ...es2020,
  107. AggregateError: false,
  108. FinalizationRegistry: false,
  109. WeakRef: false
  110. };
  111. const es2022 = {
  112. ...es2021
  113. };
  114. const es2023 = {
  115. ...es2022
  116. };
  117. const es2024 = {
  118. ...es2023
  119. };
  120. const es2025 = {
  121. ...es2024
  122. };
  123. //-----------------------------------------------------------------------------
  124. // Exports
  125. //-----------------------------------------------------------------------------
  126. module.exports = {
  127. commonjs,
  128. es3,
  129. es5,
  130. es2015,
  131. es2016,
  132. es2017,
  133. es2018,
  134. es2019,
  135. es2020,
  136. es2021,
  137. es2022,
  138. es2023,
  139. es2024,
  140. es2025
  141. };