globals.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. Map: false,
  68. Promise: false,
  69. Proxy: false,
  70. Reflect: false,
  71. Set: false,
  72. Symbol: false,
  73. Uint16Array: false,
  74. Uint32Array: false,
  75. Uint8Array: false,
  76. Uint8ClampedArray: false,
  77. WeakMap: false,
  78. WeakSet: false
  79. };
  80. // no new globals in ES2016
  81. const es2016 = {
  82. ...es2015
  83. };
  84. const es2017 = {
  85. ...es2016,
  86. Atomics: false,
  87. SharedArrayBuffer: false
  88. };
  89. // no new globals in ES2018
  90. const es2018 = {
  91. ...es2017
  92. };
  93. // no new globals in ES2019
  94. const es2019 = {
  95. ...es2018
  96. };
  97. const es2020 = {
  98. ...es2019,
  99. BigInt: false,
  100. BigInt64Array: false,
  101. BigUint64Array: false,
  102. globalThis: false
  103. };
  104. const es2021 = {
  105. ...es2020,
  106. AggregateError: false,
  107. FinalizationRegistry: false,
  108. WeakRef: false
  109. };
  110. const es2022 = {
  111. ...es2021
  112. };
  113. const es2023 = {
  114. ...es2022
  115. };
  116. //-----------------------------------------------------------------------------
  117. // Exports
  118. //-----------------------------------------------------------------------------
  119. module.exports = {
  120. commonjs,
  121. es3,
  122. es5,
  123. es2015,
  124. es2016,
  125. es2017,
  126. es2018,
  127. es2019,
  128. es2020,
  129. es2021,
  130. es2022,
  131. es2023
  132. };