@engine262/engine262 0.0.1-07c72085c73f960bcf0aa06db807321f3b446518

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (941) hide show
  1. package/LICENSE +19 -0
  2. package/README.md +179 -0
  3. package/bin/engine262.js +6 -0
  4. package/declaration/abstract-ops/all.d.mts +35 -0
  5. package/declaration/abstract-ops/all.d.mts.map +1 -0
  6. package/declaration/abstract-ops/arguments-operations.d.mts +17 -0
  7. package/declaration/abstract-ops/arguments-operations.d.mts.map +1 -0
  8. package/declaration/abstract-ops/array-objects.d.mts +23 -0
  9. package/declaration/abstract-ops/array-objects.d.mts.map +1 -0
  10. package/declaration/abstract-ops/arraybuffer-objects.d.mts +44 -0
  11. package/declaration/abstract-ops/arraybuffer-objects.d.mts.map +1 -0
  12. package/declaration/abstract-ops/async-function-operations.d.mts +9 -0
  13. package/declaration/abstract-ops/async-function-operations.d.mts.map +1 -0
  14. package/declaration/abstract-ops/async-generator-objects.d.mts +42 -0
  15. package/declaration/abstract-ops/async-generator-objects.d.mts.map +1 -0
  16. package/declaration/abstract-ops/data-types-and-values.d.mts +6 -0
  17. package/declaration/abstract-ops/data-types-and-values.d.mts.map +1 -0
  18. package/declaration/abstract-ops/dataview-objects.d.mts +32 -0
  19. package/declaration/abstract-ops/dataview-objects.d.mts.map +1 -0
  20. package/declaration/abstract-ops/date-objects.d.mts +46 -0
  21. package/declaration/abstract-ops/date-objects.d.mts.map +1 -0
  22. package/declaration/abstract-ops/error-objects.d.mts +5 -0
  23. package/declaration/abstract-ops/error-objects.d.mts.map +1 -0
  24. package/declaration/abstract-ops/execution-contexts.d.mts +22 -0
  25. package/declaration/abstract-ops/execution-contexts.d.mts.map +1 -0
  26. package/declaration/abstract-ops/function-operations.d.mts +85 -0
  27. package/declaration/abstract-ops/function-operations.d.mts.map +1 -0
  28. package/declaration/abstract-ops/generator-operations.d.mts +37 -0
  29. package/declaration/abstract-ops/generator-operations.d.mts.map +1 -0
  30. package/declaration/abstract-ops/global-object.d.mts +7 -0
  31. package/declaration/abstract-ops/global-object.d.mts.map +1 -0
  32. package/declaration/abstract-ops/immutable-prototype-objects.d.mts +7 -0
  33. package/declaration/abstract-ops/immutable-prototype-objects.d.mts.map +1 -0
  34. package/declaration/abstract-ops/import-calls.d.mts +5 -0
  35. package/declaration/abstract-ops/import-calls.d.mts.map +1 -0
  36. package/declaration/abstract-ops/iterator-operations.d.mts +56 -0
  37. package/declaration/abstract-ops/iterator-operations.d.mts.map +1 -0
  38. package/declaration/abstract-ops/module-namespace-exotic-objects.d.mts +13 -0
  39. package/declaration/abstract-ops/module-namespace-exotic-objects.d.mts.map +1 -0
  40. package/declaration/abstract-ops/module-records.d.mts +34 -0
  41. package/declaration/abstract-ops/module-records.d.mts.map +1 -0
  42. package/declaration/abstract-ops/notational-conventions.d.mts +8 -0
  43. package/declaration/abstract-ops/notational-conventions.d.mts.map +1 -0
  44. package/declaration/abstract-ops/object-operations.d.mts +96 -0
  45. package/declaration/abstract-ops/object-operations.d.mts.map +1 -0
  46. package/declaration/abstract-ops/objects.d.mts +31 -0
  47. package/declaration/abstract-ops/objects.d.mts.map +1 -0
  48. package/declaration/abstract-ops/private-names.d.mts +36 -0
  49. package/declaration/abstract-ops/private-names.d.mts.map +1 -0
  50. package/declaration/abstract-ops/promise-operations.d.mts +62 -0
  51. package/declaration/abstract-ops/promise-operations.d.mts.map +1 -0
  52. package/declaration/abstract-ops/proxy-objects.d.mts +7 -0
  53. package/declaration/abstract-ops/proxy-objects.d.mts.map +1 -0
  54. package/declaration/abstract-ops/realms.d.mts +174 -0
  55. package/declaration/abstract-ops/realms.d.mts.map +1 -0
  56. package/declaration/abstract-ops/reference-operations.d.mts +27 -0
  57. package/declaration/abstract-ops/reference-operations.d.mts.map +1 -0
  58. package/declaration/abstract-ops/regexp-objects.d.mts +40 -0
  59. package/declaration/abstract-ops/regexp-objects.d.mts.map +1 -0
  60. package/declaration/abstract-ops/spec-types.d.mts +39 -0
  61. package/declaration/abstract-ops/spec-types.d.mts.map +1 -0
  62. package/declaration/abstract-ops/string-objects.d.mts +8 -0
  63. package/declaration/abstract-ops/string-objects.d.mts.map +1 -0
  64. package/declaration/abstract-ops/symbol-objects.d.mts +6 -0
  65. package/declaration/abstract-ops/symbol-objects.d.mts.map +1 -0
  66. package/declaration/abstract-ops/testing-comparison.d.mts +46 -0
  67. package/declaration/abstract-ops/testing-comparison.d.mts.map +1 -0
  68. package/declaration/abstract-ops/type-conversion.d.mts +55 -0
  69. package/declaration/abstract-ops/type-conversion.d.mts.map +1 -0
  70. package/declaration/abstract-ops/typedarray-objects.d.mts +33 -0
  71. package/declaration/abstract-ops/typedarray-objects.d.mts.map +1 -0
  72. package/declaration/abstract-ops/weak-operations.d.mts +16 -0
  73. package/declaration/abstract-ops/weak-operations.d.mts.map +1 -0
  74. package/declaration/api-types.d.mts +3 -0
  75. package/declaration/api-types.d.mts.map +1 -0
  76. package/declaration/api.d.mts +63 -0
  77. package/declaration/api.d.mts.map +1 -0
  78. package/declaration/completion.d.mts +163 -0
  79. package/declaration/completion.d.mts.map +1 -0
  80. package/declaration/engine.d.mts +143 -0
  81. package/declaration/engine.d.mts.map +1 -0
  82. package/declaration/environment.d.mts +209 -0
  83. package/declaration/environment.d.mts.map +1 -0
  84. package/declaration/evaluator.d.mts +14 -0
  85. package/declaration/evaluator.d.mts.map +1 -0
  86. package/declaration/helpers.d.mts +92 -0
  87. package/declaration/helpers.d.mts.map +1 -0
  88. package/declaration/inspect.d.mts +4 -0
  89. package/declaration/inspect.d.mts.map +1 -0
  90. package/declaration/intrinsics/AggregateError.d.mts +3 -0
  91. package/declaration/intrinsics/AggregateError.d.mts.map +1 -0
  92. package/declaration/intrinsics/AggregateErrorPrototype.d.mts +3 -0
  93. package/declaration/intrinsics/AggregateErrorPrototype.d.mts.map +1 -0
  94. package/declaration/intrinsics/Array.d.mts +3 -0
  95. package/declaration/intrinsics/Array.d.mts.map +1 -0
  96. package/declaration/intrinsics/ArrayBuffer.d.mts +3 -0
  97. package/declaration/intrinsics/ArrayBuffer.d.mts.map +1 -0
  98. package/declaration/intrinsics/ArrayBufferPrototype.d.mts +3 -0
  99. package/declaration/intrinsics/ArrayBufferPrototype.d.mts.map +1 -0
  100. package/declaration/intrinsics/ArrayIteratorPrototype.d.mts +3 -0
  101. package/declaration/intrinsics/ArrayIteratorPrototype.d.mts.map +1 -0
  102. package/declaration/intrinsics/ArrayPrototype.d.mts +3 -0
  103. package/declaration/intrinsics/ArrayPrototype.d.mts.map +1 -0
  104. package/declaration/intrinsics/ArrayPrototypeShared.d.mts +10 -0
  105. package/declaration/intrinsics/ArrayPrototypeShared.d.mts.map +1 -0
  106. package/declaration/intrinsics/AsyncFromSyncIteratorPrototype.d.mts +6 -0
  107. package/declaration/intrinsics/AsyncFromSyncIteratorPrototype.d.mts.map +1 -0
  108. package/declaration/intrinsics/AsyncFunction.d.mts +3 -0
  109. package/declaration/intrinsics/AsyncFunction.d.mts.map +1 -0
  110. package/declaration/intrinsics/AsyncFunctionPrototype.d.mts +3 -0
  111. package/declaration/intrinsics/AsyncFunctionPrototype.d.mts.map +1 -0
  112. package/declaration/intrinsics/AsyncGeneratorFunction.d.mts +3 -0
  113. package/declaration/intrinsics/AsyncGeneratorFunction.d.mts.map +1 -0
  114. package/declaration/intrinsics/AsyncGeneratorFunctionPrototype.d.mts +3 -0
  115. package/declaration/intrinsics/AsyncGeneratorFunctionPrototype.d.mts.map +1 -0
  116. package/declaration/intrinsics/AsyncGeneratorFunctionPrototypePrototype.d.mts +3 -0
  117. package/declaration/intrinsics/AsyncGeneratorFunctionPrototypePrototype.d.mts.map +1 -0
  118. package/declaration/intrinsics/AsyncIteratorPrototype.d.mts +3 -0
  119. package/declaration/intrinsics/AsyncIteratorPrototype.d.mts.map +1 -0
  120. package/declaration/intrinsics/BigInt.d.mts +8 -0
  121. package/declaration/intrinsics/BigInt.d.mts.map +1 -0
  122. package/declaration/intrinsics/BigIntPrototype.d.mts +3 -0
  123. package/declaration/intrinsics/BigIntPrototype.d.mts.map +1 -0
  124. package/declaration/intrinsics/Boolean.d.mts +8 -0
  125. package/declaration/intrinsics/Boolean.d.mts.map +1 -0
  126. package/declaration/intrinsics/BooleanPrototype.d.mts +3 -0
  127. package/declaration/intrinsics/BooleanPrototype.d.mts.map +1 -0
  128. package/declaration/intrinsics/DataView.d.mts +11 -0
  129. package/declaration/intrinsics/DataView.d.mts.map +1 -0
  130. package/declaration/intrinsics/DataViewPrototype.d.mts +3 -0
  131. package/declaration/intrinsics/DataViewPrototype.d.mts.map +1 -0
  132. package/declaration/intrinsics/Date.d.mts +7 -0
  133. package/declaration/intrinsics/Date.d.mts.map +1 -0
  134. package/declaration/intrinsics/DatePrototype.d.mts +10 -0
  135. package/declaration/intrinsics/DatePrototype.d.mts.map +1 -0
  136. package/declaration/intrinsics/Error.d.mts +3 -0
  137. package/declaration/intrinsics/Error.d.mts.map +1 -0
  138. package/declaration/intrinsics/ErrorPrototype.d.mts +3 -0
  139. package/declaration/intrinsics/ErrorPrototype.d.mts.map +1 -0
  140. package/declaration/intrinsics/FinalizationRegistry.d.mts +16 -0
  141. package/declaration/intrinsics/FinalizationRegistry.d.mts.map +1 -0
  142. package/declaration/intrinsics/FinalizationRegistryPrototype.d.mts +3 -0
  143. package/declaration/intrinsics/FinalizationRegistryPrototype.d.mts.map +1 -0
  144. package/declaration/intrinsics/ForInIteratorPrototype.d.mts +13 -0
  145. package/declaration/intrinsics/ForInIteratorPrototype.d.mts.map +1 -0
  146. package/declaration/intrinsics/Function.d.mts +3 -0
  147. package/declaration/intrinsics/Function.d.mts.map +1 -0
  148. package/declaration/intrinsics/FunctionPrototype.d.mts +10 -0
  149. package/declaration/intrinsics/FunctionPrototype.d.mts.map +1 -0
  150. package/declaration/intrinsics/GeneratorFunction.d.mts +3 -0
  151. package/declaration/intrinsics/GeneratorFunction.d.mts.map +1 -0
  152. package/declaration/intrinsics/GeneratorFunctionPrototype.d.mts +3 -0
  153. package/declaration/intrinsics/GeneratorFunctionPrototype.d.mts.map +1 -0
  154. package/declaration/intrinsics/GeneratorFunctionPrototypePrototype.d.mts +3 -0
  155. package/declaration/intrinsics/GeneratorFunctionPrototypePrototype.d.mts.map +1 -0
  156. package/declaration/intrinsics/IteratorPrototype.d.mts +3 -0
  157. package/declaration/intrinsics/IteratorPrototype.d.mts.map +1 -0
  158. package/declaration/intrinsics/JSON.d.mts +3 -0
  159. package/declaration/intrinsics/JSON.d.mts.map +1 -0
  160. package/declaration/intrinsics/Map.d.mts +12 -0
  161. package/declaration/intrinsics/Map.d.mts.map +1 -0
  162. package/declaration/intrinsics/MapIteratorPrototype.d.mts +7 -0
  163. package/declaration/intrinsics/MapIteratorPrototype.d.mts.map +1 -0
  164. package/declaration/intrinsics/MapPrototype.d.mts +3 -0
  165. package/declaration/intrinsics/MapPrototype.d.mts.map +1 -0
  166. package/declaration/intrinsics/Math.d.mts +4 -0
  167. package/declaration/intrinsics/Math.d.mts.map +1 -0
  168. package/declaration/intrinsics/NativeError.d.mts +6 -0
  169. package/declaration/intrinsics/NativeError.d.mts.map +1 -0
  170. package/declaration/intrinsics/Number.d.mts +7 -0
  171. package/declaration/intrinsics/Number.d.mts.map +1 -0
  172. package/declaration/intrinsics/NumberPrototype.d.mts +3 -0
  173. package/declaration/intrinsics/NumberPrototype.d.mts.map +1 -0
  174. package/declaration/intrinsics/Object.d.mts +3 -0
  175. package/declaration/intrinsics/Object.d.mts.map +1 -0
  176. package/declaration/intrinsics/ObjectPrototype.d.mts +3 -0
  177. package/declaration/intrinsics/ObjectPrototype.d.mts.map +1 -0
  178. package/declaration/intrinsics/Promise.d.mts +12 -0
  179. package/declaration/intrinsics/Promise.d.mts.map +1 -0
  180. package/declaration/intrinsics/PromisePrototype.d.mts +3 -0
  181. package/declaration/intrinsics/PromisePrototype.d.mts.map +1 -0
  182. package/declaration/intrinsics/Proxy.d.mts +11 -0
  183. package/declaration/intrinsics/Proxy.d.mts.map +1 -0
  184. package/declaration/intrinsics/Reflect.d.mts +3 -0
  185. package/declaration/intrinsics/Reflect.d.mts.map +1 -0
  186. package/declaration/intrinsics/RegExp.d.mts +12 -0
  187. package/declaration/intrinsics/RegExp.d.mts.map +1 -0
  188. package/declaration/intrinsics/RegExpPrototype.d.mts +18 -0
  189. package/declaration/intrinsics/RegExpPrototype.d.mts.map +1 -0
  190. package/declaration/intrinsics/RegExpStringIteratorPrototype.d.mts +7 -0
  191. package/declaration/intrinsics/RegExpStringIteratorPrototype.d.mts.map +1 -0
  192. package/declaration/intrinsics/Set.d.mts +7 -0
  193. package/declaration/intrinsics/Set.d.mts.map +1 -0
  194. package/declaration/intrinsics/SetIteratorPrototype.d.mts +7 -0
  195. package/declaration/intrinsics/SetIteratorPrototype.d.mts.map +1 -0
  196. package/declaration/intrinsics/SetPrototype.d.mts +3 -0
  197. package/declaration/intrinsics/SetPrototype.d.mts.map +1 -0
  198. package/declaration/intrinsics/String.d.mts +9 -0
  199. package/declaration/intrinsics/String.d.mts.map +1 -0
  200. package/declaration/intrinsics/StringIteratorPrototype.d.mts +3 -0
  201. package/declaration/intrinsics/StringIteratorPrototype.d.mts.map +1 -0
  202. package/declaration/intrinsics/StringPrototype.d.mts +3 -0
  203. package/declaration/intrinsics/StringPrototype.d.mts.map +1 -0
  204. package/declaration/intrinsics/Symbol.d.mts +12 -0
  205. package/declaration/intrinsics/Symbol.d.mts.map +1 -0
  206. package/declaration/intrinsics/SymbolPrototype.d.mts +3 -0
  207. package/declaration/intrinsics/SymbolPrototype.d.mts.map +1 -0
  208. package/declaration/intrinsics/ThrowTypeError.d.mts +3 -0
  209. package/declaration/intrinsics/ThrowTypeError.d.mts.map +1 -0
  210. package/declaration/intrinsics/TypedArray.d.mts +181 -0
  211. package/declaration/intrinsics/TypedArray.d.mts.map +1 -0
  212. package/declaration/intrinsics/TypedArrayConstructors.d.mts +3 -0
  213. package/declaration/intrinsics/TypedArrayConstructors.d.mts.map +1 -0
  214. package/declaration/intrinsics/TypedArrayPrototype.d.mts +3 -0
  215. package/declaration/intrinsics/TypedArrayPrototype.d.mts.map +1 -0
  216. package/declaration/intrinsics/TypedArrayPrototypes.d.mts +4 -0
  217. package/declaration/intrinsics/TypedArrayPrototypes.d.mts.map +1 -0
  218. package/declaration/intrinsics/URIHandling.d.mts +3 -0
  219. package/declaration/intrinsics/URIHandling.d.mts.map +1 -0
  220. package/declaration/intrinsics/WeakMap.d.mts +11 -0
  221. package/declaration/intrinsics/WeakMap.d.mts.map +1 -0
  222. package/declaration/intrinsics/WeakMapPrototype.d.mts +3 -0
  223. package/declaration/intrinsics/WeakMapPrototype.d.mts.map +1 -0
  224. package/declaration/intrinsics/WeakRef.d.mts +8 -0
  225. package/declaration/intrinsics/WeakRef.d.mts.map +1 -0
  226. package/declaration/intrinsics/WeakRefPrototype.d.mts +3 -0
  227. package/declaration/intrinsics/WeakRefPrototype.d.mts.map +1 -0
  228. package/declaration/intrinsics/WeakSet.d.mts +8 -0
  229. package/declaration/intrinsics/WeakSet.d.mts.map +1 -0
  230. package/declaration/intrinsics/WeakSetPrototype.d.mts +3 -0
  231. package/declaration/intrinsics/WeakSetPrototype.d.mts.map +1 -0
  232. package/declaration/intrinsics/bootstrap.d.mts +14 -0
  233. package/declaration/intrinsics/bootstrap.d.mts.map +1 -0
  234. package/declaration/intrinsics/eval.d.mts +3 -0
  235. package/declaration/intrinsics/eval.d.mts.map +1 -0
  236. package/declaration/intrinsics/isFinite.d.mts +3 -0
  237. package/declaration/intrinsics/isFinite.d.mts.map +1 -0
  238. package/declaration/intrinsics/isNaN.d.mts +3 -0
  239. package/declaration/intrinsics/isNaN.d.mts.map +1 -0
  240. package/declaration/intrinsics/parseFloat.d.mts +3 -0
  241. package/declaration/intrinsics/parseFloat.d.mts.map +1 -0
  242. package/declaration/intrinsics/parseInt.d.mts +3 -0
  243. package/declaration/intrinsics/parseInt.d.mts.map +1 -0
  244. package/declaration/messages.d.mts +160 -0
  245. package/declaration/messages.d.mts.map +1 -0
  246. package/declaration/modules.d.mts +115 -0
  247. package/declaration/modules.d.mts.map +1 -0
  248. package/declaration/parse.d.mts +34 -0
  249. package/declaration/parse.d.mts.map +1 -0
  250. package/declaration/parser/BaseParser.d.mts +24 -0
  251. package/declaration/parser/BaseParser.d.mts.map +1 -0
  252. package/declaration/parser/ExpressionParser.d.mts +52 -0
  253. package/declaration/parser/ExpressionParser.d.mts.map +1 -0
  254. package/declaration/parser/FunctionParser.d.mts +43 -0
  255. package/declaration/parser/FunctionParser.d.mts.map +1 -0
  256. package/declaration/parser/IdentifierParser.d.mts +12 -0
  257. package/declaration/parser/IdentifierParser.d.mts.map +1 -0
  258. package/declaration/parser/LanguageParser.d.mts +10 -0
  259. package/declaration/parser/LanguageParser.d.mts.map +1 -0
  260. package/declaration/parser/Lexer.d.mts +71 -0
  261. package/declaration/parser/Lexer.d.mts.map +1 -0
  262. package/declaration/parser/ModuleParser.d.mts +16 -0
  263. package/declaration/parser/ModuleParser.d.mts.map +1 -0
  264. package/declaration/parser/ParseNode.d.mts +976 -0
  265. package/declaration/parser/ParseNode.d.mts.map +1 -0
  266. package/declaration/parser/Parser.d.mts +32 -0
  267. package/declaration/parser/Parser.d.mts.map +1 -0
  268. package/declaration/parser/RegExpParser.d.mts +46 -0
  269. package/declaration/parser/RegExpParser.d.mts.map +1 -0
  270. package/declaration/parser/Scope.d.mts +106 -0
  271. package/declaration/parser/Scope.d.mts.map +1 -0
  272. package/declaration/parser/StatementParser.d.mts +49 -0
  273. package/declaration/parser/StatementParser.d.mts.map +1 -0
  274. package/declaration/parser/tokens.d.mts +32 -0
  275. package/declaration/parser/tokens.d.mts.map +1 -0
  276. package/declaration/runtime-semantics/AdditiveExpression.d.mts +3 -0
  277. package/declaration/runtime-semantics/AdditiveExpression.d.mts.map +1 -0
  278. package/declaration/runtime-semantics/ApplyStringOrNumericBinaryOperator.d.mts +11 -0
  279. package/declaration/runtime-semantics/ApplyStringOrNumericBinaryOperator.d.mts.map +1 -0
  280. package/declaration/runtime-semantics/ArgumentListEvaluation.d.mts +6 -0
  281. package/declaration/runtime-semantics/ArgumentListEvaluation.d.mts.map +1 -0
  282. package/declaration/runtime-semantics/ArrayLiteral.d.mts +5 -0
  283. package/declaration/runtime-semantics/ArrayLiteral.d.mts.map +1 -0
  284. package/declaration/runtime-semantics/ArrowFunction.d.mts +4 -0
  285. package/declaration/runtime-semantics/ArrowFunction.d.mts.map +1 -0
  286. package/declaration/runtime-semantics/AssignmentExpression.d.mts +14 -0
  287. package/declaration/runtime-semantics/AssignmentExpression.d.mts.map +1 -0
  288. package/declaration/runtime-semantics/AsyncArrowFunction.d.mts +4 -0
  289. package/declaration/runtime-semantics/AsyncArrowFunction.d.mts.map +1 -0
  290. package/declaration/runtime-semantics/AsyncFunctionExpression.d.mts +4 -0
  291. package/declaration/runtime-semantics/AsyncFunctionExpression.d.mts.map +1 -0
  292. package/declaration/runtime-semantics/AsyncGeneratorExpression.d.mts +4 -0
  293. package/declaration/runtime-semantics/AsyncGeneratorExpression.d.mts.map +1 -0
  294. package/declaration/runtime-semantics/AwaitExpression.d.mts +5 -0
  295. package/declaration/runtime-semantics/AwaitExpression.d.mts.map +1 -0
  296. package/declaration/runtime-semantics/BindingInitialization.d.mts +8 -0
  297. package/declaration/runtime-semantics/BindingInitialization.d.mts.map +1 -0
  298. package/declaration/runtime-semantics/BitwiseOperators.d.mts +5 -0
  299. package/declaration/runtime-semantics/BitwiseOperators.d.mts.map +1 -0
  300. package/declaration/runtime-semantics/Block.d.mts +20 -0
  301. package/declaration/runtime-semantics/Block.d.mts.map +1 -0
  302. package/declaration/runtime-semantics/BreakStatement.d.mts +4 -0
  303. package/declaration/runtime-semantics/BreakStatement.d.mts.map +1 -0
  304. package/declaration/runtime-semantics/BreakableStatement.d.mts +4 -0
  305. package/declaration/runtime-semantics/BreakableStatement.d.mts.map +1 -0
  306. package/declaration/runtime-semantics/CallExpression.d.mts +5 -0
  307. package/declaration/runtime-semantics/CallExpression.d.mts.map +1 -0
  308. package/declaration/runtime-semantics/ClassDeclaration.d.mts +8 -0
  309. package/declaration/runtime-semantics/ClassDeclaration.d.mts.map +1 -0
  310. package/declaration/runtime-semantics/ClassDefinitionEvaluation.d.mts +12 -0
  311. package/declaration/runtime-semantics/ClassDefinitionEvaluation.d.mts.map +1 -0
  312. package/declaration/runtime-semantics/ClassExpression.d.mts +5 -0
  313. package/declaration/runtime-semantics/ClassExpression.d.mts.map +1 -0
  314. package/declaration/runtime-semantics/ClassFieldDefinitionEvaluation.d.mts +10 -0
  315. package/declaration/runtime-semantics/ClassFieldDefinitionEvaluation.d.mts.map +1 -0
  316. package/declaration/runtime-semantics/ClassStaticBlockDefinitionEvaluation.d.mts +10 -0
  317. package/declaration/runtime-semantics/ClassStaticBlockDefinitionEvaluation.d.mts.map +1 -0
  318. package/declaration/runtime-semantics/CoalesceExpression.d.mts +5 -0
  319. package/declaration/runtime-semantics/CoalesceExpression.d.mts.map +1 -0
  320. package/declaration/runtime-semantics/CommaOperator.d.mts +5 -0
  321. package/declaration/runtime-semantics/CommaOperator.d.mts.map +1 -0
  322. package/declaration/runtime-semantics/ConditionalExpression.d.mts +5 -0
  323. package/declaration/runtime-semantics/ConditionalExpression.d.mts.map +1 -0
  324. package/declaration/runtime-semantics/ContinueStatement.d.mts +4 -0
  325. package/declaration/runtime-semantics/ContinueStatement.d.mts.map +1 -0
  326. package/declaration/runtime-semantics/CreateDynamicFunction.d.mts +10 -0
  327. package/declaration/runtime-semantics/CreateDynamicFunction.d.mts.map +1 -0
  328. package/declaration/runtime-semantics/DebuggerStatement.d.mts +5 -0
  329. package/declaration/runtime-semantics/DebuggerStatement.d.mts.map +1 -0
  330. package/declaration/runtime-semantics/DefineMethod.d.mts +10 -0
  331. package/declaration/runtime-semantics/DefineMethod.d.mts.map +1 -0
  332. package/declaration/runtime-semantics/DestructuringAssignmentEvaluation.d.mts +5 -0
  333. package/declaration/runtime-semantics/DestructuringAssignmentEvaluation.d.mts.map +1 -0
  334. package/declaration/runtime-semantics/EmptyStatement.d.mts +5 -0
  335. package/declaration/runtime-semantics/EmptyStatement.d.mts.map +1 -0
  336. package/declaration/runtime-semantics/EqualityExpression.d.mts +5 -0
  337. package/declaration/runtime-semantics/EqualityExpression.d.mts.map +1 -0
  338. package/declaration/runtime-semantics/EvaluateBody.d.mts +69 -0
  339. package/declaration/runtime-semantics/EvaluateBody.d.mts.map +1 -0
  340. package/declaration/runtime-semantics/EvaluateCall.d.mts +11 -0
  341. package/declaration/runtime-semantics/EvaluateCall.d.mts.map +1 -0
  342. package/declaration/runtime-semantics/EvaluatePropertyAccess.d.mts +9 -0
  343. package/declaration/runtime-semantics/EvaluatePropertyAccess.d.mts.map +1 -0
  344. package/declaration/runtime-semantics/EvaluateStringOrNumericBinaryExpression.d.mts +6 -0
  345. package/declaration/runtime-semantics/EvaluateStringOrNumericBinaryExpression.d.mts.map +1 -0
  346. package/declaration/runtime-semantics/ExponentiationExpression.d.mts +5 -0
  347. package/declaration/runtime-semantics/ExponentiationExpression.d.mts.map +1 -0
  348. package/declaration/runtime-semantics/ExportDeclaration.d.mts +17 -0
  349. package/declaration/runtime-semantics/ExportDeclaration.d.mts.map +1 -0
  350. package/declaration/runtime-semantics/ExpressionStatement.d.mts +5 -0
  351. package/declaration/runtime-semantics/ExpressionStatement.d.mts.map +1 -0
  352. package/declaration/runtime-semantics/FunctionDeclaration.d.mts +5 -0
  353. package/declaration/runtime-semantics/FunctionDeclaration.d.mts.map +1 -0
  354. package/declaration/runtime-semantics/FunctionDeclarationInstantiation.d.mts +6 -0
  355. package/declaration/runtime-semantics/FunctionDeclarationInstantiation.d.mts.map +1 -0
  356. package/declaration/runtime-semantics/FunctionExpression.d.mts +4 -0
  357. package/declaration/runtime-semantics/FunctionExpression.d.mts.map +1 -0
  358. package/declaration/runtime-semantics/FunctionStatementList.d.mts +15 -0
  359. package/declaration/runtime-semantics/FunctionStatementList.d.mts.map +1 -0
  360. package/declaration/runtime-semantics/GeneratorExpression.d.mts +4 -0
  361. package/declaration/runtime-semantics/GeneratorExpression.d.mts.map +1 -0
  362. package/declaration/runtime-semantics/GetSubstitution.d.mts +5 -0
  363. package/declaration/runtime-semantics/GetSubstitution.d.mts.map +1 -0
  364. package/declaration/runtime-semantics/GlobalDeclarationInstantiation.d.mts +12 -0
  365. package/declaration/runtime-semantics/GlobalDeclarationInstantiation.d.mts.map +1 -0
  366. package/declaration/runtime-semantics/HoistableDeclaration.d.mts +5 -0
  367. package/declaration/runtime-semantics/HoistableDeclaration.d.mts.map +1 -0
  368. package/declaration/runtime-semantics/IdentifierReference.d.mts +6 -0
  369. package/declaration/runtime-semantics/IdentifierReference.d.mts.map +1 -0
  370. package/declaration/runtime-semantics/IfStatement.d.mts +17 -0
  371. package/declaration/runtime-semantics/IfStatement.d.mts.map +1 -0
  372. package/declaration/runtime-semantics/ImportCall.d.mts +6 -0
  373. package/declaration/runtime-semantics/ImportCall.d.mts.map +1 -0
  374. package/declaration/runtime-semantics/ImportDeclaration.d.mts +5 -0
  375. package/declaration/runtime-semantics/ImportDeclaration.d.mts.map +1 -0
  376. package/declaration/runtime-semantics/ImportMeta.d.mts +5 -0
  377. package/declaration/runtime-semantics/ImportMeta.d.mts.map +1 -0
  378. package/declaration/runtime-semantics/InstantiateArrowFunctionExpression.d.mts +5 -0
  379. package/declaration/runtime-semantics/InstantiateArrowFunctionExpression.d.mts.map +1 -0
  380. package/declaration/runtime-semantics/InstantiateAsyncArrowFunctionExpression.d.mts +5 -0
  381. package/declaration/runtime-semantics/InstantiateAsyncArrowFunctionExpression.d.mts.map +1 -0
  382. package/declaration/runtime-semantics/InstantiateAsyncFunctionExpression.d.mts +5 -0
  383. package/declaration/runtime-semantics/InstantiateAsyncFunctionExpression.d.mts.map +1 -0
  384. package/declaration/runtime-semantics/InstantiateAsyncGeneratorFunctionExpression.d.mts +5 -0
  385. package/declaration/runtime-semantics/InstantiateAsyncGeneratorFunctionExpression.d.mts.map +1 -0
  386. package/declaration/runtime-semantics/InstantiateFunctionObject.d.mts +12 -0
  387. package/declaration/runtime-semantics/InstantiateFunctionObject.d.mts.map +1 -0
  388. package/declaration/runtime-semantics/InstantiateGeneratorFunctionExpression.d.mts +5 -0
  389. package/declaration/runtime-semantics/InstantiateGeneratorFunctionExpression.d.mts.map +1 -0
  390. package/declaration/runtime-semantics/InstantiateOrdinaryFunctionExpression.d.mts +5 -0
  391. package/declaration/runtime-semantics/InstantiateOrdinaryFunctionExpression.d.mts.map +1 -0
  392. package/declaration/runtime-semantics/IteratorBindingInitialization.d.mts +9 -0
  393. package/declaration/runtime-semantics/IteratorBindingInitialization.d.mts.map +1 -0
  394. package/declaration/runtime-semantics/KeyedBindingInitialization.d.mts +6 -0
  395. package/declaration/runtime-semantics/KeyedBindingInitialization.d.mts.map +1 -0
  396. package/declaration/runtime-semantics/LabelledEvaluation.d.mts +9 -0
  397. package/declaration/runtime-semantics/LabelledEvaluation.d.mts.map +1 -0
  398. package/declaration/runtime-semantics/LabelledStatement.d.mts +4 -0
  399. package/declaration/runtime-semantics/LabelledStatement.d.mts.map +1 -0
  400. package/declaration/runtime-semantics/LexicalDeclaration.d.mts +10 -0
  401. package/declaration/runtime-semantics/LexicalDeclaration.d.mts.map +1 -0
  402. package/declaration/runtime-semantics/Literal.d.mts +6 -0
  403. package/declaration/runtime-semantics/Literal.d.mts.map +1 -0
  404. package/declaration/runtime-semantics/LogicalANDExpression.d.mts +5 -0
  405. package/declaration/runtime-semantics/LogicalANDExpression.d.mts.map +1 -0
  406. package/declaration/runtime-semantics/LogicalORExpression.d.mts +5 -0
  407. package/declaration/runtime-semantics/LogicalORExpression.d.mts.map +1 -0
  408. package/declaration/runtime-semantics/MV.d.mts +3 -0
  409. package/declaration/runtime-semantics/MV.d.mts.map +1 -0
  410. package/declaration/runtime-semantics/MemberExpression.d.mts +7 -0
  411. package/declaration/runtime-semantics/MemberExpression.d.mts.map +1 -0
  412. package/declaration/runtime-semantics/MethodDefinitionEvaluation.d.mts +16 -0
  413. package/declaration/runtime-semantics/MethodDefinitionEvaluation.d.mts.map +1 -0
  414. package/declaration/runtime-semantics/Module.d.mts +17 -0
  415. package/declaration/runtime-semantics/Module.d.mts.map +1 -0
  416. package/declaration/runtime-semantics/ModuleBody.d.mts +15 -0
  417. package/declaration/runtime-semantics/ModuleBody.d.mts.map +1 -0
  418. package/declaration/runtime-semantics/MultiplicativeExpression.d.mts +5 -0
  419. package/declaration/runtime-semantics/MultiplicativeExpression.d.mts.map +1 -0
  420. package/declaration/runtime-semantics/NamedEvaluation.d.mts +4 -0
  421. package/declaration/runtime-semantics/NamedEvaluation.d.mts.map +1 -0
  422. package/declaration/runtime-semantics/NewExpression.d.mts +5 -0
  423. package/declaration/runtime-semantics/NewExpression.d.mts.map +1 -0
  424. package/declaration/runtime-semantics/NewTarget.d.mts +3 -0
  425. package/declaration/runtime-semantics/NewTarget.d.mts.map +1 -0
  426. package/declaration/runtime-semantics/NumberToBigInt.d.mts +10 -0
  427. package/declaration/runtime-semantics/NumberToBigInt.d.mts.map +1 -0
  428. package/declaration/runtime-semantics/ObjectLiteral.d.mts +5 -0
  429. package/declaration/runtime-semantics/ObjectLiteral.d.mts.map +1 -0
  430. package/declaration/runtime-semantics/OptionalExpression.d.mts +5 -0
  431. package/declaration/runtime-semantics/OptionalExpression.d.mts.map +1 -0
  432. package/declaration/runtime-semantics/ParenthesizedExpression.d.mts +4 -0
  433. package/declaration/runtime-semantics/ParenthesizedExpression.d.mts.map +1 -0
  434. package/declaration/runtime-semantics/PropertyBindingInitialization.d.mts +6 -0
  435. package/declaration/runtime-semantics/PropertyBindingInitialization.d.mts.map +1 -0
  436. package/declaration/runtime-semantics/PropertyDefinitionEvaluation.d.mts +7 -0
  437. package/declaration/runtime-semantics/PropertyDefinitionEvaluation.d.mts.map +1 -0
  438. package/declaration/runtime-semantics/PropertyName.d.mts +6 -0
  439. package/declaration/runtime-semantics/PropertyName.d.mts.map +1 -0
  440. package/declaration/runtime-semantics/RegExp.d.mts +17 -0
  441. package/declaration/runtime-semantics/RegExp.d.mts.map +1 -0
  442. package/declaration/runtime-semantics/RegularExpressionLiteral.d.mts +4 -0
  443. package/declaration/runtime-semantics/RegularExpressionLiteral.d.mts.map +1 -0
  444. package/declaration/runtime-semantics/RelationalExpression.d.mts +26 -0
  445. package/declaration/runtime-semantics/RelationalExpression.d.mts.map +1 -0
  446. package/declaration/runtime-semantics/RestBindingInitialization.d.mts +5 -0
  447. package/declaration/runtime-semantics/RestBindingInitialization.d.mts.map +1 -0
  448. package/declaration/runtime-semantics/ReturnStatement.d.mts +6 -0
  449. package/declaration/runtime-semantics/ReturnStatement.d.mts.map +1 -0
  450. package/declaration/runtime-semantics/Script.d.mts +17 -0
  451. package/declaration/runtime-semantics/Script.d.mts.map +1 -0
  452. package/declaration/runtime-semantics/ScriptBody.d.mts +14 -0
  453. package/declaration/runtime-semantics/ScriptBody.d.mts.map +1 -0
  454. package/declaration/runtime-semantics/ShiftExpression.d.mts +7 -0
  455. package/declaration/runtime-semantics/ShiftExpression.d.mts.map +1 -0
  456. package/declaration/runtime-semantics/StatementList.d.mts +16 -0
  457. package/declaration/runtime-semantics/StatementList.d.mts.map +1 -0
  458. package/declaration/runtime-semantics/StringIndexOf.d.mts +3 -0
  459. package/declaration/runtime-semantics/StringIndexOf.d.mts.map +1 -0
  460. package/declaration/runtime-semantics/StringPad.d.mts +5 -0
  461. package/declaration/runtime-semantics/StringPad.d.mts.map +1 -0
  462. package/declaration/runtime-semantics/SuperCall.d.mts +11 -0
  463. package/declaration/runtime-semantics/SuperCall.d.mts.map +1 -0
  464. package/declaration/runtime-semantics/SuperProperty.d.mts +5 -0
  465. package/declaration/runtime-semantics/SuperProperty.d.mts.map +1 -0
  466. package/declaration/runtime-semantics/SwitchStatement.d.mts +20 -0
  467. package/declaration/runtime-semantics/SwitchStatement.d.mts.map +1 -0
  468. package/declaration/runtime-semantics/TaggedTemplateExpression.d.mts +5 -0
  469. package/declaration/runtime-semantics/TaggedTemplateExpression.d.mts.map +1 -0
  470. package/declaration/runtime-semantics/TemplateLiteral.d.mts +5 -0
  471. package/declaration/runtime-semantics/TemplateLiteral.d.mts.map +1 -0
  472. package/declaration/runtime-semantics/This.d.mts +5 -0
  473. package/declaration/runtime-semantics/This.d.mts.map +1 -0
  474. package/declaration/runtime-semantics/ThrowStatement.d.mts +10 -0
  475. package/declaration/runtime-semantics/ThrowStatement.d.mts.map +1 -0
  476. package/declaration/runtime-semantics/TrimString.d.mts +5 -0
  477. package/declaration/runtime-semantics/TrimString.d.mts.map +1 -0
  478. package/declaration/runtime-semantics/TryStatement.d.mts +16 -0
  479. package/declaration/runtime-semantics/TryStatement.d.mts.map +1 -0
  480. package/declaration/runtime-semantics/UnaryExpression.d.mts +4 -0
  481. package/declaration/runtime-semantics/UnaryExpression.d.mts.map +1 -0
  482. package/declaration/runtime-semantics/Unicode.d.mts +118 -0
  483. package/declaration/runtime-semantics/Unicode.d.mts.map +1 -0
  484. package/declaration/runtime-semantics/UpdateExpression.d.mts +4 -0
  485. package/declaration/runtime-semantics/UpdateExpression.d.mts.map +1 -0
  486. package/declaration/runtime-semantics/VariableStatement.d.mts +9 -0
  487. package/declaration/runtime-semantics/VariableStatement.d.mts.map +1 -0
  488. package/declaration/runtime-semantics/WithStatement.d.mts +16 -0
  489. package/declaration/runtime-semantics/WithStatement.d.mts.map +1 -0
  490. package/declaration/runtime-semantics/YieldExpression.d.mts +6 -0
  491. package/declaration/runtime-semantics/YieldExpression.d.mts.map +1 -0
  492. package/declaration/runtime-semantics/all.d.mts +109 -0
  493. package/declaration/runtime-semantics/all.d.mts.map +1 -0
  494. package/declaration/static-semantics/BodyText.d.mts +4 -0
  495. package/declaration/static-semantics/BodyText.d.mts.map +1 -0
  496. package/declaration/static-semantics/BoundNames.d.mts +4 -0
  497. package/declaration/static-semantics/BoundNames.d.mts.map +1 -0
  498. package/declaration/static-semantics/CharacterValue.d.mts +3 -0
  499. package/declaration/static-semantics/CharacterValue.d.mts.map +1 -0
  500. package/declaration/static-semantics/CodePointAt.d.mts +7 -0
  501. package/declaration/static-semantics/CodePointAt.d.mts.map +1 -0
  502. package/declaration/static-semantics/CodePointsToString.d.mts +3 -0
  503. package/declaration/static-semantics/CodePointsToString.d.mts.map +1 -0
  504. package/declaration/static-semantics/ConstructorMethod.d.mts +4 -0
  505. package/declaration/static-semantics/ConstructorMethod.d.mts.map +1 -0
  506. package/declaration/static-semantics/ContainsArguments.d.mts +4 -0
  507. package/declaration/static-semantics/ContainsArguments.d.mts.map +1 -0
  508. package/declaration/static-semantics/ContainsExpression.d.mts +3 -0
  509. package/declaration/static-semantics/ContainsExpression.d.mts.map +1 -0
  510. package/declaration/static-semantics/DeclarationPart.d.mts +3 -0
  511. package/declaration/static-semantics/DeclarationPart.d.mts.map +1 -0
  512. package/declaration/static-semantics/ExpectedArgumentCount.d.mts +3 -0
  513. package/declaration/static-semantics/ExpectedArgumentCount.d.mts.map +1 -0
  514. package/declaration/static-semantics/ExportEntries.d.mts +10 -0
  515. package/declaration/static-semantics/ExportEntries.d.mts.map +1 -0
  516. package/declaration/static-semantics/ExportEntriesForModule.d.mts +5 -0
  517. package/declaration/static-semantics/ExportEntriesForModule.d.mts.map +1 -0
  518. package/declaration/static-semantics/FlagText.d.mts +4 -0
  519. package/declaration/static-semantics/FlagText.d.mts.map +1 -0
  520. package/declaration/static-semantics/HasInitializer.d.mts +5 -0
  521. package/declaration/static-semantics/HasInitializer.d.mts.map +1 -0
  522. package/declaration/static-semantics/HasName.d.mts +3 -0
  523. package/declaration/static-semantics/HasName.d.mts.map +1 -0
  524. package/declaration/static-semantics/ImportEntries.d.mts +9 -0
  525. package/declaration/static-semantics/ImportEntries.d.mts.map +1 -0
  526. package/declaration/static-semantics/ImportEntriesForModule.d.mts +5 -0
  527. package/declaration/static-semantics/ImportEntriesForModule.d.mts.map +1 -0
  528. package/declaration/static-semantics/ImportedLocalNames.d.mts +4 -0
  529. package/declaration/static-semantics/ImportedLocalNames.d.mts.map +1 -0
  530. package/declaration/static-semantics/IsAnonymousFunctionDefinition.d.mts +4 -0
  531. package/declaration/static-semantics/IsAnonymousFunctionDefinition.d.mts.map +1 -0
  532. package/declaration/static-semantics/IsComputedPropertyKey.d.mts +3 -0
  533. package/declaration/static-semantics/IsComputedPropertyKey.d.mts.map +1 -0
  534. package/declaration/static-semantics/IsConstantDeclaration.d.mts +3 -0
  535. package/declaration/static-semantics/IsConstantDeclaration.d.mts.map +1 -0
  536. package/declaration/static-semantics/IsDestructuring.d.mts +4 -0
  537. package/declaration/static-semantics/IsDestructuring.d.mts.map +1 -0
  538. package/declaration/static-semantics/IsFunctionDefinition.d.mts +6 -0
  539. package/declaration/static-semantics/IsFunctionDefinition.d.mts.map +1 -0
  540. package/declaration/static-semantics/IsIdentifierRef.d.mts +3 -0
  541. package/declaration/static-semantics/IsIdentifierRef.d.mts.map +1 -0
  542. package/declaration/static-semantics/IsInTailPosition.d.mts +3 -0
  543. package/declaration/static-semantics/IsInTailPosition.d.mts.map +1 -0
  544. package/declaration/static-semantics/IsSimpleParameterList.d.mts +3 -0
  545. package/declaration/static-semantics/IsSimpleParameterList.d.mts.map +1 -0
  546. package/declaration/static-semantics/IsStatic.d.mts +4 -0
  547. package/declaration/static-semantics/IsStatic.d.mts.map +1 -0
  548. package/declaration/static-semantics/IsStrict.d.mts +4 -0
  549. package/declaration/static-semantics/IsStrict.d.mts.map +1 -0
  550. package/declaration/static-semantics/IsStringWellFormedUnicode.d.mts +3 -0
  551. package/declaration/static-semantics/IsStringWellFormedUnicode.d.mts.map +1 -0
  552. package/declaration/static-semantics/LexicallyDeclaredNames.d.mts +4 -0
  553. package/declaration/static-semantics/LexicallyDeclaredNames.d.mts.map +1 -0
  554. package/declaration/static-semantics/LexicallyScopedDeclarations.d.mts +3 -0
  555. package/declaration/static-semantics/LexicallyScopedDeclarations.d.mts.map +1 -0
  556. package/declaration/static-semantics/ModuleRequests.d.mts +4 -0
  557. package/declaration/static-semantics/ModuleRequests.d.mts.map +1 -0
  558. package/declaration/static-semantics/NonConstructorElements.d.mts +4 -0
  559. package/declaration/static-semantics/NonConstructorElements.d.mts.map +1 -0
  560. package/declaration/static-semantics/NumericValue.d.mts +4 -0
  561. package/declaration/static-semantics/NumericValue.d.mts.map +1 -0
  562. package/declaration/static-semantics/PrivateBoundIdentifiers.d.mts +5 -0
  563. package/declaration/static-semantics/PrivateBoundIdentifiers.d.mts.map +1 -0
  564. package/declaration/static-semantics/PropName.d.mts +3 -0
  565. package/declaration/static-semantics/PropName.d.mts.map +1 -0
  566. package/declaration/static-semantics/StringToCodePoints.d.mts +3 -0
  567. package/declaration/static-semantics/StringToCodePoints.d.mts.map +1 -0
  568. package/declaration/static-semantics/StringValue.d.mts +3 -0
  569. package/declaration/static-semantics/StringValue.d.mts.map +1 -0
  570. package/declaration/static-semantics/TemplateStrings.d.mts +4 -0
  571. package/declaration/static-semantics/TemplateStrings.d.mts.map +1 -0
  572. package/declaration/static-semantics/TopLevelLexicallyDeclaredNames.d.mts +4 -0
  573. package/declaration/static-semantics/TopLevelLexicallyDeclaredNames.d.mts.map +1 -0
  574. package/declaration/static-semantics/TopLevelLexicallyScopedDeclarations.d.mts +4 -0
  575. package/declaration/static-semantics/TopLevelLexicallyScopedDeclarations.d.mts.map +1 -0
  576. package/declaration/static-semantics/TopLevelVarDeclaredNames.d.mts +4 -0
  577. package/declaration/static-semantics/TopLevelVarDeclaredNames.d.mts.map +1 -0
  578. package/declaration/static-semantics/TopLevelVarScopedDeclarations.d.mts +4 -0
  579. package/declaration/static-semantics/TopLevelVarScopedDeclarations.d.mts.map +1 -0
  580. package/declaration/static-semantics/UTF16EncodeCodePoint.d.mts +3 -0
  581. package/declaration/static-semantics/UTF16EncodeCodePoint.d.mts.map +1 -0
  582. package/declaration/static-semantics/UTF16SurrogatePairToCodePoint.d.mts +3 -0
  583. package/declaration/static-semantics/UTF16SurrogatePairToCodePoint.d.mts.map +1 -0
  584. package/declaration/static-semantics/VarDeclaredNames.d.mts +4 -0
  585. package/declaration/static-semantics/VarDeclaredNames.d.mts.map +1 -0
  586. package/declaration/static-semantics/VarScopedDeclarations.d.mts +4 -0
  587. package/declaration/static-semantics/VarScopedDeclarations.d.mts.map +1 -0
  588. package/declaration/static-semantics/all.d.mts +48 -0
  589. package/declaration/static-semantics/all.d.mts.map +1 -0
  590. package/declaration/value.d.mts +283 -0
  591. package/declaration/value.d.mts.map +1 -0
  592. package/lib/engine262.js +58136 -0
  593. package/lib/engine262.js.map +1 -0
  594. package/lib/engine262.mjs +57577 -0
  595. package/lib/engine262.mjs.map +1 -0
  596. package/lib/inspector/context.d.mts +17 -0
  597. package/lib/inspector/context.d.mts.map +1 -0
  598. package/lib/inspector/context.mjs +343 -0
  599. package/lib/inspector/context.mjs.map +1 -0
  600. package/lib/inspector/index.d.mts +15 -0
  601. package/lib/inspector/index.d.mts.map +1 -0
  602. package/lib/inspector/index.mjs +64 -0
  603. package/lib/inspector/index.mjs.map +1 -0
  604. package/lib/inspector/methods.d.mts +6 -0
  605. package/lib/inspector/methods.d.mts.map +1 -0
  606. package/lib/inspector/methods.mjs +117 -0
  607. package/lib/inspector/methods.mjs.map +1 -0
  608. package/lib/inspector/types.d.mts +208 -0
  609. package/lib/inspector/types.d.mts.map +1 -0
  610. package/lib/inspector/types.mjs +2 -0
  611. package/lib/inspector/types.mjs.map +1 -0
  612. package/lib/inspector/utils.d.mts +7 -0
  613. package/lib/inspector/utils.d.mts.map +1 -0
  614. package/lib/inspector/utils.mjs +72 -0
  615. package/lib/inspector/utils.mjs.map +1 -0
  616. package/lib/inspector.js +682 -0
  617. package/lib/inspector.js.map +1 -0
  618. package/lib/inspector.mjs +674 -0
  619. package/lib/inspector.mjs.map +1 -0
  620. package/lib/node/bin.d.mts +3 -0
  621. package/lib/node/bin.d.mts.map +1 -0
  622. package/lib/node/bin.mjs +194 -0
  623. package/lib/node/bin.mjs.map +1 -0
  624. package/lib/node/inspector.d.mts +15 -0
  625. package/lib/node/inspector.d.mts.map +1 -0
  626. package/lib/node/inspector.mjs +112 -0
  627. package/lib/node/inspector.mjs.map +1 -0
  628. package/lib/node/module.d.mts +7 -0
  629. package/lib/node/module.d.mts.map +1 -0
  630. package/lib/node/module.mjs +61 -0
  631. package/lib/node/module.mjs.map +1 -0
  632. package/lib-src/inspector/context.mts +370 -0
  633. package/lib-src/inspector/index.mts +79 -0
  634. package/lib-src/inspector/js_protocol.json +3288 -0
  635. package/lib-src/inspector/methods.mts +123 -0
  636. package/lib-src/inspector/tsconfig.json +23 -0
  637. package/lib-src/inspector/types.mts +213 -0
  638. package/lib-src/inspector/utils.mts +86 -0
  639. package/lib-src/node/bin.mts +200 -0
  640. package/lib-src/node/inspector.mts +124 -0
  641. package/lib-src/node/module.mts +64 -0
  642. package/lib-src/node/tsconfig.json +20 -0
  643. package/package.json +127 -0
  644. package/src/abstract-ops/all.mts +34 -0
  645. package/src/abstract-ops/arguments-operations.mts +246 -0
  646. package/src/abstract-ops/array-objects.mts +316 -0
  647. package/src/abstract-ops/arraybuffer-objects.mts +247 -0
  648. package/src/abstract-ops/async-function-operations.mts +43 -0
  649. package/src/abstract-ops/async-generator-objects.mts +383 -0
  650. package/src/abstract-ops/data-types-and-values.mts +43 -0
  651. package/src/abstract-ops/dataview-objects.mts +151 -0
  652. package/src/abstract-ops/date-objects.mts +232 -0
  653. package/src/abstract-ops/error-objects.mts +26 -0
  654. package/src/abstract-ops/execution-contexts.mts +80 -0
  655. package/src/abstract-ops/function-operations.mts +606 -0
  656. package/src/abstract-ops/generator-operations.mts +291 -0
  657. package/src/abstract-ops/global-object.mts +386 -0
  658. package/src/abstract-ops/immutable-prototype-objects.mts +20 -0
  659. package/src/abstract-ops/import-calls.mts +73 -0
  660. package/src/abstract-ops/iterator-operations.mts +306 -0
  661. package/src/abstract-ops/module-namespace-exotic-objects.mts +223 -0
  662. package/src/abstract-ops/module-records.mts +458 -0
  663. package/src/abstract-ops/notational-conventions.mts +53 -0
  664. package/src/abstract-ops/object-operations.mts +468 -0
  665. package/src/abstract-ops/objects.mts +435 -0
  666. package/src/abstract-ops/private-names.mts +106 -0
  667. package/src/abstract-ops/promise-operations.mts +478 -0
  668. package/src/abstract-ops/proxy-objects.mts +585 -0
  669. package/src/abstract-ops/realms.mts +517 -0
  670. package/src/abstract-ops/reference-operations.mts +211 -0
  671. package/src/abstract-ops/regexp-objects.mts +299 -0
  672. package/src/abstract-ops/spec-types.mts +239 -0
  673. package/src/abstract-ops/string-objects.mts +156 -0
  674. package/src/abstract-ops/symbol-objects.mts +30 -0
  675. package/src/abstract-ops/testing-comparison.mts +387 -0
  676. package/src/abstract-ops/type-conversion.mts +579 -0
  677. package/src/abstract-ops/typedarray-objects.mts +402 -0
  678. package/src/abstract-ops/weak-operations.mts +83 -0
  679. package/src/api-types.mts +2 -0
  680. package/src/api.mts +326 -0
  681. package/src/completion.mts +466 -0
  682. package/src/data-gen.json +1 -0
  683. package/src/engine.mts +451 -0
  684. package/src/environment.mts +1013 -0
  685. package/src/evaluator.mts +268 -0
  686. package/src/helpers.mts +538 -0
  687. package/src/inspect.mts +236 -0
  688. package/src/intrinsics/AggregateError.mts +64 -0
  689. package/src/intrinsics/AggregateErrorPrototype.mts +12 -0
  690. package/src/intrinsics/Array.mts +216 -0
  691. package/src/intrinsics/ArrayBuffer.mts +48 -0
  692. package/src/intrinsics/ArrayBufferPrototype.mts +120 -0
  693. package/src/intrinsics/ArrayIteratorPrototype.mts +25 -0
  694. package/src/intrinsics/ArrayPrototype.mts +630 -0
  695. package/src/intrinsics/ArrayPrototypeShared.mts +644 -0
  696. package/src/intrinsics/AsyncFromSyncIteratorPrototype.mts +163 -0
  697. package/src/intrinsics/AsyncFunction.mts +31 -0
  698. package/src/intrinsics/AsyncFunctionPrototype.mts +8 -0
  699. package/src/intrinsics/AsyncGeneratorFunction.mts +37 -0
  700. package/src/intrinsics/AsyncGeneratorFunctionPrototype.mts +19 -0
  701. package/src/intrinsics/AsyncGeneratorFunctionPrototypePrototype.mts +148 -0
  702. package/src/intrinsics/AsyncIteratorPrototype.mts +17 -0
  703. package/src/intrinsics/BigInt.mts +69 -0
  704. package/src/intrinsics/BigIntPrototype.mts +81 -0
  705. package/src/intrinsics/Boolean.mts +47 -0
  706. package/src/intrinsics/BooleanPrototype.mts +58 -0
  707. package/src/intrinsics/DataView.mts +82 -0
  708. package/src/intrinsics/DataViewPrototype.mts +271 -0
  709. package/src/intrinsics/Date.mts +215 -0
  710. package/src/intrinsics/DatePrototype.mts +736 -0
  711. package/src/intrinsics/Error.mts +59 -0
  712. package/src/intrinsics/ErrorPrototype.mts +62 -0
  713. package/src/intrinsics/FinalizationRegistry.mts +64 -0
  714. package/src/intrinsics/FinalizationRegistryPrototype.mts +109 -0
  715. package/src/intrinsics/ForInIteratorPrototype.mts +120 -0
  716. package/src/intrinsics/Function.mts +21 -0
  717. package/src/intrinsics/FunctionPrototype.mts +272 -0
  718. package/src/intrinsics/GeneratorFunction.mts +32 -0
  719. package/src/intrinsics/GeneratorFunctionPrototype.mts +21 -0
  720. package/src/intrinsics/GeneratorFunctionPrototypePrototype.mts +57 -0
  721. package/src/intrinsics/IteratorPrototype.mts +17 -0
  722. package/src/intrinsics/JSON.mts +570 -0
  723. package/src/intrinsics/Map.mts +98 -0
  724. package/src/intrinsics/MapIteratorPrototype.mts +79 -0
  725. package/src/intrinsics/MapPrototype.mts +226 -0
  726. package/src/intrinsics/Math.mts +178 -0
  727. package/src/intrinsics/NativeError.mts +82 -0
  728. package/src/intrinsics/Number.mts +131 -0
  729. package/src/intrinsics/NumberPrototype.mts +123 -0
  730. package/src/intrinsics/Object.mts +442 -0
  731. package/src/intrinsics/ObjectPrototype.mts +297 -0
  732. package/src/intrinsics/Promise.mts +693 -0
  733. package/src/intrinsics/PromisePrototype.mts +120 -0
  734. package/src/intrinsics/Proxy.mts +100 -0
  735. package/src/intrinsics/Reflect.mts +211 -0
  736. package/src/intrinsics/RegExp.mts +103 -0
  737. package/src/intrinsics/RegExpPrototype.mts +803 -0
  738. package/src/intrinsics/RegExpStringIteratorPrototype.mts +81 -0
  739. package/src/intrinsics/Set.mts +72 -0
  740. package/src/intrinsics/SetIteratorPrototype.mts +77 -0
  741. package/src/intrinsics/SetPrototype.mts +191 -0
  742. package/src/intrinsics/String.mts +134 -0
  743. package/src/intrinsics/StringIteratorPrototype.mts +25 -0
  744. package/src/intrinsics/StringPrototype.mts +833 -0
  745. package/src/intrinsics/Symbol.mts +103 -0
  746. package/src/intrinsics/SymbolPrototype.mts +83 -0
  747. package/src/intrinsics/ThrowTypeError.mts +21 -0
  748. package/src/intrinsics/TypedArray.mts +574 -0
  749. package/src/intrinsics/TypedArrayConstructors.mts +85 -0
  750. package/src/intrinsics/TypedArrayPrototype.mts +648 -0
  751. package/src/intrinsics/TypedArrayPrototypes.mts +17 -0
  752. package/src/intrinsics/URIHandling.mts +321 -0
  753. package/src/intrinsics/WeakMap.mts +56 -0
  754. package/src/intrinsics/WeakMapPrototype.mts +129 -0
  755. package/src/intrinsics/WeakRef.mts +42 -0
  756. package/src/intrinsics/WeakRefPrototype.mts +23 -0
  757. package/src/intrinsics/WeakSet.mts +66 -0
  758. package/src/intrinsics/WeakSetPrototype.mts +99 -0
  759. package/src/intrinsics/bootstrap.mts +145 -0
  760. package/src/intrinsics/eval.mts +25 -0
  761. package/src/intrinsics/isFinite.mts +23 -0
  762. package/src/intrinsics/isNaN.mts +23 -0
  763. package/src/intrinsics/parseFloat.mts +78 -0
  764. package/src/intrinsics/parseInt.mts +101 -0
  765. package/src/messages.mts +176 -0
  766. package/src/modules.mts +720 -0
  767. package/src/parse.mts +222 -0
  768. package/src/parser/BaseParser.mts +36 -0
  769. package/src/parser/ExpressionParser.mts +1498 -0
  770. package/src/parser/FunctionParser.mts +389 -0
  771. package/src/parser/IdentifierParser.mts +144 -0
  772. package/src/parser/LanguageParser.mts +94 -0
  773. package/src/parser/Lexer.mts +986 -0
  774. package/src/parser/ModuleParser.mts +271 -0
  775. package/src/parser/ParseNode.mts +2510 -0
  776. package/src/parser/Parser.mts +192 -0
  777. package/src/parser/RegExpParser.mts +930 -0
  778. package/src/parser/Scope.mts +535 -0
  779. package/src/parser/StatementParser.mts +958 -0
  780. package/src/parser/tokens.mts +212 -0
  781. package/src/parser/unicode.d.ts +20 -0
  782. package/src/runtime-semantics/AdditiveExpression.mts +29 -0
  783. package/src/runtime-semantics/ApplyStringOrNumericBinaryOperator.mts +78 -0
  784. package/src/runtime-semantics/ArgumentListEvaluation.mts +178 -0
  785. package/src/runtime-semantics/ArrayLiteral.mts +97 -0
  786. package/src/runtime-semantics/ArrowFunction.mts +8 -0
  787. package/src/runtime-semantics/AssignmentExpression.mts +282 -0
  788. package/src/runtime-semantics/AsyncArrowFunction.mts +8 -0
  789. package/src/runtime-semantics/AsyncFunctionExpression.mts +11 -0
  790. package/src/runtime-semantics/AsyncGeneratorExpression.mts +11 -0
  791. package/src/runtime-semantics/AwaitExpression.mts +17 -0
  792. package/src/runtime-semantics/BindingInitialization.mts +93 -0
  793. package/src/runtime-semantics/BitwiseOperators.mts +14 -0
  794. package/src/runtime-semantics/Block.mts +73 -0
  795. package/src/runtime-semantics/BreakStatement.mts +18 -0
  796. package/src/runtime-semantics/BreakableStatement.mts +18 -0
  797. package/src/runtime-semantics/CallExpression.mts +59 -0
  798. package/src/runtime-semantics/ClassDeclaration.mts +46 -0
  799. package/src/runtime-semantics/ClassDefinitionEvaluation.mts +343 -0
  800. package/src/runtime-semantics/ClassExpression.mts +32 -0
  801. package/src/runtime-semantics/ClassFieldDefinitionEvaluation.mts +61 -0
  802. package/src/runtime-semantics/ClassStaticBlockDefinitionEvaluation.mts +44 -0
  803. package/src/runtime-semantics/CoalesceExpression.mts +24 -0
  804. package/src/runtime-semantics/CommaOperator.mts +18 -0
  805. package/src/runtime-semantics/ConditionalExpression.mts +31 -0
  806. package/src/runtime-semantics/ContinueStatement.mts +18 -0
  807. package/src/runtime-semantics/CreateDynamicFunction.mts +200 -0
  808. package/src/runtime-semantics/DebuggerStatement.mts +20 -0
  809. package/src/runtime-semantics/DefineMethod.mts +42 -0
  810. package/src/runtime-semantics/DestructuringAssignmentEvaluation.mts +311 -0
  811. package/src/runtime-semantics/EmptyStatement.mts +9 -0
  812. package/src/runtime-semantics/EqualityExpression.mts +61 -0
  813. package/src/runtime-semantics/EvaluateBody.mts +196 -0
  814. package/src/runtime-semantics/EvaluateCall.mts +63 -0
  815. package/src/runtime-semantics/EvaluatePropertyAccess.mts +47 -0
  816. package/src/runtime-semantics/EvaluateStringOrNumericBinaryExpression.mts +19 -0
  817. package/src/runtime-semantics/ExponentiationExpression.mts +11 -0
  818. package/src/runtime-semantics/ExportDeclaration.mts +90 -0
  819. package/src/runtime-semantics/ExpressionStatement.mts +14 -0
  820. package/src/runtime-semantics/FunctionDeclaration.mts +11 -0
  821. package/src/runtime-semantics/FunctionDeclarationInstantiation.mts +272 -0
  822. package/src/runtime-semantics/FunctionExpression.mts +11 -0
  823. package/src/runtime-semantics/FunctionStatementList.mts +11 -0
  824. package/src/runtime-semantics/GeneratorExpression.mts +11 -0
  825. package/src/runtime-semantics/GetSubstitution.mts +119 -0
  826. package/src/runtime-semantics/GlobalDeclarationInstantiation.mts +146 -0
  827. package/src/runtime-semantics/HoistableDeclaration.mts +12 -0
  828. package/src/runtime-semantics/IdentifierReference.mts +15 -0
  829. package/src/runtime-semantics/IfStatement.mts +49 -0
  830. package/src/runtime-semantics/ImportCall.mts +43 -0
  831. package/src/runtime-semantics/ImportDeclaration.mts +9 -0
  832. package/src/runtime-semantics/ImportMeta.mts +45 -0
  833. package/src/runtime-semantics/InstantiateArrowFunctionExpression.mts +35 -0
  834. package/src/runtime-semantics/InstantiateAsyncArrowFunctionExpression.mts +37 -0
  835. package/src/runtime-semantics/InstantiateAsyncFunctionExpression.mts +75 -0
  836. package/src/runtime-semantics/InstantiateAsyncGeneratorFunctionExpression.mts +90 -0
  837. package/src/runtime-semantics/InstantiateFunctionObject.mts +123 -0
  838. package/src/runtime-semantics/InstantiateGeneratorFunctionExpression.mts +82 -0
  839. package/src/runtime-semantics/InstantiateOrdinaryFunctionExpression.mts +64 -0
  840. package/src/runtime-semantics/IteratorBindingInitialization.mts +214 -0
  841. package/src/runtime-semantics/KeyedBindingInitialization.mts +61 -0
  842. package/src/runtime-semantics/LabelledEvaluation.mts +753 -0
  843. package/src/runtime-semantics/LabelledStatement.mts +11 -0
  844. package/src/runtime-semantics/LexicalDeclaration.mts +96 -0
  845. package/src/runtime-semantics/Literal.mts +36 -0
  846. package/src/runtime-semantics/LogicalANDExpression.mts +25 -0
  847. package/src/runtime-semantics/LogicalORExpression.mts +25 -0
  848. package/src/runtime-semantics/MV.mts +10 -0
  849. package/src/runtime-semantics/MemberExpression.mts +73 -0
  850. package/src/runtime-semantics/MethodDefinitionEvaluation.mts +273 -0
  851. package/src/runtime-semantics/Module.mts +15 -0
  852. package/src/runtime-semantics/ModuleBody.mts +10 -0
  853. package/src/runtime-semantics/MultiplicativeExpression.mts +18 -0
  854. package/src/runtime-semantics/NamedEvaluation.mts +98 -0
  855. package/src/runtime-semantics/NewExpression.mts +52 -0
  856. package/src/runtime-semantics/NewTarget.mts +8 -0
  857. package/src/runtime-semantics/NumberToBigInt.mts +17 -0
  858. package/src/runtime-semantics/ObjectLiteral.mts +26 -0
  859. package/src/runtime-semantics/OptionalExpression.mts +132 -0
  860. package/src/runtime-semantics/ParenthesizedExpression.mts +8 -0
  861. package/src/runtime-semantics/PropertyBindingInitialization.mts +46 -0
  862. package/src/runtime-semantics/PropertyDefinitionEvaluation.mts +124 -0
  863. package/src/runtime-semantics/PropertyName.mts +62 -0
  864. package/src/runtime-semantics/RegExp.mts +1187 -0
  865. package/src/runtime-semantics/RegularExpressionLiteral.mts +16 -0
  866. package/src/runtime-semantics/RelationalExpression.mts +156 -0
  867. package/src/runtime-semantics/RestBindingInitialization.mts +29 -0
  868. package/src/runtime-semantics/ReturnStatement.mts +32 -0
  869. package/src/runtime-semantics/Script.mts +15 -0
  870. package/src/runtime-semantics/ScriptBody.mts +7 -0
  871. package/src/runtime-semantics/ShiftExpression.mts +17 -0
  872. package/src/runtime-semantics/StatementList.mts +31 -0
  873. package/src/runtime-semantics/StringIndexOf.mts +43 -0
  874. package/src/runtime-semantics/StringPad.mts +33 -0
  875. package/src/runtime-semantics/SuperCall.mts +65 -0
  876. package/src/runtime-semantics/SuperProperty.mts +61 -0
  877. package/src/runtime-semantics/SwitchStatement.mts +221 -0
  878. package/src/runtime-semantics/TaggedTemplateExpression.mts +23 -0
  879. package/src/runtime-semantics/TemplateLiteral.mts +34 -0
  880. package/src/runtime-semantics/This.mts +9 -0
  881. package/src/runtime-semantics/ThrowStatement.mts +22 -0
  882. package/src/runtime-semantics/TrimString.mts +19 -0
  883. package/src/runtime-semantics/TryStatement.mts +120 -0
  884. package/src/runtime-semantics/UnaryExpression.mts +219 -0
  885. package/src/runtime-semantics/Unicode.mts +555 -0
  886. package/src/runtime-semantics/UpdateExpression.mts +126 -0
  887. package/src/runtime-semantics/VariableStatement.mts +72 -0
  888. package/src/runtime-semantics/WithStatement.mts +33 -0
  889. package/src/runtime-semantics/YieldExpression.mts +175 -0
  890. package/src/runtime-semantics/all.mts +108 -0
  891. package/src/static-semantics/BodyText.mts +7 -0
  892. package/src/static-semantics/BoundNames.mts +101 -0
  893. package/src/static-semantics/CharacterValue.mts +92 -0
  894. package/src/static-semantics/CodePointAt.mts +53 -0
  895. package/src/static-semantics/CodePointsToString.mts +16 -0
  896. package/src/static-semantics/ConstructorMethod.mts +10 -0
  897. package/src/static-semantics/ContainsArguments.mts +33 -0
  898. package/src/static-semantics/ContainsExpression.mts +59 -0
  899. package/src/static-semantics/DeclarationPart.mts +5 -0
  900. package/src/static-semantics/ExpectedArgumentCount.mts +26 -0
  901. package/src/static-semantics/ExportEntries.mts +127 -0
  902. package/src/static-semantics/ExportEntriesForModule.mts +63 -0
  903. package/src/static-semantics/FlagText.mts +7 -0
  904. package/src/static-semantics/HasInitializer.mts +5 -0
  905. package/src/static-semantics/HasName.mts +8 -0
  906. package/src/static-semantics/ImportEntries.mts +36 -0
  907. package/src/static-semantics/ImportEntriesForModule.mts +95 -0
  908. package/src/static-semantics/ImportedLocalNames.mts +14 -0
  909. package/src/static-semantics/IsAnonymousFunctionDefinition.mts +18 -0
  910. package/src/static-semantics/IsComputedPropertyKey.mts +7 -0
  911. package/src/static-semantics/IsConstantDeclaration.mts +5 -0
  912. package/src/static-semantics/IsDestructuring.mts +21 -0
  913. package/src/static-semantics/IsFunctionDefinition.mts +15 -0
  914. package/src/static-semantics/IsIdentifierRef.mts +5 -0
  915. package/src/static-semantics/IsInTailPosition.mts +5 -0
  916. package/src/static-semantics/IsSimpleParameterList.mts +23 -0
  917. package/src/static-semantics/IsStatic.mts +10 -0
  918. package/src/static-semantics/IsStrict.mts +7 -0
  919. package/src/static-semantics/IsStringWellFormedUnicode.mts +24 -0
  920. package/src/static-semantics/LexicallyDeclaredNames.mts +26 -0
  921. package/src/static-semantics/LexicallyScopedDeclarations.mts +82 -0
  922. package/src/static-semantics/ModuleRequests.mts +34 -0
  923. package/src/static-semantics/NonConstructorElements.mts +15 -0
  924. package/src/static-semantics/NumericValue.mts +7 -0
  925. package/src/static-semantics/PrivateBoundIdentifiers.mts +23 -0
  926. package/src/static-semantics/PropName.mts +18 -0
  927. package/src/static-semantics/StringToCodePoints.mts +23 -0
  928. package/src/static-semantics/StringValue.mts +19 -0
  929. package/src/static-semantics/TemplateStrings.mts +108 -0
  930. package/src/static-semantics/TopLevelLexicallyDeclaredNames.mts +21 -0
  931. package/src/static-semantics/TopLevelLexicallyScopedDeclarations.mts +23 -0
  932. package/src/static-semantics/TopLevelVarDeclaredNames.mts +26 -0
  933. package/src/static-semantics/TopLevelVarScopedDeclarations.mts +34 -0
  934. package/src/static-semantics/UTF16EncodeCodePoint.mts +17 -0
  935. package/src/static-semantics/UTF16SurrogatePairToCodePoint.mts +12 -0
  936. package/src/static-semantics/VarDeclaredNames.mts +109 -0
  937. package/src/static-semantics/VarScopedDeclarations.mts +115 -0
  938. package/src/static-semantics/all.mts +47 -0
  939. package/src/syntax-error.d.ts +4 -0
  940. package/src/tsconfig.json +11 -0
  941. package/src/value.mts +981 -0
@@ -0,0 +1,2510 @@
1
+ import type { ArrowInfo } from './Scope.mts';
2
+
3
+ export interface Position {
4
+ readonly line: number;
5
+ readonly column: number;
6
+ }
7
+
8
+ export interface Location {
9
+ readonly startIndex: number;
10
+ readonly endIndex: number;
11
+ readonly start: Position;
12
+ readonly end: Position;
13
+ }
14
+
15
+ // eslint-disable-next-line @typescript-eslint/no-namespace
16
+ export namespace ParseNode {
17
+ export interface BaseParseNode {
18
+ // NOTE: while we could use `string` here, by limiting `type` to only those types defined in the `ParseNode`
19
+ // union we can ensure that new subtypes of `BaseParseNode` are correctly added to the union.
20
+ readonly type: ParseNode['type'];
21
+ readonly location: Location;
22
+ readonly strict: boolean;
23
+ readonly sourceText: () => string;
24
+ }
25
+
26
+ // A.1 Lexical Grammar
27
+ // https://tc39.es/ecma262/#sec-lexical-grammar
28
+
29
+ // PrivateIdentifier ::
30
+ // `#` IdentifierName
31
+ export interface PrivateIdentifier extends BaseParseNode {
32
+ readonly type: 'PrivateIdentifier';
33
+ readonly name: string;
34
+ }
35
+
36
+ // IdentifierName ::
37
+ // IdentifierStart
38
+ // IdentifierName IdentifierPart
39
+ export interface IdentifierName extends BaseParseNode {
40
+ readonly type: 'IdentifierName';
41
+ readonly name: string;
42
+ }
43
+
44
+ // NullLiteral ::
45
+ // `null`
46
+ export interface NullLiteral extends BaseParseNode {
47
+ readonly type: 'NullLiteral';
48
+ }
49
+
50
+ // BooleanLiteral ::
51
+ // `true`
52
+ // `false`
53
+ export interface BooleanLiteral extends BaseParseNode {
54
+ readonly type: 'BooleanLiteral';
55
+ readonly value: boolean;
56
+ }
57
+
58
+ // NumericLiteral ::
59
+ // DecimalLiteral
60
+ // DecimalBigIntegerLiteral
61
+ // NonDecimalIntegerLiteral
62
+ // NonDecimalIntegerLiteral BigIntLiteralSuffix
63
+ // LegacyOctalIntegerLiteral
64
+ export interface NumericLiteral extends BaseParseNode {
65
+ readonly type: 'NumericLiteral';
66
+ readonly value: number | bigint;
67
+ }
68
+
69
+ // StringLiteral ::
70
+ // `"` DoubleStringCharacters? `"`
71
+ // `'` SingleStringCharacters? `'`
72
+ export interface StringLiteral extends BaseParseNode {
73
+ readonly type: 'StringLiteral';
74
+ readonly value: string;
75
+ }
76
+
77
+ // RegularExpressionLiteral ::
78
+ // `/` RegularExpressionBody `/` RegularExpressionFlags
79
+ export interface RegularExpressionLiteral extends BaseParseNode {
80
+ readonly type: 'RegularExpressionLiteral';
81
+ readonly RegularExpressionBody: string;
82
+ readonly RegularExpressionFlags: string;
83
+ }
84
+
85
+ // A.2 Expressions
86
+ // https://tc39.es/ecma262/#sec-expressions
87
+
88
+ // IdentifierReference :
89
+ // Identifier
90
+ // [~Yield] `yield`
91
+ // [~Await] `await`
92
+ //
93
+ // Identifier :
94
+ // IdentifierName but not ReservedWord
95
+ export interface IdentifierReference extends BaseParseNode {
96
+ readonly type: 'IdentifierReference';
97
+ readonly escaped: boolean;
98
+ readonly name: string;
99
+ }
100
+
101
+ // BindingIdentifier :
102
+ // Identifier
103
+ // [~Yield] `yield`
104
+ // [~Await] `await`
105
+ //
106
+ // Identifier :
107
+ // IdentifierName but not ReservedWord
108
+ export interface BindingIdentifier extends BaseParseNode {
109
+ readonly type: 'BindingIdentifier';
110
+ readonly name: string;
111
+ }
112
+
113
+ // LabelIdentifier :
114
+ // Identifier
115
+ // [~Yield] `yield`
116
+ // [~Await] `await`
117
+ //
118
+ // Identifier :
119
+ // IdentifierName but not ReservedWord
120
+ export interface LabelIdentifier extends BaseParseNode {
121
+ readonly type: 'LabelIdentifier';
122
+ readonly name: string;
123
+ }
124
+
125
+ // PrimaryExpression :
126
+ // `this`
127
+ // IdentifierReference
128
+ // Literal
129
+ // ArrayLiteral
130
+ // ObjectLiteral
131
+ // FunctionExpression
132
+ // ClassExpression
133
+ // GeneratorExpression
134
+ // AsyncFunctionExpression
135
+ // AsyncGeneratorExpression
136
+ // RegularExpressionLiteral
137
+ // TemplateLiteral
138
+ // CoverParenthesizedExpressionAndArrowParameterList
139
+ export type PrimaryExpression =
140
+ | ThisExpression
141
+ | IdentifierReference
142
+ | Literal
143
+ | ArrayLiteral
144
+ | ObjectLiteral
145
+ | FunctionExpression
146
+ | ClassExpression
147
+ | GeneratorExpression
148
+ | AsyncFunctionExpression
149
+ | AsyncGeneratorExpression
150
+ | RegularExpressionLiteral
151
+ | TemplateLiteral
152
+ | CoverParenthesizedExpressionAndArrowParameterList
153
+ | ParenthesizedExpression;
154
+
155
+ // PrimaryExpression (partial) :
156
+ // `this`
157
+ export interface ThisExpression extends BaseParseNode {
158
+ readonly type: 'ThisExpression';
159
+ }
160
+
161
+ // CoverParenthesizedExpressionAndArrowParameterList :
162
+ // `(` Expression `)`
163
+ // `(` Expression `,` `)`
164
+ // `(` `)`
165
+ // `(` `...` BindingIdentifier `)`
166
+ // `(` `...` BindingPattern `)`
167
+ // `(` Expression `,` `...` BindingIdentifier `)`
168
+ // `(` Expression `.` `...` BindingPattern `)`
169
+ export interface CoverParenthesizedExpressionAndArrowParameterList extends BaseParseNode {
170
+ readonly type: 'CoverParenthesizedExpressionAndArrowParameterList';
171
+ readonly Arguments: readonly (ArgumentListElement | BindingRestElement)[];
172
+ readonly arrowInfo?: ArrowInfo;
173
+ }
174
+
175
+ // CoverParenthesizedExpressionAndArrowParameterList (partial) :
176
+ // `(` Expression `)`
177
+ //
178
+ // ParenthesizedExpression (refined) :
179
+ // `(` Expression `)`
180
+ export interface ParenthesizedExpression extends BaseParseNode {
181
+ readonly type: 'ParenthesizedExpression';
182
+ readonly Expression: Expression;
183
+ }
184
+
185
+ // Literal :
186
+ // NullLiteral
187
+ // BooleanLiteral
188
+ // NumericLiteral
189
+ // StringLiteral
190
+ export type Literal =
191
+ | NullLiteral
192
+ | BooleanLiteral
193
+ | NumericLiteral
194
+ | StringLiteral;
195
+
196
+ // ArrayLiteral :
197
+ // `[` `]`
198
+ // `[` Elision `]`
199
+ // `[` ElementList `]`
200
+ // `[` ElementList `,` `]`
201
+ // `[` ElementList `,` Elision `]`
202
+ export interface ArrayLiteral extends BaseParseNode {
203
+ readonly type: 'ArrayLiteral';
204
+ readonly ElementList: ElementList;
205
+ readonly hasTrailingComma: boolean;
206
+ }
207
+
208
+ // ElementList :
209
+ // Elision? AssignmentExpression
210
+ // Elision? SpreadElement
211
+ // ElementList `,` Elision? AssignmentExpression
212
+ // ElementList `,` Elision? SpreadElement
213
+ export type ElementList = readonly ElementListElement[];
214
+
215
+ // NON-SPEC
216
+ export type ElementListElement =
217
+ | AssignmentExpressionOrHigher
218
+ | SpreadElement
219
+ | Elision;
220
+
221
+ // Elision :
222
+ // `,`
223
+ // Elision `,`
224
+ export interface Elision extends BaseParseNode {
225
+ readonly type: 'Elision';
226
+ }
227
+
228
+ // SpreadElement :
229
+ // `...` AssignmentExpression
230
+ export interface SpreadElement extends BaseParseNode {
231
+ readonly type: 'SpreadElement';
232
+ readonly AssignmentExpression: AssignmentExpressionOrHigher;
233
+ }
234
+
235
+ // ObjectLiteral :
236
+ // `{` `}`
237
+ // `{` PropertyDefinitionList `}`
238
+ // `{` PropertyDefinitionList `,` `}`
239
+ export interface ObjectLiteral extends BaseParseNode {
240
+ readonly type: 'ObjectLiteral';
241
+ readonly PropertyDefinitionList: PropertyDefinitionList;
242
+ }
243
+
244
+ // PropertyDefinitionList :
245
+ // PropertyDefinition
246
+ // PropertyDefinitionList `,` PropertyDefinition
247
+ export type PropertyDefinitionList = readonly PropertyDefinitionLike[];
248
+
249
+ // PropertyDefinition :
250
+ // IdentifierReference
251
+ // CoverInitializedName
252
+ // PropertyName `:` AssignmentExpression
253
+ // MethodDefinition
254
+ // `...` AssignmentExpression
255
+ export type PropertyDefinitionLike =
256
+ | IdentifierReference
257
+ | CoverInitializedName
258
+ | PropertyDefinition
259
+ | MethodDefinitionLike;
260
+
261
+ // PropertyDefinition (partial) :
262
+ // PropertyName `:` AssignmentExpression
263
+ // `...` AssignmentExpression
264
+ export interface PropertyDefinition extends BaseParseNode {
265
+ readonly type: 'PropertyDefinition';
266
+ readonly PropertyName: PropertyNameLike | null;
267
+ readonly AssignmentExpression: AssignmentExpressionOrHigher;
268
+ }
269
+
270
+ // PropertyName :
271
+ // LiteralPropertyName
272
+ // ComputedPropertyName
273
+ //
274
+ // LiteralPropertyName :
275
+ // IdentifierName
276
+ // StringLiteral
277
+ // NumericLiteral
278
+ //
279
+ // ComputedPropertyName :
280
+ // `[` AssignmentExpression `]`
281
+ export type PropertyNameLike =
282
+ | PropertyName
283
+ | StringLiteral
284
+ | NumericLiteral
285
+ | IdentifierName;
286
+
287
+ // PropertyName (partial) :
288
+ // ComputedPropertyName
289
+ //
290
+ // ComputedPropertyName :
291
+ // `[` AssignmentExpression `]`
292
+ export interface PropertyName extends BaseParseNode {
293
+ readonly type: 'PropertyName';
294
+ readonly ComputedPropertyName: AssignmentExpressionOrHigher;
295
+ }
296
+
297
+ // CoverInitializedName :
298
+ // IdentifierReference Initializer
299
+ export interface CoverInitializedName extends BaseParseNode {
300
+ readonly type: 'CoverInitializedName';
301
+ readonly IdentifierReference: IdentifierReference;
302
+ readonly Initializer: Initializer | null;
303
+ }
304
+
305
+ // Initializer :
306
+ // `=` AssignmentExpression
307
+ export type Initializer = AssignmentExpressionOrHigher;
308
+
309
+ // TemplateLiteral :
310
+ // NoSubstitutionTemplate
311
+ // SubstitutionTemplate
312
+ //
313
+ // SubstitutionTemplate :
314
+ // TemplateHead Expression TemplateSpans
315
+ //
316
+ // TemplateSpans :
317
+ // TemplateTail
318
+ // TemplateMiddleList TemplateTail
319
+ //
320
+ // TemplateMiddleList :
321
+ // TemplateMiddle Expression
322
+ // TemplateMiddleList TemplateMiddle Expression
323
+ export interface TemplateLiteral extends BaseParseNode {
324
+ readonly type: 'TemplateLiteral';
325
+ readonly TemplateSpanList: readonly string[];
326
+ readonly ExpressionList: readonly Expression[];
327
+ }
328
+
329
+ // MemberExpression :
330
+ // PrimaryExpression
331
+ // MemberExpression `[` Expression `]`
332
+ // MemberExpression `.` IdentifierName
333
+ // MemberExpression TemplateLiteral
334
+ // SuperProperty
335
+ // MetaProperty
336
+ // `new` MemberExpression Arguments
337
+ // MemberExpression `.` PrivateIdentifier
338
+ export type MemberExpressionOrHigher =
339
+ | PrimaryExpression
340
+ | MemberExpression
341
+ | SuperProperty
342
+ | MetaProperty
343
+ | NewExpression;
344
+
345
+ // MemberExpression :
346
+ // MemberExpression `[` Expression `]`
347
+ // MemberExpression `.` IdentifierName
348
+ // MemberExpression `.` PrivateIdentifier
349
+ export interface MemberExpression extends BaseParseNode {
350
+ readonly type: 'MemberExpression';
351
+
352
+ /// MemberExpression : MemberExpression `[` Expression `]`
353
+ // readonly MemberExpression: LeftHandSideExpression; // NOTE: Should be MemberExpressionOrHigher
354
+ // readonly Expression: Expression | null;
355
+
356
+ /// MemberExpression : MemberExpression `.` IdentifierName
357
+ // readonly MemberExpression: LeftHandSideExpression; // NOTE: Should be MemberExpressionOrHigher
358
+ // readonly IdentifierName: IdentifierName | null;
359
+
360
+ /// MemberExpression : MemberExpression `.` PrivateIdentifier
361
+ // readonly MemberExpression: LeftHandSideExpression; // NOTE: Should be MemberExpressionOrHigher
362
+ // readonly PrivateIdentifier: PrivateIdentifier | null;
363
+
364
+ readonly MemberExpression: LeftHandSideExpression; // NOTE: Should be MemberExpressionOrHigher
365
+ readonly Expression: Expression | null;
366
+ readonly IdentifierName: IdentifierName | null;
367
+ readonly PrivateIdentifier: PrivateIdentifier | null;
368
+ }
369
+
370
+ // SuperProperty :
371
+ // super `[` Expression `]`
372
+ // super `.` IdentifierName
373
+ export interface SuperProperty extends BaseParseNode {
374
+ readonly type: 'SuperProperty';
375
+
376
+ /// SuperProperty : super `[` Expression `]`
377
+ // readonly Expression: Expression | null;
378
+
379
+ /// SuperProperty : super `.` IdentifierName
380
+ // readonly IdentifierName: IdentifierName | null;
381
+
382
+ readonly Expression: Expression | null;
383
+ readonly IdentifierName: IdentifierName | null;
384
+ }
385
+
386
+ // MetaProperty :
387
+ // NewTarget
388
+ // ImportMeta
389
+ export type MetaProperty =
390
+ | NewTarget
391
+ | ImportMeta;
392
+
393
+ // NewTarget :
394
+ // `new` `.` `target`
395
+ export interface NewTarget extends BaseParseNode {
396
+ readonly type: 'NewTarget';
397
+ }
398
+
399
+ // ImportMeta :
400
+ // `import` `.` `meta`
401
+ export interface ImportMeta extends BaseParseNode {
402
+ readonly type: 'ImportMeta';
403
+ }
404
+
405
+ // NewExpression :
406
+ // MemberExpression
407
+ // `new` NewExpression
408
+ export type NewExpressionOrHigher =
409
+ | MemberExpressionOrHigher
410
+ | NewExpression;
411
+
412
+ // NewExpression (partial) :
413
+ // `new` NewExpression
414
+ //
415
+ // MemberExpression (partial) :
416
+ // `new` MemberExpression Arguments
417
+ export interface NewExpression extends BaseParseNode {
418
+ readonly type: 'NewExpression';
419
+ // NOTE: Should be NewExpressionOrHigher | MemberExpressionOrHigher
420
+ readonly MemberExpression: LeftHandSideExpression;
421
+ readonly Arguments: Arguments | null;
422
+ }
423
+
424
+ // CallExpression :
425
+ // CoverCallExpressionAndAsyncArrowHead
426
+ // SuperCall
427
+ // ImportCall
428
+ // CallExpression Arguments
429
+ // CallExpression `[` Expression `]`
430
+ // CallExpression `.` IdentifierName
431
+ // CallExpression TemplateLiteral
432
+ // CallExpression `.` PrivateIdentifier
433
+ export type CallExpressionOrHigher =
434
+ // CoverCallExpressionAndAsyncArrowHead
435
+ | SuperCall
436
+ | ImportCall
437
+ | CallExpression
438
+ | MemberExpression
439
+ | TaggedTemplateExpression;
440
+
441
+ // CallExpression (partial) :
442
+ // CoverCallExpressionAndAsyncArrowHead
443
+ // CallExpression Arguments
444
+ //
445
+ // CallMemberExpression (refined) :
446
+ // MemberExpression Arguments
447
+ export interface CallExpression extends BaseParseNode {
448
+ readonly type: 'CallExpression';
449
+ readonly CallExpression: CallExpressionOrHigher | MemberExpressionOrHigher;
450
+ readonly Arguments: Arguments;
451
+ // NON-SPEC
452
+ readonly arrowInfo?: ArrowInfo;
453
+ }
454
+
455
+ // CallExpression (partial) :
456
+ // CallExpression TemplateLiteral
457
+ //
458
+ // MemberExpression (partial) :
459
+ // MemberExpression TemplateLiteral
460
+ export interface TaggedTemplateExpression extends BaseParseNode {
461
+ readonly type: 'TaggedTemplateExpression';
462
+ readonly MemberExpression: CallExpressionOrHigher | MemberExpressionOrHigher;
463
+ readonly TemplateLiteral: TemplateLiteral;
464
+ // NON-SPEC
465
+ readonly arrowInfo?: ArrowInfo;
466
+ }
467
+
468
+ // SuperCall :
469
+ // `super` Arguments
470
+ export interface SuperCall extends BaseParseNode {
471
+ readonly type: 'SuperCall';
472
+ readonly Arguments: Arguments;
473
+ }
474
+
475
+ // ImportCall :
476
+ // `import` `(` AssignmentExpression `)`
477
+ export interface ImportCall extends BaseParseNode {
478
+ readonly type: 'ImportCall';
479
+ readonly AssignmentExpression: AssignmentExpressionOrHigher;
480
+ }
481
+
482
+ // Arguments :
483
+ // `(` `)`
484
+ // `(` ArgumentList `)`
485
+ // `(` ArgumentList `,` `)`
486
+ //
487
+ // ArgumentList :
488
+ // AssignmentExpression
489
+ // `...` AssignmentExpression
490
+ // ArgumentList `,` AssignmentExpression
491
+ // ArgumentList `,` `...` AssignmentExpression
492
+ export type Arguments = readonly ArgumentListElement[];
493
+
494
+ // NON-SPEC
495
+ export type ArgumentListElement =
496
+ | AssignmentExpressionOrHigher
497
+ | AssignmentRestElement;
498
+
499
+ // OptionalExpression :
500
+ // MemberExpression OptionalChain
501
+ // CallExpression OptionalChain
502
+ // OptionalExpression OptionalChain
503
+ export interface OptionalExpression extends BaseParseNode {
504
+ readonly type: 'OptionalExpression';
505
+ // NOTE: The following doesn't match how this is handled in other nodes.
506
+ readonly MemberExpression: MemberExpressionOrHigher | CallExpressionOrHigher | OptionalExpression;
507
+ readonly OptionalChain: OptionalChain;
508
+ }
509
+
510
+ // OptionalChain :
511
+ // `?.` Arguments
512
+ // `?.` `[` Expression `]`
513
+ // `?.` IdentifierName
514
+ // `?.` PrivateIdentifier
515
+ // OptionalChain `?.` Arguments
516
+ // OptionalChain `?.` `[` Expression `]`
517
+ // OptionalChain `?.` IdentifierName
518
+ // OptionalChain `?.` PrivateIdentifier
519
+ export interface OptionalChain extends BaseParseNode {
520
+ readonly type: 'OptionalChain';
521
+
522
+ /// OptionalChain : `?.` Arguments
523
+ // readonly Arguments?: Arguments;
524
+
525
+ /// OptionalChain : `?.` `[` Expression `]`
526
+ // readonly Expression?: Expression;
527
+
528
+ /// OptionalChain : `?.` IdentifierName
529
+ // readonly IdentifierName?: IdentifierName;
530
+
531
+ /// OptionalChain : `?.` PrivateIdentifier
532
+ // readonly PrivateIdentifier?: PrivateIdentifier;
533
+
534
+ /// OptionalChain : OptionalChain `?.` Arguments
535
+ // readonly OptionalChain: OptionalChain | null;
536
+ // readonly Arguments?: Arguments;
537
+
538
+ /// OptionalChain : OptionalChain `?.` `[` Expression `]`
539
+ // readonly OptionalChain: OptionalChain | null;
540
+ // readonly Expression?: Expression;
541
+
542
+ /// OptionalChain : OptionalChain `?.` IdentifierName
543
+ // readonly OptionalChain: OptionalChain | null;
544
+ // readonly IdentifierName?: IdentifierName;
545
+
546
+ /// OptionalChain : OptionalChain `?.` PrivateIdentifier
547
+ // readonly OptionalChain: OptionalChain | null;
548
+ // readonly PrivateIdentifier?: PrivateIdentifier;
549
+
550
+ readonly OptionalChain: OptionalChain | null;
551
+ readonly Arguments?: Arguments;
552
+ readonly Expression?: Expression;
553
+ readonly IdentifierName?: IdentifierName;
554
+ readonly PrivateIdentifier?: PrivateIdentifier;
555
+ }
556
+
557
+ // LeftHandSideExpression :
558
+ // NewExpression
559
+ // CallExpression
560
+ // OptionalExpression
561
+ export type LeftHandSideExpression =
562
+ | NewExpressionOrHigher
563
+ | CallExpressionOrHigher
564
+ | OptionalExpression;
565
+
566
+ // UpdateExpression :
567
+ // LeftHandSideExpression
568
+ // LeftHandSideExpression [no LineTerminator here] `++`
569
+ // LeftHandSideExpression [no LineTerminator here] `--`
570
+ // `++` UnaryExpression
571
+ // `--` UnaryExpression
572
+ export type UpdateExpressionOrHigher =
573
+ | LeftHandSideExpression
574
+ | UpdateExpression;
575
+
576
+ // UpdateExpression (partial) :
577
+ // LeftHandSideExpression [no LineTerminator here] `++`
578
+ // LeftHandSideExpression [no LineTerminator here] `--`
579
+ // `++` UnaryExpression
580
+ // `--` UnaryExpression
581
+ export interface UpdateExpression extends BaseParseNode {
582
+ readonly type: 'UpdateExpression';
583
+
584
+ /// UpdateExpression :
585
+ /// LeftHandSideExpression [no LineTerminator here] `++`
586
+ /// LeftHandSideExpression [no LineTerminator here] `--`
587
+ // readonly LeftHandSideExpression: LeftHandSideExpression | null;
588
+ // readonly operator: '++' | '--';
589
+
590
+ /// UpdateExpression :
591
+ /// `++` UnaryExpression
592
+ /// `--` UnaryExpression
593
+ // readonly operator: '++' | '--';
594
+ // readonly UnaryExpression: UnaryExpressionOrHigher | null;
595
+
596
+ readonly operator: '++' | '--';
597
+ readonly LeftHandSideExpression: LeftHandSideExpression | null;
598
+ readonly UnaryExpression: UnaryExpressionOrHigher | null;
599
+ }
600
+
601
+ // UnaryExpression :
602
+ // UpdateExpression
603
+ // `delete` UnaryExpression
604
+ // `void` UnaryExpression
605
+ // `typeof` UnaryExpression
606
+ // `+` UnaryExpression
607
+ // `-` UnaryExpression
608
+ // `~` UnaryExpression
609
+ // `!` UnaryExpression
610
+ // [+Await] AwaitExpression
611
+ export type UnaryExpressionOrHigher =
612
+ | UpdateExpressionOrHigher
613
+ | UnaryExpression
614
+ | AwaitExpression;
615
+
616
+ // UnaryExpression (partial) :
617
+ // `delete` UnaryExpression
618
+ // `void` UnaryExpression
619
+ // `typeof` UnaryExpression
620
+ // `+` UnaryExpression
621
+ // `-` UnaryExpression
622
+ // `~` UnaryExpression
623
+ // `!` UnaryExpression
624
+ export interface UnaryExpression extends BaseParseNode {
625
+ readonly type: 'UnaryExpression';
626
+ readonly operator: 'delete' | 'void' | 'typeof' | '+' | '-' | '~' | '!';
627
+ readonly UnaryExpression: UnaryExpressionOrHigher;
628
+ }
629
+
630
+ // ExponentiationExpression :
631
+ // UnaryExpression
632
+ // UpdateExpresion `**` ExponentiationExpression
633
+ export type ExponentiationExpressionOrHigher =
634
+ | UnaryExpressionOrHigher
635
+ | ExponentiationExpression;
636
+
637
+ // ExponentiationExpression (partial) :
638
+ // UpdateExpresion `**` ExponentiationExpression
639
+ export interface ExponentiationExpression extends BaseParseNode {
640
+ readonly type: 'ExponentiationExpression';
641
+ readonly UpdateExpression: UpdateExpressionOrHigher;
642
+ readonly ExponentiationExpression: ExponentiationExpressionOrHigher;
643
+ }
644
+
645
+ // MultiplicativeExpression :
646
+ // ExponentiationExpression
647
+ // MultiplicativeExpression MultiplicativeOperator ExponentiationExpression
648
+ export type MultiplicativeExpressionOrHigher =
649
+ | ExponentiationExpressionOrHigher
650
+ | MultiplicativeExpression;
651
+
652
+ // MultiplicativeExpression (partial) :
653
+ // MultiplicativeExpression MultiplicativeOperator ExponentiationExpression
654
+ export interface MultiplicativeExpression extends BaseParseNode {
655
+ readonly type: 'MultiplicativeExpression';
656
+ readonly MultiplicativeExpression: MultiplicativeExpressionOrHigher;
657
+ readonly MultiplicativeOperator: MultiplicativeOperator;
658
+ readonly ExponentiationExpression: ExponentiationExpressionOrHigher;
659
+ }
660
+
661
+ // MultiplicativeOperator : one of
662
+ // `*` `/` `%`;
663
+ export type MultiplicativeOperator = '*' | '/' | '%';
664
+
665
+ // AdditiveExpression :
666
+ // MultiplicativeExpression
667
+ // AdditiveExpression `+` MultiplicativeExpression
668
+ // AdditiveExpression `-` MultiplicativeExpression
669
+ export type AdditiveExpressionOrHigher =
670
+ | MultiplicativeExpressionOrHigher
671
+ | AdditiveExpression;
672
+
673
+ // AdditiveExpression (partial) :
674
+ // AdditiveExpression `+` MultiplicativeExpression
675
+ // AdditiveExpression `-` MultiplicativeExpression
676
+ export interface AdditiveExpression extends BaseParseNode {
677
+ readonly type: 'AdditiveExpression';
678
+ readonly operator: '+' | '-';
679
+ readonly AdditiveExpression: AdditiveExpressionOrHigher;
680
+ readonly MultiplicativeExpression: MultiplicativeExpressionOrHigher;
681
+ }
682
+
683
+ // ShiftExpression :
684
+ // AdditiveExpression
685
+ // ShiftExpression `<<` AdditiveExpression
686
+ // ShiftExpression `>>` AdditiveExpression
687
+ // ShiftExpression `>>>` AdditiveExpression
688
+ export type ShiftExpressionOrHigher =
689
+ | AdditiveExpressionOrHigher
690
+ | ShiftExpression;
691
+
692
+ // ShiftExpression (partial) :
693
+ // ShiftExpression `<<` AdditiveExpression
694
+ // ShiftExpression `>>` AdditiveExpression
695
+ // ShiftExpression `>>>` AdditiveExpression
696
+ export interface ShiftExpression extends BaseParseNode {
697
+ readonly type: 'ShiftExpression';
698
+ readonly operator: '<<' | '>>' | '>>>';
699
+ readonly ShiftExpression: ShiftExpressionOrHigher;
700
+ readonly AdditiveExpression: AdditiveExpressionOrHigher;
701
+ }
702
+
703
+ // RelationalExpression :
704
+ // ShiftExpression
705
+ // RelationalExpression `<` ShiftExpression
706
+ // RelationalExpression `>` ShiftExpression
707
+ // RelationalExpression `<=` ShiftExpression
708
+ // RelationalExpression `>=` ShiftExpression
709
+ // RelationalExpression `instanceof` ShiftExpression
710
+ // RelationalExpression `in` ShiftExpression
711
+ export type RelationalExpressionOrHigher =
712
+ | ShiftExpressionOrHigher
713
+ | RelationalExpression;
714
+
715
+ // RelationalExpression (partial) :
716
+ // RelationalExpression `<` ShiftExpression
717
+ // RelationalExpression `>` ShiftExpression
718
+ // RelationalExpression `<=` ShiftExpression
719
+ // RelationalExpression `>=` ShiftExpression
720
+ // RelationalExpression `instanceof` ShiftExpression
721
+ // RelationalExpression `in` ShiftExpression
722
+ // PrivateIdentifier `in` ShiftExpression
723
+ export interface RelationalExpression extends BaseParseNode {
724
+ readonly type: 'RelationalExpression';
725
+ readonly operator: '<' | '>' | '<=' | '>=' | 'instanceof' | 'in';
726
+ readonly PrivateIdentifier?: PrivateIdentifier;
727
+ readonly RelationalExpression?: RelationalExpressionOrHigher;
728
+ readonly ShiftExpression: ShiftExpressionOrHigher;
729
+ }
730
+
731
+ // EqualityExpression :
732
+ // RelationalExpression
733
+ // EqualityExpression == RelationalExpression
734
+ // EqualityExpression != RelationalExpression
735
+ // EqualityExpression === RelationalExpression
736
+ // EqualityExpression !== RelationalExpression
737
+ export type EqualityExpressionOrHigher =
738
+ | RelationalExpressionOrHigher
739
+ | EqualityExpression;
740
+
741
+ // EqualityExpression (partial) :
742
+ // EqualityExpression == RelationalExpression
743
+ // EqualityExpression != RelationalExpression
744
+ // EqualityExpression === RelationalExpression
745
+ // EqualityExpression !== RelationalExpression
746
+ export interface EqualityExpression extends BaseParseNode {
747
+ readonly type: 'EqualityExpression';
748
+ readonly operator: '==' | '!=' | '===' | '!==';
749
+ readonly EqualityExpression: EqualityExpressionOrHigher;
750
+ readonly RelationalExpression: RelationalExpressionOrHigher;
751
+ }
752
+
753
+ // BitwiseANDExpression :
754
+ // EqualityExpression
755
+ // BitwiseANDExpression `^&` EqualityExpression
756
+ export type BitwiseANDExpressionOrHigher =
757
+ | EqualityExpressionOrHigher
758
+ | BitwiseANDExpression;
759
+
760
+ // BitwiseANDExpression (partial) :
761
+ // BitwiseANDExpression `^&` EqualityExpression
762
+ export interface BitwiseANDExpression extends BaseParseNode {
763
+ readonly type: 'BitwiseANDExpression';
764
+ readonly operator: '&';
765
+ readonly A: BitwiseANDExpressionOrHigher;
766
+ readonly B: EqualityExpressionOrHigher;
767
+ }
768
+
769
+ // BitwiseXORExpression :
770
+ // BitwiseANDExpression
771
+ // BitwiseXORExpression `^` BitwiseANDExpression
772
+ export type BitwiseXORExpressionOrHigher =
773
+ | BitwiseANDExpressionOrHigher
774
+ | BitwiseXORExpression;
775
+
776
+ // BitwiseXORExpression (partial) :
777
+ // BitwiseXORExpression `^` BitwiseANDExpression
778
+ export interface BitwiseXORExpression extends BaseParseNode {
779
+ readonly type: 'BitwiseXORExpression';
780
+ readonly operator: '^';
781
+ readonly A: BitwiseXORExpressionOrHigher;
782
+ readonly B: BitwiseANDExpressionOrHigher;
783
+ }
784
+
785
+ // BitwiseORExpression :
786
+ // BitwiseXORExpression
787
+ // BitwiseORExpression `|` BitwiseXORExpression
788
+ export type BitwiseORExpressionOrHigher =
789
+ | BitwiseXORExpressionOrHigher
790
+ | BitwiseORExpression;
791
+
792
+ // BitwiseORExpression (partial) :
793
+ // BitwiseORExpression `|` BitwiseXORExpression
794
+ export interface BitwiseORExpression extends BaseParseNode {
795
+ readonly type: 'BitwiseORExpression';
796
+ readonly operator: '|';
797
+ readonly A: BitwiseORExpressionOrHigher;
798
+ readonly B: BitwiseXORExpressionOrHigher;
799
+ }
800
+
801
+ // LogicalANDExpression :
802
+ // BitwiseORExpression
803
+ // LogicalANDExpression `&&` BitwiseORExpression
804
+ export type LogicalANDExpressionOrHigher =
805
+ | BitwiseORExpressionOrHigher
806
+ | LogicalANDExpression;
807
+
808
+ // LogicalANDExpression (partial) :
809
+ // LogicalANDExpression `&&` BitwiseORExpression
810
+ export interface LogicalANDExpression extends BaseParseNode {
811
+ readonly type: 'LogicalANDExpression';
812
+ readonly LogicalANDExpression: LogicalANDExpressionOrHigher;
813
+ readonly BitwiseORExpression: BitwiseORExpressionOrHigher;
814
+ }
815
+
816
+ // LogicalORExpression :
817
+ // LogicalANDExpression
818
+ // LogicalORExpression `||` LogicalANDExpression
819
+ export type LogicalORExpressionOrHigher =
820
+ | LogicalANDExpressionOrHigher
821
+ | LogicalORExpression;
822
+
823
+ // LogicalORExpression (partial) :
824
+ // LogicalORExpression `||` LogicalANDExpression
825
+ export interface LogicalORExpression extends BaseParseNode {
826
+ readonly type: 'LogicalORExpression';
827
+ readonly LogicalORExpression: LogicalORExpressionOrHigher;
828
+ readonly LogicalANDExpression: LogicalANDExpressionOrHigher;
829
+ }
830
+
831
+ // CoalesceExpression :
832
+ // CoalesceExpressionHead `??` BitwiseORExpression
833
+ export interface CoalesceExpression extends BaseParseNode {
834
+ readonly type: 'CoalesceExpression';
835
+ readonly CoalesceExpressionHead: CoalesceExpressionHead;
836
+ readonly BitwiseORExpression: BitwiseORExpressionOrHigher;
837
+ }
838
+
839
+ // CoalesceExpressionHead :
840
+ // CoalesceExpression
841
+ // BitwiseORExpression
842
+ export type CoalesceExpressionHead =
843
+ | BitwiseORExpressionOrHigher
844
+ | CoalesceExpression;
845
+
846
+ // ShortCircuitExpression :
847
+ // LogicalORExpression
848
+ // CoalesceExpression
849
+ export type ShortCircuitExpressionOrHigher =
850
+ | LogicalORExpressionOrHigher
851
+ | CoalesceExpression;
852
+
853
+ // ConditionalExpression :
854
+ // ShortCircuitExpression
855
+ // ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression
856
+ export type ConditionalExpressionOrHigher =
857
+ | ShortCircuitExpressionOrHigher
858
+ | ConditionalExpression;
859
+
860
+ // ConditionalExpression (partial) :
861
+ // ShortCircuitExpression `?` AssignmentExpression `:` AssignmentExpression
862
+ export interface ConditionalExpression extends BaseParseNode {
863
+ readonly type: 'ConditionalExpression';
864
+ readonly ShortCircuitExpression: ShortCircuitExpressionOrHigher;
865
+ readonly AssignmentExpression_a: AssignmentExpressionOrHigher;
866
+ readonly AssignmentExpression_b: AssignmentExpressionOrHigher;
867
+ }
868
+
869
+ // AssignmentExpression :
870
+ // ConditionalExpression
871
+ // [+Yield] YieldExpression
872
+ // ArrowFunction
873
+ // AsyncArrowFunction
874
+ // LeftHandSideExpression `=` AssignmentExpression
875
+ // LeftHandSideExpression AssignmentOperator AssignmentExpression
876
+ // LeftHandSideExpression LogicalAssignmentOperator AssignmentExpression
877
+ export type AssignmentExpressionOrHigher =
878
+ | ConditionalExpressionOrHigher
879
+ | YieldExpression
880
+ | ArrowFunction
881
+ | AsyncArrowFunction
882
+ | AssignmentExpression;
883
+
884
+ // AssignmentExpression (partial) :
885
+ // LeftHandSideExpression `=` AssignmentExpression
886
+ // LeftHandSideExpression AssignmentOperator AssignmentExpression
887
+ // LeftHandSideExpression LogicalAssignmentOperator AssignmentExpression
888
+ //
889
+ export interface AssignmentExpression extends BaseParseNode {
890
+ readonly type: 'AssignmentExpression';
891
+ // NOTE: Should be LeftHandSideExpression, but some invalid nodes are allowed as they report early errors
892
+ readonly LeftHandSideExpression: AssignmentExpressionOrHigher;
893
+ readonly AssignmentOperator: '=' | AssignmentOperator | '&&=' | '||=' | '??=';
894
+ readonly AssignmentExpression: AssignmentExpressionOrHigher;
895
+ }
896
+
897
+ // AssignmentOperator : one of
898
+ // `*=` `/=` `%=` `+=` `-=` `<<=` `>>=` `>>>=` `&=` `^=` `|=` `**=`
899
+ export type AssignmentOperator = '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' | '>>=' | '>>>=' | '&=' | '^=' | '|=' | '**=';
900
+
901
+ // AssignmentRestElement :
902
+ // `...` DestructuringAssignmentTarget
903
+ //
904
+ // ArgumentList (partial) :
905
+ // `...` AssignmentExpression
906
+ // ArgumentList `,` `...` AssignmentExpression
907
+ export interface AssignmentRestElement extends BaseParseNode {
908
+ readonly type: 'AssignmentRestElement';
909
+ readonly AssignmentExpression: AssignmentExpressionOrHigher;
910
+ }
911
+
912
+ // NON-SPEC
913
+ export type BinaryExpressionOrHigher =
914
+ | BinaryExpression
915
+ | UnaryExpressionOrHigher;
916
+
917
+ // NON-SPEC
918
+ export type BinaryExpression =
919
+ | AssignmentExpression
920
+ | LogicalORExpression
921
+ | LogicalANDExpression
922
+ | BitwiseORExpression
923
+ | BitwiseXORExpression
924
+ | BitwiseANDExpression
925
+ | RelationalExpression
926
+ | EqualityExpression
927
+ | ShiftExpression
928
+ | AdditiveExpression
929
+ | MultiplicativeExpression
930
+ | ExponentiationExpression;
931
+
932
+ // Expression :
933
+ // AssignmentExpression
934
+ // Expression `,` AssignmentExpression
935
+ export type Expression =
936
+ | CommaOperator
937
+ | AssignmentExpressionOrHigher;
938
+
939
+ // Expression (partial) :
940
+ // Expression `,` AssignmentExpression
941
+ export interface CommaOperator extends BaseParseNode {
942
+ readonly type: 'CommaOperator';
943
+ readonly ExpressionList: readonly AssignmentExpressionOrHigher[];
944
+ }
945
+
946
+ // A.3 Statements
947
+ // https://tc39.es/ecma262/#sec-statements
948
+
949
+ // Statement :
950
+ // BlockStatement
951
+ // VariableStatement
952
+ // EmptyStatement
953
+ // ExpressionStatement
954
+ // IfStatement
955
+ // BreakableStatement
956
+ // ContinueStatement
957
+ // BreakStatement
958
+ // [+Return] ReturnStatement
959
+ // WithStatement
960
+ // LabelledStatement
961
+ // ThrowStatement
962
+ // TryStatement
963
+ // DebuggerStatement
964
+ export type Statement =
965
+ | BlockStatement
966
+ | VariableStatement
967
+ | EmptyStatement
968
+ | ExpressionStatement
969
+ | IfStatement
970
+ | BreakableStatement
971
+ | ContinueStatement
972
+ | BreakStatement
973
+ | ReturnStatement
974
+ | WithStatement
975
+ | LabelledStatement
976
+ | ThrowStatement
977
+ | TryStatement
978
+ | DebuggerStatement;
979
+
980
+ // Declaration :
981
+ // HoistableDeclaration
982
+ // ClassDeclaration
983
+ // LexicalDeclarationLike
984
+ export type Declaration =
985
+ | HoistableDeclaration
986
+ | ClassDeclaration
987
+ | LexicalDeclarationLike;
988
+
989
+ // HoistableDeclaration
990
+ // FunctionDeclaration
991
+ // GeneratorDeclaration
992
+ // AsyncFunctionDeclaration
993
+ // AsyncGeneratorDeclaration
994
+ export type HoistableDeclaration =
995
+ | FunctionDeclaration
996
+ | GeneratorDeclaration
997
+ | AsyncFunctionDeclaration
998
+ | AsyncGeneratorDeclaration;
999
+
1000
+ // BreakableStatement :
1001
+ // IterationStatement
1002
+ // SwitchStatement
1003
+ export type BreakableStatement =
1004
+ | IterationStatement
1005
+ | SwitchStatement;
1006
+
1007
+ // BlockStatement :
1008
+ // Block
1009
+ export type BlockStatement =
1010
+ | Block;
1011
+
1012
+ // Block :
1013
+ // `{` StatementList `}`
1014
+ export interface Block extends BaseParseNode {
1015
+ readonly type: 'Block';
1016
+ readonly StatementList: StatementList;
1017
+ }
1018
+
1019
+ // StatementList :
1020
+ // StatementListItem
1021
+ // StatementList StatementListItem
1022
+ export type StatementList = readonly StatementListItem[];
1023
+
1024
+ // StatementListItem :
1025
+ // Statement
1026
+ // Declaration
1027
+ export type StatementListItem =
1028
+ | Statement
1029
+ | Declaration;
1030
+
1031
+ // LexicalDeclaration :
1032
+ // LetOrConst BindingList `;`
1033
+ export type LexicalDeclarationLike =
1034
+ | LexicalDeclaration;
1035
+
1036
+ // LexicalDeclaration :
1037
+ // LetOrConst BindingList `;`
1038
+ export interface LexicalDeclaration extends BaseParseNode {
1039
+ readonly type: 'LexicalDeclaration';
1040
+ readonly LetOrConst: LetOrConst;
1041
+ readonly BindingList: BindingList;
1042
+ }
1043
+
1044
+ // LetOrConst :
1045
+ // `let`
1046
+ // `const`
1047
+ export type LetOrConst =
1048
+ | 'let'
1049
+ | 'const';
1050
+
1051
+ // BindingList :
1052
+ // LexicalBinding
1053
+ // BindingList `,` LexicalBinding
1054
+ export type BindingList = readonly LexicalBinding[];
1055
+
1056
+ // LexicalBinding :
1057
+ // BindingIdentifier Initializer?
1058
+ // BindingPattern Initializer
1059
+ export interface LexicalBinding extends BaseParseNode {
1060
+ readonly type: 'LexicalBinding';
1061
+
1062
+ // LexicalBinding : BindingIdentifier Initializer?
1063
+ readonly BindingIdentifier?: BindingIdentifier;
1064
+
1065
+ // LexicalBinding : BindingPattern Initializer
1066
+ readonly BindingPattern?: BindingPattern;
1067
+
1068
+ readonly Initializer: Initializer | null;
1069
+ }
1070
+
1071
+ // VariableStatement :
1072
+ // `var` VariableDeclarationList `;`
1073
+ export interface VariableStatement extends BaseParseNode {
1074
+ readonly type: 'VariableStatement';
1075
+ readonly VariableDeclarationList: VariableDeclarationList;
1076
+ }
1077
+
1078
+ // VariableDeclarationList :
1079
+ // VariableDeclaration
1080
+ // VariableDeclarationList `,` VariableDeclaration
1081
+ export type VariableDeclarationList = readonly VariableDeclaration[];
1082
+
1083
+ // VariableDeclaration :
1084
+ // BindingIdentifier Initializer?
1085
+ // BindingPattern Initializer
1086
+ export interface VariableDeclaration extends BaseParseNode {
1087
+ readonly type: 'VariableDeclaration';
1088
+ readonly BindingPattern?: BindingPattern;
1089
+ readonly BindingIdentifier?: BindingIdentifier;
1090
+ readonly Initializer: Initializer | null;
1091
+ }
1092
+
1093
+ // BindingPattern :
1094
+ // ObjectBindingPattern
1095
+ // ArrayBindingPattern
1096
+ export type BindingPattern =
1097
+ | ObjectBindingPattern
1098
+ | ArrayBindingPattern;
1099
+
1100
+ // ObjectBindingPattern :
1101
+ // `{` `}`
1102
+ // `{` BindingRestProperty `}`
1103
+ // `{` BindingPropertyList `}`
1104
+ // `{` BindingPropertyList `,` BindingRestProperty? `}`
1105
+ export interface ObjectBindingPattern extends BaseParseNode {
1106
+ readonly type: 'ObjectBindingPattern';
1107
+ readonly BindingPropertyList: BindingPropertyList;
1108
+ readonly BindingRestProperty?: BindingRestProperty;
1109
+ }
1110
+
1111
+ // ArrayBindingPattern :
1112
+ // `[` Elision? BindingRestElement `]`
1113
+ // `[` BindingElementList `]`
1114
+ // `[` BindingElementList `,` Elision? BindingRestElement `]`
1115
+ export interface ArrayBindingPattern extends BaseParseNode {
1116
+ readonly type: 'ArrayBindingPattern';
1117
+ readonly BindingElementList: BindingElementList;
1118
+ readonly BindingRestElement: BindingRestElement;
1119
+ }
1120
+
1121
+ // BindingRestProperty :
1122
+ // `...` BindingIdentifier
1123
+ export interface BindingRestProperty extends BaseParseNode {
1124
+ readonly type: 'BindingRestProperty';
1125
+ readonly BindingIdentifier: BindingIdentifier;
1126
+ }
1127
+
1128
+ // BindingPropertyList :
1129
+ // BindingProperty
1130
+ // BindingPropertyList BindingProperty
1131
+ export type BindingPropertyList = readonly BindingPropertyLike[];
1132
+
1133
+ // BindingElementList :
1134
+ // BindingElisionElement
1135
+ // BindingElementList `,` BindingElisionElement
1136
+ export type BindingElementList = readonly BindingElisionElement[];
1137
+
1138
+ // BindingElisionElement :
1139
+ // Elision? BindingElement
1140
+ export type BindingElisionElement =
1141
+ | BindingElementLike
1142
+ | Elision;
1143
+
1144
+ // BindingProperty :
1145
+ // SingleNameBinding
1146
+ // PropertyName `:` BindingElement
1147
+ export type BindingPropertyLike =
1148
+ | BindingProperty
1149
+ | SingleNameBinding;
1150
+
1151
+ // BindingProperty :
1152
+ // PropertyName `:` BindingElement
1153
+ export interface BindingProperty extends BaseParseNode {
1154
+ readonly type: 'BindingProperty';
1155
+ readonly PropertyName: PropertyNameLike;
1156
+ readonly BindingElement: BindingElementLike;
1157
+ }
1158
+
1159
+ // BindingElement :
1160
+ // SingleNameBinding
1161
+ // BindingPattern Initializer?
1162
+ export type BindingElementLike =
1163
+ | BindingElement
1164
+ | SingleNameBinding;
1165
+
1166
+ // BindingElement (partial) :
1167
+ // BindingPattern Initializer?
1168
+ export interface BindingElement extends BaseParseNode {
1169
+ readonly type: 'BindingElement';
1170
+ readonly BindingPattern: BindingPattern;
1171
+ readonly Initializer: Initializer | null;
1172
+ }
1173
+
1174
+ // SingleNameBinding :
1175
+ // BindingIdentifier Initializer?
1176
+ export interface SingleNameBinding extends BaseParseNode {
1177
+ readonly type: 'SingleNameBinding';
1178
+ readonly BindingIdentifier: BindingIdentifier;
1179
+ readonly Initializer: Initializer | null;
1180
+ }
1181
+
1182
+ // BindingRestElement :
1183
+ // `...` BindingIdentifier
1184
+ // `...` BindingPattern
1185
+ export interface BindingRestElement extends BaseParseNode {
1186
+ readonly type: 'BindingRestElement';
1187
+ readonly BindingIdentifier?: BindingIdentifier;
1188
+ readonly BindingPattern?: BindingPattern;
1189
+ }
1190
+
1191
+ // EmptyStatement :
1192
+ // `;`
1193
+ export interface EmptyStatement extends BaseParseNode {
1194
+ readonly type: 'EmptyStatement';
1195
+ }
1196
+
1197
+ // ExpressionStatement :
1198
+ // [lookahead != `{`, `function`, `async` [no LineTerminator here] `function`, `class`, `let` `[` ] Expression `;`
1199
+ export interface ExpressionStatement extends BaseParseNode {
1200
+ readonly type: 'ExpressionStatement';
1201
+ readonly Expression: Expression;
1202
+ }
1203
+
1204
+ // IfStatement :
1205
+ // `if` `(` Expression `)` Statement `else` Statement
1206
+ // `if` `(` Expression `)` Statement [lookahead ≠ `else`]
1207
+ export interface IfStatement extends BaseParseNode {
1208
+ readonly type: 'IfStatement';
1209
+ readonly Expression: Expression;
1210
+ readonly Statement_a: Statement;
1211
+ readonly Statement_b: Statement;
1212
+ }
1213
+
1214
+ // IterationStatement :
1215
+ // DoWhileStatement
1216
+ // WhileStatement
1217
+ // ForStatement
1218
+ // ForInOfStatement
1219
+ export type IterationStatement =
1220
+ | DoWhileStatement
1221
+ | WhileStatement
1222
+ | ForStatement
1223
+ | ForInOfStatement;
1224
+
1225
+ // DoWhileStatement :
1226
+ // `do` Statement `while` `(` Expression `)` `;`
1227
+ export interface DoWhileStatement extends BaseParseNode {
1228
+ readonly type: 'DoWhileStatement';
1229
+ readonly Statement: Statement;
1230
+ readonly Expression: Expression;
1231
+ }
1232
+
1233
+ // WhileStatement :
1234
+ // `while` `(` Expression `)` Statement
1235
+ export interface WhileStatement extends BaseParseNode {
1236
+ readonly type: 'WhileStatement';
1237
+ readonly Expression: Expression;
1238
+ readonly Statement: Statement;
1239
+ }
1240
+
1241
+ // ForStatement :
1242
+ // `for` `(` [lookahead != `let` `[`] Expression? `;` Expression? `;` Expression? `)` Statement
1243
+ // `for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement
1244
+ // `for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement
1245
+ export interface ForStatement extends BaseParseNode {
1246
+ readonly type: 'ForStatement';
1247
+
1248
+ /// ForStatement : `for` `(` [lookahead != `let` `[`] Expression? `;` Expression? `;` Expression? `)` Statement
1249
+ // Expression_a?: Expression;
1250
+ // Expression_b?: Expression;
1251
+ // Expression_c?: Expression;
1252
+ // Statement: Statement;
1253
+
1254
+ /// ForStatement : `for` `(` `var` VariableDeclarationList `;` Expression? `;` Expression? `)` Statement
1255
+ // VariableDeclarationList: VariableDeclarationList;
1256
+ // Expression_a?: Expression;
1257
+ // Expression_b?: Expression;
1258
+ // Statement: Statement;
1259
+
1260
+ /// ForStatement : `for` `(` LexicalDeclaration Expression? `;` Expression? `)` Statement
1261
+ // LexicalDeclaration?: LexicalDeclarationLike;
1262
+ // Expression_a?: Expression;
1263
+ // Expression_b?: Expression;
1264
+ // Statement: Statement;
1265
+
1266
+ readonly VariableDeclarationList: VariableDeclarationList;
1267
+ readonly LexicalDeclaration?: LexicalDeclarationLike;
1268
+ readonly Expression_a?: Expression;
1269
+ readonly Expression_b?: Expression;
1270
+ readonly Expression_c?: Expression;
1271
+ readonly Statement: Statement;
1272
+ }
1273
+
1274
+ // ForInOfStatement :
1275
+ // `for` `(` [lookahead != `let` `[`] LeftHandSideExpression `in` Expression `)` Statement
1276
+ // `for` `(` `var` ForBinding `in` Expression `)` Statement
1277
+ // `for` `(` ForDeclaration `in` Expression `)` Statement
1278
+ // `for` `(` [lookahead != { `let`, `async` `of` }] LeftHandSideExpression `of` AssignmentExpression `)` Statement
1279
+ // `for` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
1280
+ // `for` `(` ForDeclaration `of` AssignmentExpression `)` Statement
1281
+ // `for` `await` `(` [lookahead != `let`] LeftHandSideExpression `of` AssignmentExpression `)` Statement
1282
+ // `for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
1283
+ // `for` `await` `(` ForDeclaration `of` AssignmentExpression `)` Statement
1284
+ export type ForInOfStatement =
1285
+ | ForInStatement
1286
+ | ForOfStatement
1287
+ | ForAwaitStatement;
1288
+
1289
+ // ForInOfStatement (partial) :
1290
+ // `for` `(` [lookahead != `let` `[`] LeftHandSideExpression `in` Expression `)` Statement
1291
+ // `for` `(` `var` ForBinding `in` Expression `)` Statement
1292
+ // `for` `(` ForDeclaration `in` Expression `)` Statement
1293
+ export interface ForInStatement extends BaseParseNode {
1294
+ readonly type: 'ForInStatement';
1295
+
1296
+ /// ForInStatement : `for` `(` [lookahead != `let` `[`] LeftHandSideExpression `in` Expression `)` Statement
1297
+ // LeftHandSideExpression?: LeftHandSideExpression;
1298
+ // Expression: Expression;
1299
+ // Statement: Statement;
1300
+
1301
+ /// ForInStatement : `for` `(` `var` ForBinding `in` Expression `)` Statement
1302
+ // ForBinding?: ForBinding;
1303
+ // Expression: Expression;
1304
+ // Statement: Statement;
1305
+
1306
+ /// ForInStatement : `for` `(` ForDeclaration `in` Expression `)` Statement
1307
+ // ForDeclaration?: ForDeclarationLike;
1308
+ // Expression: Expression;
1309
+ // Statement: Statement;
1310
+
1311
+ readonly LeftHandSideExpression?: LeftHandSideExpression;
1312
+ readonly ForBinding?: ForBinding;
1313
+ readonly ForDeclaration?: ForDeclarationLike;
1314
+ readonly Expression: Expression;
1315
+ readonly Statement: Statement;
1316
+ }
1317
+
1318
+ // ForInOfStatement (partial) :
1319
+ // `for` `(` [lookahead != { `let`, `async` `of` }] LeftHandSideExpression `of` AssignmentExpression `)` Statement
1320
+ // `for` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
1321
+ // `for` `(` ForDeclaration `of` AssignmentExpression `)` Statement
1322
+ export interface ForOfStatement extends BaseParseNode {
1323
+ readonly type: 'ForOfStatement';
1324
+
1325
+ /// ForOfStatement : `for` `(` [lookahead != { `let`, `async` `of` }] LeftHandSideExpression `of` AssignmentExpression `)` Statement
1326
+ // LeftHandSideExpression?: LeftHandSideExpression;
1327
+ // AssignmentExpression: AssignmentExpressionOrHigher;
1328
+ // Statement: Statement;
1329
+
1330
+ /// ForOfStatement : `for` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
1331
+ // ForBinding?: ForBinding;
1332
+ // AssignmentExpression: AssignmentExpressionOrHigher;
1333
+ // Statement: Statement;
1334
+
1335
+ /// ForOfStatement : `for` `(` ForDeclaration `of` AssignmentExpression `)` Statement
1336
+ // ForDeclaration?: ForDeclarationLike;
1337
+ // AssignmentExpression: AssignmentExpressionOrHigher;
1338
+ // Statement: Statement;
1339
+
1340
+ readonly LeftHandSideExpression?: LeftHandSideExpression;
1341
+ readonly ForDeclaration?: ForDeclarationLike;
1342
+ readonly ForBinding?: ForBinding;
1343
+ readonly AssignmentExpression: AssignmentExpressionOrHigher;
1344
+ readonly Statement: Statement;
1345
+ }
1346
+
1347
+ // ForInOfStatement (partial) :
1348
+ // `for` `await` `(` [lookahead != `let`] LeftHandSideExpression `of` AssignmentExpression `)` Statement
1349
+ // `for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
1350
+ // `for` `await` `(` ForDeclaration `of` AssignmentExpression `)` Statement
1351
+ export interface ForAwaitStatement extends BaseParseNode {
1352
+ readonly type: 'ForAwaitStatement';
1353
+
1354
+ /// ForOfStatement : `for` `await` `(` [lookahead != `let`] LeftHandSideExpression `of` AssignmentExpression `)` Statement
1355
+ // LeftHandSideExpression?: LeftHandSideExpression;
1356
+ // AssignmentExpression: AssignmentExpressionOrHigher;
1357
+ // Statement: Statement;
1358
+
1359
+ /// ForOfStatement : `for` `await` `(` `var` ForBinding `of` AssignmentExpression `)` Statement
1360
+ // ForBinding?: ForBinding;
1361
+ // AssignmentExpression: AssignmentExpressionOrHigher;
1362
+ // Statement: Statement;
1363
+
1364
+ /// ForOfStatement : `for` `await` `(` ForDeclaration `of` AssignmentExpression `)` Statement
1365
+ // ForDeclaration?: ForDeclarationLike;
1366
+ // AssignmentExpression: AssignmentExpressionOrHigher;
1367
+ // Statement: Statement;
1368
+
1369
+ readonly LeftHandSideExpression?: LeftHandSideExpression;
1370
+ readonly ForDeclaration?: ForDeclarationLike;
1371
+ readonly ForBinding?: ForBinding;
1372
+ readonly AssignmentExpression: AssignmentExpressionOrHigher;
1373
+ readonly Statement: Statement;
1374
+ }
1375
+
1376
+ // ForDeclaration :
1377
+ // LetOrConst ForBinding
1378
+ export type ForDeclarationLike =
1379
+ | ForDeclaration;
1380
+
1381
+ // ForDeclaration :
1382
+ // LetOrConst ForBinding
1383
+ export interface ForDeclaration extends BaseParseNode {
1384
+ readonly type: 'ForDeclaration';
1385
+ readonly LetOrConst: LetOrConst;
1386
+ readonly ForBinding: ForBinding;
1387
+ }
1388
+
1389
+ // ForBinding :
1390
+ // BindingPattern
1391
+ // BindingIdentifier
1392
+ export interface ForBinding extends BaseParseNode {
1393
+ readonly type: 'ForBinding';
1394
+ readonly BindingIdentifier?: BindingIdentifier;
1395
+ readonly BindingPattern?: BindingPattern;
1396
+ }
1397
+
1398
+ // ContinueStatement :
1399
+ // `continue` `;`
1400
+ // `continue` [no LineTerminator here] LabelIdentifier `;`
1401
+ export interface ContinueStatement extends BaseParseNode {
1402
+ readonly type: 'ContinueStatement';
1403
+ readonly LabelIdentifier: LabelIdentifier | null;
1404
+ }
1405
+
1406
+ // BreakStatement :
1407
+ // `break` `;`
1408
+ // `break` [no LineTerminator here] LabelIdentifier `;`
1409
+ export interface BreakStatement extends BaseParseNode {
1410
+ readonly type: 'BreakStatement';
1411
+ readonly LabelIdentifier: LabelIdentifier | null;
1412
+ }
1413
+
1414
+ // ReturnStatement :
1415
+ // `return` `;`
1416
+ // `return` [no LineTerminator here] Expression `;`
1417
+ export interface ReturnStatement extends BaseParseNode {
1418
+ readonly type: 'ReturnStatement';
1419
+ readonly Expression: Expression | null;
1420
+ }
1421
+
1422
+ // WithStatement :
1423
+ // `with` `(` Expression `)` Statement
1424
+ export interface WithStatement extends BaseParseNode {
1425
+ readonly type: 'WithStatement';
1426
+ readonly Expression: Expression;
1427
+ readonly Statement: Statement;
1428
+ }
1429
+
1430
+ // SwitchStatement :
1431
+ // `switch` `(` Expression `)` CaseBlock
1432
+ export interface SwitchStatement extends BaseParseNode {
1433
+ readonly type: 'SwitchStatement';
1434
+ readonly Expression: Expression;
1435
+ readonly CaseBlock: CaseBlock;
1436
+ }
1437
+
1438
+ // CaseBlock :
1439
+ // `{` CaseClauses? `}`
1440
+ // `{` CaseClauses? DefaultClause CaseClauses? `}`
1441
+ export interface CaseBlock extends BaseParseNode {
1442
+ readonly type: 'CaseBlock';
1443
+ readonly CaseClauses_a?: CaseClauses;
1444
+ readonly DefaultClause?: DefaultClause;
1445
+ readonly CaseClauses_b?: CaseClauses;
1446
+ }
1447
+
1448
+ // CaseClauses :
1449
+ // CaseClause
1450
+ // CaseClauses CauseClause
1451
+ export type CaseClauses = readonly CaseClause[];
1452
+
1453
+ // CaseClause :
1454
+ // `case` Expression `:` StatementList?
1455
+ export interface CaseClause extends BaseParseNode {
1456
+ readonly type: 'CaseClause';
1457
+ readonly Expression: Expression;
1458
+ readonly StatementList: StatementList;
1459
+ }
1460
+
1461
+ // DefaultClause :
1462
+ // `default` `:` StatementList?
1463
+ export interface DefaultClause extends BaseParseNode {
1464
+ readonly type: 'DefaultClause';
1465
+ readonly StatementList: StatementList;
1466
+ }
1467
+
1468
+ // LabelledStatement :
1469
+ // LabelIdentifier `:` LabelledItem
1470
+ export interface LabelledStatement extends BaseParseNode {
1471
+ readonly type: 'LabelledStatement';
1472
+ readonly LabelIdentifier: LabelIdentifier;
1473
+ readonly LabelledItem: LabelledItem;
1474
+ }
1475
+
1476
+ // LabelledItem :
1477
+ // Statement
1478
+ // FunctionDeclaration
1479
+ export type LabelledItem =
1480
+ | Statement
1481
+ | FunctionDeclaration; // SPEC QUESTION: why only |FunctionDeclaration| and not generators or async functions?
1482
+
1483
+ // ThrowStatement :
1484
+ // `throw` [no LineTerminator here] Expression `;`
1485
+ export interface ThrowStatement extends BaseParseNode {
1486
+ readonly type: 'ThrowStatement';
1487
+ readonly Expression: Expression;
1488
+ }
1489
+
1490
+ // TryStatement :
1491
+ // `try` Block Catch
1492
+ // `try` Block Finally
1493
+ // `try` Block Catch Finally
1494
+ export interface TryStatement extends BaseParseNode {
1495
+ readonly type: 'TryStatement';
1496
+ readonly Block: Block;
1497
+ readonly Catch: Catch | null;
1498
+ readonly Finally: Finally | null;
1499
+ }
1500
+
1501
+ // Catch :
1502
+ // `catch` `(` CatchParameter `)` Block
1503
+ // `catch` Block
1504
+ //
1505
+ // CatchParameter :
1506
+ // BindingIdentifier
1507
+ // BindingPattern
1508
+ export interface Catch extends BaseParseNode {
1509
+ readonly type: 'Catch';
1510
+ readonly CatchParameter: CatchParameter | null;
1511
+ readonly Block: Block;
1512
+ }
1513
+
1514
+ // Finally :
1515
+ // `finally` Block
1516
+ export type Finally =
1517
+ | Block;
1518
+
1519
+ // CatchParameter :
1520
+ // BindingPattern
1521
+ // BindingIdentifier
1522
+ export type CatchParameter =
1523
+ | BindingPattern
1524
+ | BindingIdentifier;
1525
+
1526
+ // DebuggerStatement :
1527
+ // `debugger` `;`
1528
+ export interface DebuggerStatement extends BaseParseNode {
1529
+ readonly type: 'DebuggerStatement';
1530
+ }
1531
+
1532
+ // A.4 Functions and Classes
1533
+ // https://tc39.es/ecma262/#sec-functions-and-classes
1534
+
1535
+ // UniqueFormalParameters :
1536
+ // FormalParameters
1537
+ export type UniqueFormalParameters =
1538
+ | FormalParameters;
1539
+
1540
+ // FormalParameters :
1541
+ // [empty]
1542
+ // FunctionRestParameter
1543
+ // FormalParameterList
1544
+ // FormalParameterList `,`
1545
+ // FormalParameterList `,` FunctionRestParameter
1546
+ export type FormalParameters = readonly FormalParametersElement[];
1547
+
1548
+ // NON-SPEC
1549
+ export type FormalParametersElement = FormalParameterList[number] | FunctionRestParameter;
1550
+
1551
+ // FormalParameterList :
1552
+ // FormalParameter
1553
+ // FormalParameterList `,` FormalParameterList
1554
+ export type FormalParameterList = readonly FormalParameter[];
1555
+
1556
+ // FunctionRestParameter :
1557
+ // BindingRestElement
1558
+ export type FunctionRestParameter =
1559
+ | BindingRestElement;
1560
+
1561
+ // FormalParameter :
1562
+ // BindingElement
1563
+ export type FormalParameter =
1564
+ | BindingElementLike;
1565
+
1566
+ // NON-SPEC
1567
+ export type FunctionLike =
1568
+ | FunctionDeclarationLike
1569
+ | FunctionExpressionLike;
1570
+
1571
+ // NON-SPEC
1572
+ export type FunctionDeclarationLike =
1573
+ | FunctionDeclaration
1574
+ | GeneratorDeclaration
1575
+ | AsyncFunctionDeclaration
1576
+ | AsyncGeneratorDeclaration;
1577
+
1578
+ // NON-SPEC
1579
+ export type FunctionExpressionLike =
1580
+ | FunctionExpression
1581
+ | GeneratorExpression
1582
+ | AsyncFunctionExpression
1583
+ | AsyncGeneratorExpression;
1584
+
1585
+ // NON-SPEC
1586
+ export type FunctionBodyLike =
1587
+ | FunctionBody
1588
+ | GeneratorBody
1589
+ | AsyncBody
1590
+ | AsyncGeneratorBody;
1591
+
1592
+ // FunctionDeclaration :
1593
+ // `function` BindingIdentifier `(` FormalParameters `)` `{` FunctionBody `}`
1594
+ // [+Default] `function` `(` FormalParameters `)` `{` FunctionBody `}`
1595
+ export interface FunctionDeclaration extends BaseParseNode {
1596
+ readonly type: 'FunctionDeclaration';
1597
+ readonly BindingIdentifier: BindingIdentifier | null;
1598
+ readonly FormalParameters: FormalParameters;
1599
+ readonly FunctionBody: FunctionBody;
1600
+ }
1601
+
1602
+ // FunctionExpression :
1603
+ // `function` BindingIdentifier? `(` FormalParameters `)` `{` FunctionBody `}`
1604
+ export interface FunctionExpression extends BaseParseNode {
1605
+ readonly type: 'FunctionExpression';
1606
+ readonly BindingIdentifier: BindingIdentifier | null;
1607
+ readonly FormalParameters: FormalParameters;
1608
+ readonly FunctionBody: FunctionBody;
1609
+ }
1610
+
1611
+ // FunctionBody :
1612
+ // FunctionStatementList
1613
+ export interface FunctionBody extends BaseParseNode {
1614
+ readonly type: 'FunctionBody';
1615
+ readonly directives: string[];
1616
+ readonly strict: boolean;
1617
+ readonly FunctionStatementList: FunctionStatementList;
1618
+ }
1619
+
1620
+ // FunctionStatementList :
1621
+ // StatementList
1622
+ export type FunctionStatementList = StatementList;
1623
+
1624
+ // ArrowFunction :
1625
+ // ArrowParameters [no LineTerminator here] `=>` ConciseBody
1626
+ export interface ArrowFunction extends BaseParseNode {
1627
+ readonly type: 'ArrowFunction';
1628
+ readonly ArrowParameters: ArrowParameters;
1629
+ readonly ConciseBody: ConciseBodyLike;
1630
+ }
1631
+
1632
+ // ArrowParameters :
1633
+ // BindingIdentifier
1634
+ // CoverParenthesizedExpressionAndArrowParameterList
1635
+ //
1636
+ // CoverParenthesizedExpressionAndArrowParameterList refined as:
1637
+ // ArrowFormalParameters (refined) :
1638
+ // `(` UniqueFormalParameters `)`
1639
+ export type ArrowParameters = ArrowFormalParameters;
1640
+
1641
+ // ConciseBody :
1642
+ // ExpressionBody
1643
+ // `{` FunctionBody `}`
1644
+ export type ConciseBodyLike =
1645
+ | FunctionBody
1646
+ | ConciseBody;
1647
+
1648
+ // ConciseBody (partial) :
1649
+ // ExpressionBody
1650
+ export interface ConciseBody extends BaseParseNode {
1651
+ readonly type: 'ConciseBody';
1652
+ readonly directives?: undefined;
1653
+ readonly ExpressionBody: ExpressionBody;
1654
+ }
1655
+
1656
+ // ExpressionBody :
1657
+ // AssignmentExpression
1658
+ export interface ExpressionBody extends BaseParseNode {
1659
+ readonly type: 'ExpressionBody';
1660
+ readonly AssignmentExpression: AssignmentExpressionOrHigher;
1661
+ }
1662
+
1663
+ // CoverParenthesizedExpressionAndArrowParameterList refined as:
1664
+ // ArrowFormalParameters :
1665
+ // `(` UniqueFormalParameters `)`
1666
+ export type ArrowFormalParameters =
1667
+ | UniqueFormalParameters;
1668
+
1669
+ // AsyncArrowFunction :
1670
+ // `async` AsyncArrowBindingIdentifier `=>` AsyncConciseBody
1671
+ // CoverCallExpressionAndAsyncArrowHead `=>` AsyncConciseBody
1672
+ //
1673
+ // CoverCallExpressionAndAsyncArrowHead :
1674
+ // MemberExpression Arguments
1675
+ //
1676
+ // AsyncArrowHead (refined) :
1677
+ // `async` ArrowFormalParameters
1678
+ export interface AsyncArrowFunction extends BaseParseNode {
1679
+ readonly type: 'AsyncArrowFunction';
1680
+ readonly ArrowParameters: ArrowParameters;
1681
+ readonly AsyncConciseBody: AsyncConciseBodyLike;
1682
+ }
1683
+
1684
+ // AsyncConciseBody :
1685
+ // ExpressionBody
1686
+ // `{` AsyncBody `}`
1687
+ export type AsyncConciseBodyLike =
1688
+ | AsyncConciseBody
1689
+ | AsyncBody;
1690
+
1691
+ // AsyncConciseBody (partial) :
1692
+ // ExpressionBody
1693
+ export interface AsyncConciseBody extends BaseParseNode {
1694
+ readonly type: 'AsyncConciseBody';
1695
+ readonly directives?: undefined;
1696
+ readonly ExpressionBody: ExpressionBody;
1697
+ }
1698
+
1699
+ // MethodDefinition :
1700
+ // ClassElementName `(` UniqueFormalParameters `)` `{` FunctionBody `}`
1701
+ // GeneratorMethod
1702
+ // AsyncMethod
1703
+ // AsyncGeneratorMethod
1704
+ // `get` ClassElementName `(` `)` `{` FunctionBody `}`
1705
+ // `set` ClassElementName `(` PropertySetParameterList `)` `{` FunctionBody `}`
1706
+ export type MethodDefinitionLike =
1707
+ | MethodDefinition
1708
+ | GeneratorMethod
1709
+ | AsyncMethod
1710
+ | AsyncGeneratorMethod;
1711
+
1712
+ // MethodDefinition (partial) :
1713
+ // ClassElementName `(` UniqueFormalParameters `)` `{` FunctionBody `}`
1714
+ // `get` ClassElementName `(` `)` `{` FunctionBody `}`
1715
+ // `set` ClassElementName `(` PropertySetParameterList `)` `{` FunctionBody `}`
1716
+ export interface MethodDefinition extends BaseParseNode {
1717
+ readonly type: 'MethodDefinition';
1718
+ readonly static?: boolean;
1719
+ readonly ClassElementName: ClassElementName;
1720
+ readonly PropertySetParameterList: PropertySetParameterList | null;
1721
+ readonly UniqueFormalParameters: UniqueFormalParameters | null;
1722
+ readonly FunctionBody: FunctionBody;
1723
+ }
1724
+
1725
+ // PropertySetParameterList :
1726
+ // FormalParameter
1727
+ export type PropertySetParameterList = [FormalParameter];
1728
+
1729
+ // GeneratorDeclaration :
1730
+ // `function` `*` BindingIdentifier `(` FormalParameters `)` `{` GeneratorBody `}`
1731
+ // [+Default] `function` `*` `(` FormalParameters `)` `{` GeneratorBody `}`
1732
+ export interface GeneratorDeclaration extends BaseParseNode {
1733
+ readonly type: 'GeneratorDeclaration';
1734
+ readonly BindingIdentifier: BindingIdentifier | null;
1735
+ readonly FormalParameters: FormalParameters;
1736
+ readonly GeneratorBody: GeneratorBody;
1737
+ }
1738
+
1739
+ // GeneratorExpression :
1740
+ // `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` GeneratorBody `}`
1741
+ export interface GeneratorExpression extends BaseParseNode {
1742
+ readonly type: 'GeneratorExpression';
1743
+ readonly BindingIdentifier: BindingIdentifier | null;
1744
+ readonly FormalParameters: FormalParameters;
1745
+ readonly GeneratorBody: GeneratorBody;
1746
+ }
1747
+
1748
+ // GeneratorMethod :
1749
+ // `*` ClassElementName `(` UniqueFormalParameters `)` `{` GeneratorBody `}`
1750
+ export interface GeneratorMethod extends BaseParseNode {
1751
+ readonly type: 'GeneratorMethod';
1752
+ readonly static?: boolean;
1753
+ readonly ClassElementName: ClassElementName;
1754
+ readonly PropertySetParameterList: null;
1755
+ readonly UniqueFormalParameters: UniqueFormalParameters;
1756
+ readonly GeneratorBody: GeneratorBody;
1757
+ }
1758
+
1759
+ // GeneratorBody :
1760
+ // FunctionBody
1761
+ export interface GeneratorBody extends BaseParseNode {
1762
+ readonly type: 'GeneratorBody';
1763
+ readonly directives: string[];
1764
+ readonly strict: boolean;
1765
+ readonly FunctionStatementList: FunctionStatementList;
1766
+ }
1767
+
1768
+ // YieldExpression :
1769
+ // `yield`
1770
+ // `yield` [no LineTerminator here] AssignmentExpression
1771
+ // `yield` [no LineTerminator here] `*` AssignmentExpression
1772
+ export interface YieldExpression extends BaseParseNode {
1773
+ readonly type: 'YieldExpression';
1774
+ readonly hasStar: boolean;
1775
+ readonly AssignmentExpression: AssignmentExpressionOrHigher | null;
1776
+ }
1777
+
1778
+ // AsyncGeneratorDeclaration :
1779
+ // `async` `function` `*` BindingIdentifier `(` FormalParameters `)` `{` AsyncGeneratorBody `}`
1780
+ // [+Default] `async` `function` `*` `(` FormalParameters `)` `{` AsyncGeneratorBody `}`
1781
+ export interface AsyncGeneratorDeclaration extends BaseParseNode {
1782
+ readonly type: 'AsyncGeneratorDeclaration';
1783
+ readonly BindingIdentifier: BindingIdentifier | null;
1784
+ readonly FormalParameters: FormalParameters;
1785
+ readonly AsyncGeneratorBody: AsyncGeneratorBody;
1786
+ }
1787
+
1788
+ // AsyncGeneratorExpression :
1789
+ // `async` `function` `*` BindingIdentifier? `(` FormalParameters `)` `{` AsyncGeneratorBody `}`
1790
+ export interface AsyncGeneratorExpression extends BaseParseNode {
1791
+ readonly type: 'AsyncGeneratorExpression';
1792
+ readonly BindingIdentifier: BindingIdentifier | null;
1793
+ readonly FormalParameters: FormalParameters;
1794
+ readonly AsyncGeneratorBody: AsyncGeneratorBody;
1795
+ }
1796
+
1797
+ // AsyncGeneratorMethod :
1798
+ // `async` `*` ClassElementName `(` UniqueFormalParameters `)` `{` AsyncGeneratorBody `}`
1799
+ export interface AsyncGeneratorMethod extends BaseParseNode {
1800
+ readonly type: 'AsyncGeneratorMethod';
1801
+ readonly static?: boolean;
1802
+ readonly ClassElementName: ClassElementName;
1803
+ readonly PropertySetParameterList: null;
1804
+ readonly UniqueFormalParameters: UniqueFormalParameters;
1805
+ readonly AsyncGeneratorBody: AsyncGeneratorBody;
1806
+ }
1807
+
1808
+ // AsyncGeneratorBody :
1809
+ // FunctionBody
1810
+ export interface AsyncGeneratorBody extends BaseParseNode {
1811
+ readonly type: 'AsyncGeneratorBody';
1812
+ readonly directives: string[];
1813
+ readonly strict: boolean;
1814
+ readonly FunctionStatementList: FunctionStatementList;
1815
+ }
1816
+
1817
+ // AsyncFunctionDeclaration :
1818
+ // `async` `function` `*` BindingIdentifier `(` FormalParameters `)` `{` AsyncBody `}`
1819
+ // [+Default] `async` `function` `*` `(` FormalParameters `)` `{` AsyncBody `}`
1820
+ export interface AsyncFunctionDeclaration extends BaseParseNode {
1821
+ readonly type: 'AsyncFunctionDeclaration';
1822
+ readonly BindingIdentifier: BindingIdentifier | null;
1823
+ readonly FormalParameters: FormalParameters;
1824
+ readonly AsyncBody: AsyncBody;
1825
+ }
1826
+
1827
+ // AsyncFunctionExpression :
1828
+ // `async` `function` BindingIdentifier? `(` FormalParameters `)` `{` AsyncBody `}`
1829
+ export interface AsyncFunctionExpression extends BaseParseNode {
1830
+ readonly type: 'AsyncFunctionExpression';
1831
+ readonly BindingIdentifier: BindingIdentifier | null;
1832
+ readonly FormalParameters: FormalParameters;
1833
+ readonly AsyncBody: AsyncBody;
1834
+ }
1835
+
1836
+ // AsyncMethod :
1837
+ // `async` ClassElementName `(` UniqueFormalParameters `)` `{` AsyncBody `}`
1838
+ export interface AsyncMethod extends BaseParseNode {
1839
+ readonly type: 'AsyncMethod';
1840
+ readonly static?: boolean;
1841
+ readonly ClassElementName: ClassElementName;
1842
+ readonly PropertySetParameterList: null;
1843
+ readonly UniqueFormalParameters: UniqueFormalParameters;
1844
+ readonly AsyncBody: AsyncBody;
1845
+ }
1846
+
1847
+ // AsyncBody :
1848
+ // FunctionBody
1849
+ export interface AsyncBody extends BaseParseNode {
1850
+ readonly type: 'AsyncBody';
1851
+ readonly directives: string[];
1852
+ readonly strict: boolean;
1853
+ readonly FunctionStatementList: FunctionStatementList;
1854
+ }
1855
+
1856
+ // AwaitExpression : `await` UnaryExpression
1857
+ export interface AwaitExpression extends BaseParseNode {
1858
+ readonly type: 'AwaitExpression';
1859
+ readonly UnaryExpression: UnaryExpressionOrHigher;
1860
+ }
1861
+
1862
+ // pending
1863
+
1864
+ // NON-SPEC
1865
+ export type ClassLike =
1866
+ | ClassDeclaration
1867
+ | ClassExpression;
1868
+
1869
+ // ClassDeclaration :
1870
+ // `class` BindingIdentifier ClassTail
1871
+ // [+Default] `class` ClassTail
1872
+ export interface ClassDeclaration extends BaseParseNode {
1873
+ readonly type: 'ClassDeclaration';
1874
+ readonly BindingIdentifier: BindingIdentifier | null;
1875
+ readonly ClassTail: ClassTail;
1876
+ }
1877
+
1878
+ // ClassExpression :
1879
+ // `class` BindingIdentifier? ClassTail
1880
+ export interface ClassExpression extends BaseParseNode {
1881
+ readonly type: 'ClassExpression';
1882
+ readonly BindingIdentifier: BindingIdentifier | null;
1883
+ readonly ClassTail: ClassTail;
1884
+ }
1885
+
1886
+ // ClassTail :
1887
+ // ClassHeritage? `{` ClassBody? `}`
1888
+ export interface ClassTail extends BaseParseNode {
1889
+ readonly type: 'ClassTail';
1890
+ readonly ClassHeritage: ClassHeritage | null;
1891
+ readonly ClassBody: ClassBody | null;
1892
+ }
1893
+
1894
+ // ClassHeritage :
1895
+ // `extends` LeftHandSideExpression
1896
+ export type ClassHeritage =
1897
+ | LeftHandSideExpression;
1898
+
1899
+ // ClassBody :
1900
+ // ClassElementList
1901
+ export type ClassBody =
1902
+ | ClassElementList;
1903
+
1904
+ // ClassElementList :
1905
+ // ClassElement
1906
+ // ClassElementList ClassElement
1907
+ export type ClassElementList = readonly ClassElement[];
1908
+
1909
+ // ClassElement :
1910
+ // MethodDefinition
1911
+ // `static` MethodDefinition
1912
+ // FieldDefinition `;`
1913
+ // `static` FieldDefinition `;`
1914
+ // ClassStaticBlock
1915
+ // `;`
1916
+ export type ClassElement =
1917
+ | MethodDefinitionLike
1918
+ | FieldDefinition
1919
+ | ClassStaticBlock;
1920
+
1921
+ // FieldDefinition :
1922
+ // ClassElementName Initializer?
1923
+ export interface FieldDefinition extends BaseParseNode {
1924
+ readonly type: 'FieldDefinition';
1925
+ readonly static?: boolean;
1926
+ readonly ClassElementName: ClassElementName;
1927
+ readonly Initializer: Initializer | null;
1928
+ }
1929
+
1930
+ // ClassElementName :
1931
+ // PropertyName
1932
+ // PrivateIdentifier
1933
+ export type ClassElementName =
1934
+ | PropertyNameLike
1935
+ | PrivateIdentifier;
1936
+
1937
+ // ClassStaticBlock :
1938
+ // `static` `{` ClassStaticBlockBody `}`
1939
+ export interface ClassStaticBlock extends BaseParseNode {
1940
+ readonly type: 'ClassStaticBlock';
1941
+ readonly static: true;
1942
+ readonly ClassStaticBlockBody: ClassStaticBlockBody;
1943
+ }
1944
+
1945
+ // ClassStaticBlockBody :
1946
+ // ClassStaticBlockStatementList
1947
+ export interface ClassStaticBlockBody extends BaseParseNode {
1948
+ readonly type: 'ClassStaticBlockBody';
1949
+ readonly ClassStaticBlockStatementList: ClassStaticBlockStatementList;
1950
+ }
1951
+
1952
+ // ClassStaticBlockStatementList :
1953
+ // StatementList?
1954
+ export type ClassStaticBlockStatementList =
1955
+ | StatementList;
1956
+
1957
+
1958
+ // A.5 Scripts and Modules
1959
+ // https://tc39.es/ecma262/#sec-scripts-and-modules
1960
+
1961
+ // Script :
1962
+ // ScriptBody?
1963
+ export interface Script extends BaseParseNode {
1964
+ readonly type: 'Script';
1965
+ readonly ScriptBody: ScriptBody | null;
1966
+ }
1967
+
1968
+ // ScriptBody :
1969
+ // StatementList
1970
+ export interface ScriptBody extends BaseParseNode {
1971
+ readonly type: 'ScriptBody';
1972
+ readonly StatementList: StatementList;
1973
+ }
1974
+
1975
+ // Module :
1976
+ // ModuleBody?
1977
+ export interface Module extends BaseParseNode {
1978
+ readonly type: 'Module';
1979
+ readonly ModuleBody: ModuleBody | null;
1980
+ readonly hasTopLevelAwait: boolean;
1981
+ }
1982
+
1983
+ // ModuleBody :
1984
+ // ModuleItemList
1985
+ export interface ModuleBody extends BaseParseNode {
1986
+ readonly type: 'ModuleBody';
1987
+ readonly ModuleItemList: ModuleItemList;
1988
+ }
1989
+
1990
+ // ModuleItemList :
1991
+ // ModuleItem
1992
+ // ModuleItemList ModuleItem
1993
+ export type ModuleItemList = readonly ModuleItem[];
1994
+
1995
+ // ModuleItem :
1996
+ // ImportDeclaration
1997
+ // ExportDeclaration
1998
+ // StatementListItem
1999
+ export type ModuleItem =
2000
+ | ImportDeclaration
2001
+ | ExportDeclaration
2002
+ | StatementListItem;
2003
+
2004
+ // ModuleExportName :
2005
+ // IdentifierName
2006
+ // StringLiteral
2007
+ export type ModuleExportName =
2008
+ | IdentifierName
2009
+ | StringLiteral;
2010
+
2011
+ // ImportDeclaration :
2012
+ // `import` ImportClause FromClause `;`
2013
+ // `import` ModuleSpecifier `;`
2014
+ export interface ImportDeclaration extends BaseParseNode {
2015
+ readonly type: 'ImportDeclaration';
2016
+ readonly ModuleSpecifier?: PrimaryExpression;
2017
+ readonly ImportClause?: ImportClause;
2018
+ readonly FromClause?: FromClause;
2019
+ }
2020
+
2021
+ // ImportClause :
2022
+ // ImportedDefaultBinding
2023
+ // NameSpaceImport
2024
+ // NamedImports
2025
+ // ImportedDefaultBinding `,` NameSpaceImport
2026
+ // ImportedDefaultBinding `,` NamedImports
2027
+ export interface ImportClause extends BaseParseNode {
2028
+ readonly type: 'ImportClause';
2029
+ readonly ImportedDefaultBinding?: ImportedDefaultBinding;
2030
+ readonly NameSpaceImport?: NameSpaceImport;
2031
+ readonly NamedImports?: NamedImports;
2032
+ }
2033
+
2034
+ // ImportedDefaultBinding :
2035
+ // ImportedBinding
2036
+ export interface ImportedDefaultBinding extends BaseParseNode {
2037
+ readonly type: 'ImportedDefaultBinding';
2038
+ readonly ImportedBinding: ImportedBinding;
2039
+ }
2040
+
2041
+ // NameSpaceImport :
2042
+ // `*` `as` ImportedBinding
2043
+ export interface NameSpaceImport extends BaseParseNode {
2044
+ readonly type: 'NameSpaceImport';
2045
+ readonly ImportedBinding: ImportedBinding;
2046
+ }
2047
+
2048
+ // NamedImports :
2049
+ // `{` `}`
2050
+ // `{` ImportsList `}`
2051
+ // `{` ImportsList `,` `}`
2052
+ export interface NamedImports extends BaseParseNode {
2053
+ readonly type: 'NamedImports';
2054
+ readonly ImportsList: ImportsList;
2055
+ }
2056
+
2057
+ // FromClause :
2058
+ // `from` ModuleSpecifier
2059
+ export type FromClause =
2060
+ | ModuleSpecifier;
2061
+
2062
+ // ImportsList :
2063
+ // ImportSpecifier
2064
+ // ImportsList `,` ImportSpecifier
2065
+ export type ImportsList = readonly ImportSpecifier[];
2066
+
2067
+ // ImportSpecifier :
2068
+ // ImportedBinding
2069
+ // ModuleExportName `as` ImportedBinding
2070
+ export interface ImportSpecifier extends BaseParseNode {
2071
+ readonly type: 'ImportSpecifier';
2072
+ readonly ModuleExportName?: ModuleExportName;
2073
+ readonly ImportedBinding: ImportedBinding;
2074
+ }
2075
+
2076
+ // ModuleSpecifier :
2077
+ // StringLiteral
2078
+ export type ModuleSpecifier =
2079
+ | StringLiteral;
2080
+
2081
+ // ImportedBinding :
2082
+ // BindingIdentifier
2083
+ export type ImportedBinding =
2084
+ | BindingIdentifier;
2085
+
2086
+ // ExportDeclaration :
2087
+ // `export` ExportFromClause FromClause `;`
2088
+ // `export` NamedExports `;`
2089
+ // `export` VariableStatement
2090
+ // `export` Declaration
2091
+ // `export` `default` HoistableDeclaration
2092
+ // `export` `default` ClassDeclaration
2093
+ // `export` `default` AssignmentExpression `;`
2094
+ export interface ExportDeclaration extends BaseParseNode {
2095
+ readonly type: 'ExportDeclaration';
2096
+ readonly default: boolean;
2097
+ readonly HoistableDeclaration?: HoistableDeclaration;
2098
+ readonly ClassDeclaration?: ClassDeclaration;
2099
+ readonly AssignmentExpression?: AssignmentExpressionOrHigher;
2100
+ readonly Declaration?: Declaration;
2101
+ readonly VariableStatement?: VariableStatement;
2102
+ readonly ExportFromClause?: ExportFromClauseLike;
2103
+ readonly FromClause?: FromClause;
2104
+ readonly NamedExports?: NamedExports;
2105
+ }
2106
+
2107
+ // ExportFromClause :
2108
+ // `*`
2109
+ // `*` as ModuleExportName
2110
+ // NamedExports
2111
+ export type ExportFromClauseLike =
2112
+ | NamedExports
2113
+ | ExportFromClause;
2114
+
2115
+ // ExportFromClause (partial) :
2116
+ // `*`
2117
+ // `*` as ModuleExportName
2118
+ export interface ExportFromClause extends BaseParseNode {
2119
+ readonly type: 'ExportFromClause';
2120
+ readonly ModuleExportName?: ModuleExportName;
2121
+ }
2122
+
2123
+ // NamedExports :
2124
+ // `{` `}`
2125
+ // `{` ExportsList `}`
2126
+ // `{` ExportsList `,` `}`
2127
+ export interface NamedExports extends BaseParseNode {
2128
+ readonly type: 'NamedExports';
2129
+ readonly ExportsList: ExportsList;
2130
+ }
2131
+
2132
+ // ExportsList :
2133
+ // ExportSpecifier
2134
+ // ExportsList `,` ExportSpecifier
2135
+ export type ExportsList = readonly ExportSpecifier[];
2136
+
2137
+ // ExportSpecifier :
2138
+ // ModuleExportName
2139
+ // ModuleExportName `as` ModuleExportName
2140
+ export interface ExportSpecifier extends BaseParseNode {
2141
+ readonly type: 'ExportSpecifier';
2142
+ readonly localName: ModuleExportName;
2143
+ readonly exportName: ModuleExportName;
2144
+ }
2145
+
2146
+ export type AssignmentPattern = ObjectAssignmentPattern | ArrayAssignmentPattern | AssignmentProperty | AssignmentElement | ParseNode.Elision;
2147
+ export type ObjectAssignmentPattern = {
2148
+ type: 'ObjectAssignmentPattern';
2149
+ AssignmentPropertyList: (AssignmentProperty | AssignmentPattern)[];
2150
+ AssignmentRestProperty: AssignmentRestProperty | undefined;
2151
+ }
2152
+ export type AssignmentProperty = {
2153
+ type: 'AssignmentProperty';
2154
+ IdentifierReference: ParseNode.IdentifierReference;
2155
+ Initializer?: ParseNode.Initializer | null | undefined;
2156
+ } | {
2157
+ type: 'AssignmentProperty';
2158
+ PropertyName: ParseNode.PropertyNameLike | null;
2159
+ AssignmentElement: AssignmentElement;
2160
+ }
2161
+ export type AssignmentElement = {
2162
+ type: 'AssignmentElement';
2163
+ DestructuringAssignmentTarget: ParseNode.AssignmentExpressionOrHigher;
2164
+ Initializer: ParseNode.Initializer | undefined | null;
2165
+ }
2166
+
2167
+ export type ArrayAssignmentPattern = {
2168
+ type: 'ArrayAssignmentPattern';
2169
+ AssignmentElementList: AssignmentElisionElement[];
2170
+ AssignmentRestElement: AssignmentRestElement | undefined;
2171
+ }
2172
+ export type AssignmentElisionElement = ParseNode.Elision | AssignmentElement | AssignmentPattern;
2173
+ export type AssignmentRestProperty = {
2174
+ type: 'AssignmentRestProperty';
2175
+ DestructuringAssignmentTarget: ParseNode.AssignmentExpressionOrHigher;
2176
+ }
2177
+
2178
+ // Helpers
2179
+ // NON-SPEC
2180
+
2181
+ // Gets all keys of all constituents of a union
2182
+ type AllKeysOf<T> = T extends unknown ? keyof T : never;
2183
+
2184
+ // Gets all values for a given key for all constituents of a union
2185
+ type AllValuesOf<T, K extends AllKeysOf<T>> = T extends unknown ? K extends keyof T ? T[K] : never : never;
2186
+
2187
+ // NON-SPEC
2188
+ /**
2189
+ * Used internally to describe a node that is still in the process of being parsed. Unfinished nodes may not yet be
2190
+ * fully defined.
2191
+ */
2192
+ export type Unfinished<T extends ParseNode = ParseNode> = (
2193
+ // An unfinished node...
2194
+
2195
+ // ...includes all properties of BaseParseNode
2196
+ & {
2197
+ type?: T['type'] & ParseNode['type'];
2198
+ location: {
2199
+ startIndex: number;
2200
+ endIndex: number;
2201
+ start: { line: number, column: number };
2202
+ end: { line: number, column: number };
2203
+ };
2204
+ strict: boolean;
2205
+ sourceText: () => string;
2206
+ }
2207
+
2208
+ // ...includes all properties of all potential types, with each property marked as optional
2209
+ & {
2210
+ -readonly [K in Exclude<AllKeysOf<T>, 'location' | 'strict' | 'sourceText'>]?: AllValuesOf<T, K>;
2211
+ }
2212
+ );
2213
+
2214
+ // NON-SPEC
2215
+ /**
2216
+ * Used internally to indicate a node that has finished parsing.
2217
+ */
2218
+ export type Finished<T extends BaseParseNode | Unfinished<ParseNode>, K extends T['type'] & ParseNode['type']> =
2219
+ T extends Unfinished<ParseNode> ? Extract<ParseNodesByType[K], T> :
2220
+ T;
2221
+ }
2222
+
2223
+ /** https://tc39.es/ecma262/multipage/text-processing.html#sec-patterns */
2224
+ // eslint-disable-next-line @typescript-eslint/no-namespace
2225
+ export namespace ParseNode.RegExp {
2226
+ // NON-SPEC
2227
+ export type Mutable<T> = {
2228
+ -readonly [K in keyof T]: T[K];
2229
+ }
2230
+ export interface Pattern {
2231
+ readonly type: 'Pattern';
2232
+ readonly Disjunction: Disjunction;
2233
+ readonly groupSpecifiers: ReadonlyMap<string, number>;
2234
+ readonly capturingGroups: readonly Atom_Group[];
2235
+ }
2236
+ export interface Disjunction {
2237
+ readonly type: 'Disjunction';
2238
+ readonly Alternative: Alternative;
2239
+ readonly Disjunction: Disjunction | undefined;
2240
+ }
2241
+ export interface Alternative {
2242
+ readonly type: 'Alternative';
2243
+ readonly Term: Term | undefined;
2244
+ readonly Alternative: Alternative | undefined;
2245
+ }
2246
+ export type Term = Assertion | Term_Atom;
2247
+ export interface Term_Atom {
2248
+ readonly type: 'Term';
2249
+ readonly Atom: Atom;
2250
+ readonly Quantifier: Quantifier | undefined;
2251
+ readonly capturingParenthesesBefore: number;
2252
+ }
2253
+ export interface Assertion {
2254
+ readonly type: 'Assertion';
2255
+ readonly subtype: '^' | '$' | 'b' | 'B' | '?=' | '?!' | '?<=' | '?<!';
2256
+ readonly Disjunction?: Disjunction | undefined;
2257
+ }
2258
+ export interface Quantifier {
2259
+ readonly type: 'Quantifier';
2260
+ readonly QuantifierPrefix: '*' | '+' | '?' | QuantifierCount | undefined;
2261
+ readonly greedy: boolean;
2262
+ }
2263
+ export interface QuantifierCount {
2264
+ readonly DecimalDigits_a: number;
2265
+ readonly DecimalDigits_b: number | undefined;
2266
+ }
2267
+ export type Atom = Atom_Dot | AtomEscape | Atom_Group | Atom_Rest;
2268
+ export interface Atom_Dot {
2269
+ readonly type: 'Atom';
2270
+ readonly subtype: '.';
2271
+ readonly enclosedCapturingParentheses: number;
2272
+ }
2273
+ export interface Atom_Group {
2274
+ readonly type: 'Atom';
2275
+ readonly capturingParenthesesBefore: number;
2276
+ readonly enclosedCapturingParentheses: number;
2277
+ readonly capturing: boolean;
2278
+ readonly GroupSpecifier: string | undefined;
2279
+ readonly Disjunction: Disjunction | undefined;
2280
+ }
2281
+ export interface Atom_Rest {
2282
+ readonly type: 'Atom';
2283
+ readonly CharacterClass?: CharacterClass | undefined;
2284
+ readonly PatternCharacter?: string | undefined;
2285
+ }
2286
+ export interface AtomEscape {
2287
+ readonly type: 'AtomEscape';
2288
+ readonly position?: number | undefined;
2289
+ readonly GroupName?: string | undefined;
2290
+ readonly CharacterClassEscape?: CharacterClassEscape | undefined;
2291
+ readonly DecimalEscape?: DecimalEscape | undefined;
2292
+ readonly CharacterEscape?: CharacterEscape | undefined;
2293
+ }
2294
+ export interface CharacterEscape {
2295
+ readonly type: 'CharacterEscape';
2296
+ readonly subtype?: string | undefined;
2297
+ readonly ControlEscape?: string | undefined;
2298
+ readonly IdentityEscape?: string | undefined;
2299
+ readonly ControlLetter?: string | undefined;
2300
+ readonly HexEscapeSequence?: HexEscapeSequence | undefined;
2301
+ readonly RegExpUnicodeEscapeSequence?: RegExpUnicodeEscapeSequence | undefined;
2302
+ }
2303
+ export interface DecimalEscape {
2304
+ readonly type: 'DecimalEscape';
2305
+ readonly position: number;
2306
+ readonly value: number;
2307
+ }
2308
+ export interface CharacterClassEscape {
2309
+ readonly type: 'CharacterClassEscape';
2310
+ readonly value: string;
2311
+ readonly UnicodePropertyValueExpression?: UnicodePropertyValueExpression | undefined;
2312
+ }
2313
+ export interface UnicodePropertyValueExpression {
2314
+ readonly type: 'UnicodePropertyValueExpression';
2315
+ readonly LoneUnicodePropertyNameOrValue?: string | undefined;
2316
+ readonly UnicodePropertyName?: string | undefined;
2317
+ readonly UnicodePropertyValue?: string | undefined;
2318
+ }
2319
+ export interface CharacterClass {
2320
+ readonly type: 'CharacterClass';
2321
+ readonly invert: boolean;
2322
+ readonly ClassRanges: readonly ClassRange[];
2323
+ }
2324
+ export type ClassRange = ClassAtom | [ClassAtom, ClassAtom];
2325
+ export type ClassAtom = ClassAtom_SourceCharacter | ClassEscape | CharacterClassEscape;
2326
+ export interface ClassAtom_SourceCharacter {
2327
+ readonly type: 'ClassAtom';
2328
+ readonly SourceCharacter?: string | undefined;
2329
+ readonly value?: '-' | undefined;
2330
+ }
2331
+ export interface ClassEscape {
2332
+ readonly type: 'ClassEscape';
2333
+ readonly value?: 'b' | '-' | undefined;
2334
+ readonly CharacterEscape?: CharacterEscape | undefined;
2335
+ }
2336
+ export interface RegExpUnicodeEscapeSequence {
2337
+ readonly type: 'RegExpUnicodeEscapeSequence';
2338
+ readonly CodePoint?: number;
2339
+ readonly HexLeadSurrogate?: number | undefined;
2340
+ readonly HexTrailSurrogate?: number | undefined;
2341
+ readonly Hex4Digits?: number | undefined;
2342
+ }
2343
+ export interface HexEscapeSequence {
2344
+ readonly type: 'HexEscapeSequence';
2345
+ readonly HexDigit_a: string;
2346
+ readonly HexDigit_b: string;
2347
+ }
2348
+ export type RegExpParseNode =
2349
+ | Pattern
2350
+ | Disjunction
2351
+ | Alternative
2352
+ | Term_Atom
2353
+ | Assertion
2354
+ | Quantifier
2355
+ | Atom_Dot
2356
+ | AtomEscape
2357
+ | Atom_Group
2358
+ | Atom_Rest
2359
+ | CharacterClass
2360
+ | ClassAtom_SourceCharacter
2361
+ | ClassEscape
2362
+ | RegExpUnicodeEscapeSequence
2363
+ | HexEscapeSequence
2364
+ | CharacterEscape
2365
+ | DecimalEscape
2366
+ | CharacterClassEscape
2367
+ | UnicodePropertyValueExpression;
2368
+ }
2369
+
2370
+ export type ParseNode =
2371
+ | ParseNode.PrivateIdentifier
2372
+ | ParseNode.IdentifierName
2373
+ | ParseNode.IdentifierReference
2374
+ | ParseNode.BindingIdentifier
2375
+ | ParseNode.LabelIdentifier
2376
+ | ParseNode.PropertyName
2377
+ | ParseNode.ThisExpression
2378
+ | ParseNode.NullLiteral
2379
+ | ParseNode.BooleanLiteral
2380
+ | ParseNode.NumericLiteral
2381
+ | ParseNode.StringLiteral
2382
+ | ParseNode.Elision
2383
+ | ParseNode.ArrayLiteral
2384
+ | ParseNode.SpreadElement
2385
+ | ParseNode.ObjectLiteral
2386
+ | ParseNode.PropertyDefinition
2387
+ | ParseNode.CoverInitializedName
2388
+ | ParseNode.MethodDefinition
2389
+ | ParseNode.FunctionDeclaration
2390
+ | ParseNode.FunctionExpression
2391
+ | ParseNode.FunctionBody
2392
+ | ParseNode.ArrowFunction
2393
+ | ParseNode.ExpressionBody
2394
+ | ParseNode.ConciseBody
2395
+ | ParseNode.GeneratorDeclaration
2396
+ | ParseNode.GeneratorExpression
2397
+ | ParseNode.GeneratorMethod
2398
+ | ParseNode.GeneratorBody
2399
+ | ParseNode.YieldExpression
2400
+ | ParseNode.AsyncGeneratorDeclaration
2401
+ | ParseNode.AsyncGeneratorExpression
2402
+ | ParseNode.AsyncGeneratorMethod
2403
+ | ParseNode.AsyncGeneratorBody
2404
+ | ParseNode.ClassDeclaration
2405
+ | ParseNode.ClassExpression
2406
+ | ParseNode.ClassTail
2407
+ | ParseNode.FieldDefinition
2408
+ | ParseNode.ClassStaticBlock
2409
+ | ParseNode.ClassStaticBlockBody
2410
+ | ParseNode.AsyncFunctionDeclaration
2411
+ | ParseNode.AsyncFunctionExpression
2412
+ | ParseNode.AsyncMethod
2413
+ | ParseNode.AsyncBody
2414
+ | ParseNode.AsyncArrowFunction
2415
+ | ParseNode.AsyncConciseBody
2416
+ | ParseNode.RegularExpressionLiteral
2417
+ | ParseNode.CoverParenthesizedExpressionAndArrowParameterList
2418
+ | ParseNode.ParenthesizedExpression
2419
+ | ParseNode.SuperProperty
2420
+ | ParseNode.SuperProperty
2421
+ | ParseNode.NewTarget
2422
+ | ParseNode.ImportMeta
2423
+ | ParseNode.MemberExpression
2424
+ | ParseNode.NewExpression
2425
+ | ParseNode.SuperCall
2426
+ | ParseNode.ImportCall
2427
+ | ParseNode.CallExpression
2428
+ | ParseNode.TemplateLiteral
2429
+ | ParseNode.TaggedTemplateExpression
2430
+ | ParseNode.OptionalExpression
2431
+ | ParseNode.OptionalChain
2432
+ | ParseNode.AssignmentRestElement
2433
+ | ParseNode.UpdateExpression
2434
+ | ParseNode.AwaitExpression
2435
+ | ParseNode.UnaryExpression
2436
+ | ParseNode.ExponentiationExpression
2437
+ | ParseNode.MultiplicativeExpression
2438
+ | ParseNode.AdditiveExpression
2439
+ | ParseNode.ShiftExpression
2440
+ | ParseNode.RelationalExpression
2441
+ | ParseNode.EqualityExpression
2442
+ | ParseNode.BitwiseANDExpression
2443
+ | ParseNode.BitwiseXORExpression
2444
+ | ParseNode.BitwiseORExpression
2445
+ | ParseNode.LogicalANDExpression
2446
+ | ParseNode.LogicalORExpression
2447
+ | ParseNode.CoalesceExpression
2448
+ | ParseNode.ConditionalExpression
2449
+ | ParseNode.AssignmentExpression
2450
+ | ParseNode.CommaOperator
2451
+ | ParseNode.LexicalDeclaration
2452
+ | ParseNode.LexicalBinding
2453
+ | ParseNode.ObjectBindingPattern
2454
+ | ParseNode.ArrayBindingPattern
2455
+ | ParseNode.BindingRestProperty
2456
+ | ParseNode.BindingProperty
2457
+ | ParseNode.BindingRestElement
2458
+ | ParseNode.BindingElement
2459
+ | ParseNode.SingleNameBinding
2460
+ | ParseNode.Block
2461
+ | ParseNode.VariableStatement
2462
+ | ParseNode.VariableDeclaration
2463
+ | ParseNode.EmptyStatement
2464
+ | ParseNode.ExpressionStatement
2465
+ | ParseNode.IfStatement
2466
+ | ParseNode.DoWhileStatement
2467
+ | ParseNode.WhileStatement
2468
+ | ParseNode.ForStatement
2469
+ | ParseNode.ForInStatement
2470
+ | ParseNode.ForOfStatement
2471
+ | ParseNode.ForDeclaration
2472
+ | ParseNode.ForBinding
2473
+ | ParseNode.ForAwaitStatement
2474
+ | ParseNode.SwitchStatement
2475
+ | ParseNode.CaseBlock
2476
+ | ParseNode.CaseClause
2477
+ | ParseNode.DefaultClause
2478
+ | ParseNode.ContinueStatement
2479
+ | ParseNode.BreakStatement
2480
+ | ParseNode.ReturnStatement
2481
+ | ParseNode.WithStatement
2482
+ | ParseNode.LabelledStatement
2483
+ | ParseNode.ThrowStatement
2484
+ | ParseNode.TryStatement
2485
+ | ParseNode.Catch
2486
+ | ParseNode.DebuggerStatement
2487
+ | ParseNode.ImportDeclaration
2488
+ | ParseNode.ImportClause
2489
+ | ParseNode.ImportedDefaultBinding
2490
+ | ParseNode.NameSpaceImport
2491
+ | ParseNode.NamedImports
2492
+ | ParseNode.ImportSpecifier
2493
+ | ParseNode.ExportDeclaration
2494
+ | ParseNode.ExportFromClause
2495
+ | ParseNode.NamedExports
2496
+ | ParseNode.ExportSpecifier
2497
+ | ParseNode.Script
2498
+ | ParseNode.ScriptBody
2499
+ | ParseNode.Module
2500
+ | ParseNode.ModuleBody;
2501
+
2502
+ /**
2503
+ * A type that contains a mapping of {@link ParseNode} type names to their corresponding {@link ParseNode} type.
2504
+ *
2505
+ * You can use `ParseNodesByType[T]` instead of a conditional type like `Extract<ParseNode, { type: T }>` which is often
2506
+ * more expensive and can complicate assignability checks.
2507
+ */
2508
+ export type ParseNodesByType = {
2509
+ [N in ParseNode as N['type']]: N;
2510
+ };