tsc-ts 0.0.10 → 0.1.0

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 (367) hide show
  1. package/README.md +1 -1
  2. package/bin/tsc-ts.js +70 -1
  3. package/dist/api/compiler/ast-utilities.d.ts +19 -1
  4. package/dist/api/compiler/ast-utilities.js +180 -95
  5. package/dist/api/compiler/ast.d.ts +20 -15
  6. package/dist/api/compiler/ast.js +1023 -995
  7. package/dist/api/compiler/astnav.js +15 -15
  8. package/dist/api/compiler/binder-utilities.js +186 -186
  9. package/dist/api/compiler/binder.js +290 -263
  10. package/dist/api/compiler/character-codes.js +2 -2
  11. package/dist/api/compiler/checker-calls.js +173 -123
  12. package/dist/api/compiler/checker-classes.d.ts +14 -3
  13. package/dist/api/compiler/checker-classes.js +134 -90
  14. package/dist/api/compiler/checker-contextual.js +64 -61
  15. package/dist/api/compiler/checker-declaration-order.js +79 -79
  16. package/dist/api/compiler/checker-declarations.d.ts +1 -0
  17. package/dist/api/compiler/checker-declarations.js +160 -136
  18. package/dist/api/compiler/checker-declared-types.js +67 -65
  19. package/dist/api/compiler/checker-decorators.js +77 -77
  20. package/dist/api/compiler/checker-deprecation.d.ts +8 -3
  21. package/dist/api/compiler/checker-deprecation.js +76 -55
  22. package/dist/api/compiler/checker-destructuring.js +47 -45
  23. package/dist/api/compiler/checker-elaboration.js +24 -24
  24. package/dist/api/compiler/checker-emit-helpers.js +4 -4
  25. package/dist/api/compiler/checker-emit-resolver.d.ts +4 -2
  26. package/dist/api/compiler/checker-emit-resolver.js +25 -13
  27. package/dist/api/compiler/checker-evaluator.js +9 -9
  28. package/dist/api/compiler/checker-expressions.js +244 -211
  29. package/dist/api/compiler/checker-functions.js +113 -107
  30. package/dist/api/compiler/checker-generated-code.d.ts +0 -11
  31. package/dist/api/compiler/checker-generated-code.js +28 -52
  32. package/dist/api/compiler/checker-grammar.d.ts +1 -0
  33. package/dist/api/compiler/checker-grammar.js +469 -438
  34. package/dist/api/compiler/checker-heritage.js +91 -93
  35. package/dist/api/compiler/checker-inference.d.ts +77 -5
  36. package/dist/api/compiler/checker-inference.js +487 -113
  37. package/dist/api/compiler/checker-iteration.d.ts +0 -10
  38. package/dist/api/compiler/checker-iteration.js +35 -52
  39. package/dist/api/compiler/checker-javascript.js +14 -14
  40. package/dist/api/compiler/checker-jsdoc.d.ts +8 -10
  41. package/dist/api/compiler/checker-jsdoc.js +67 -58
  42. package/dist/api/compiler/checker-jsx.js +105 -88
  43. package/dist/api/compiler/checker-members.d.ts +9 -2
  44. package/dist/api/compiler/checker-members.js +210 -74
  45. package/dist/api/compiler/checker-modules.d.ts +15 -6
  46. package/dist/api/compiler/checker-modules.js +469 -309
  47. package/dist/api/compiler/checker-narrowing.js +273 -189
  48. package/dist/api/compiler/checker-object-literals.js +25 -22
  49. package/dist/api/compiler/checker-operators.js +126 -118
  50. package/dist/api/compiler/checker-overloads.js +27 -27
  51. package/dist/api/compiler/checker-property-access.js +59 -55
  52. package/dist/api/compiler/checker-services.d.ts +1 -0
  53. package/dist/api/compiler/checker-services.js +222 -210
  54. package/dist/api/compiler/checker-signatures.js +65 -49
  55. package/dist/api/compiler/checker-source-file.d.ts +5 -0
  56. package/dist/api/compiler/checker-source-file.js +154 -130
  57. package/dist/api/compiler/checker-statements.js +33 -32
  58. package/dist/api/compiler/checker-super.js +50 -50
  59. package/dist/api/compiler/checker-symbol-types.js +109 -93
  60. package/dist/api/compiler/checker-symbols.d.ts +13 -1
  61. package/dist/api/compiler/checker-symbols.js +264 -149
  62. package/dist/api/compiler/checker-type-factory.d.ts +5 -0
  63. package/dist/api/compiler/checker-type-factory.js +137 -34
  64. package/dist/api/compiler/checker-type-nodes.d.ts +1 -0
  65. package/dist/api/compiler/checker-type-nodes.js +179 -141
  66. package/dist/api/compiler/checker-type-operators.d.ts +2 -0
  67. package/dist/api/compiler/checker-type-operators.js +110 -63
  68. package/dist/api/compiler/checker-types.d.ts +80 -3
  69. package/dist/api/compiler/checker-types.js +121 -2
  70. package/dist/api/compiler/checker-unused.js +114 -118
  71. package/dist/api/compiler/checker-utilities.js +11 -11
  72. package/dist/api/compiler/checker.d.ts +93 -31
  73. package/dist/api/compiler/checker.js +143 -35
  74. package/dist/api/compiler/command-line.d.ts +1 -3
  75. package/dist/api/compiler/command-line.js +47 -44
  76. package/dist/api/compiler/compile-program.d.ts +19 -4
  77. package/dist/api/compiler/compile-program.js +45 -26
  78. package/dist/api/compiler/diagnostic-messages.d.ts +1849 -1774
  79. package/dist/api/compiler/diagnostic-messages.js +128 -122
  80. package/dist/api/compiler/diagnostics.js +7 -7
  81. package/dist/api/compiler/emitter.d.ts +7 -1
  82. package/dist/api/compiler/emitter.js +53 -11
  83. package/dist/api/compiler/file-include.d.ts +2 -1
  84. package/dist/api/compiler/file-include.js +11 -7
  85. package/dist/api/compiler/file-loader.d.ts +10 -0
  86. package/dist/api/compiler/file-loader.js +138 -41
  87. package/dist/api/compiler/instantiation.d.ts +7 -0
  88. package/dist/api/compiler/instantiation.js +101 -49
  89. package/dist/api/compiler/jsdoc.js +23 -23
  90. package/dist/api/compiler/link-tables.d.ts +48 -18
  91. package/dist/api/compiler/link-tables.js +80 -37
  92. package/dist/api/compiler/locales/cs-CZ.d.ts +1 -1
  93. package/dist/api/compiler/locales/cs-CZ.js +1 -1
  94. package/dist/api/compiler/locales/de-DE.d.ts +1 -1
  95. package/dist/api/compiler/locales/de-DE.js +1 -1
  96. package/dist/api/compiler/locales/es-ES.d.ts +1 -1
  97. package/dist/api/compiler/locales/es-ES.js +1 -1
  98. package/dist/api/compiler/locales/fr-FR.d.ts +1 -1
  99. package/dist/api/compiler/locales/fr-FR.js +1 -1
  100. package/dist/api/compiler/locales/it-IT.d.ts +1 -1
  101. package/dist/api/compiler/locales/it-IT.js +1 -1
  102. package/dist/api/compiler/locales/ja-JP.d.ts +1 -1
  103. package/dist/api/compiler/locales/ja-JP.js +1 -1
  104. package/dist/api/compiler/locales/ko-KR.d.ts +1 -1
  105. package/dist/api/compiler/locales/ko-KR.js +1 -1
  106. package/dist/api/compiler/locales/pl-PL.d.ts +1 -1
  107. package/dist/api/compiler/locales/pl-PL.js +1 -1
  108. package/dist/api/compiler/locales/pt-BR.d.ts +1 -1
  109. package/dist/api/compiler/locales/pt-BR.js +1 -1
  110. package/dist/api/compiler/locales/ru-RU.d.ts +1 -1
  111. package/dist/api/compiler/locales/ru-RU.js +1 -1
  112. package/dist/api/compiler/locales/tr-TR.d.ts +1 -1
  113. package/dist/api/compiler/locales/tr-TR.js +1 -1
  114. package/dist/api/compiler/locales/zh-CN.d.ts +1 -1
  115. package/dist/api/compiler/locales/zh-CN.js +1 -1
  116. package/dist/api/compiler/locales/zh-TW.d.ts +1 -1
  117. package/dist/api/compiler/locales/zh-TW.js +1 -1
  118. package/dist/api/compiler/module-resolution-types.js +6 -6
  119. package/dist/api/compiler/module-resolution.d.ts +10 -1
  120. package/dist/api/compiler/module-resolution.js +115 -84
  121. package/dist/api/compiler/module-specifiers.d.ts +15 -0
  122. package/dist/api/compiler/module-specifiers.js +24 -18
  123. package/dist/api/compiler/name-resolver.js +74 -65
  124. package/dist/api/compiler/node-builder-names.d.ts +11 -3
  125. package/dist/api/compiler/node-builder-names.js +210 -90
  126. package/dist/api/compiler/node-builder-pseudo.js +29 -31
  127. package/dist/api/compiler/node-builder-reuse.js +23 -22
  128. package/dist/api/compiler/node-builder.d.ts +18 -1
  129. package/dist/api/compiler/node-builder.js +191 -102
  130. package/dist/api/compiler/option-declarations.d.ts +2 -6
  131. package/dist/api/compiler/option-declarations.js +315 -375
  132. package/dist/api/compiler/options.d.ts +15 -33
  133. package/dist/api/compiler/options.js +21 -54
  134. package/dist/api/compiler/output-paths.d.ts +4 -1
  135. package/dist/api/compiler/output-paths.js +6 -11
  136. package/dist/api/compiler/package-json.d.ts +3 -3
  137. package/dist/api/compiler/package-json.js +11 -10
  138. package/dist/api/compiler/parser.d.ts +40 -19
  139. package/dist/api/compiler/parser.js +308 -216
  140. package/dist/api/compiler/path.d.ts +9 -0
  141. package/dist/api/compiler/path.js +20 -3
  142. package/dist/api/compiler/printer/emit-context.d.ts +3 -1
  143. package/dist/api/compiler/printer/emit-context.js +16 -1
  144. package/dist/api/compiler/printer/factory-base.d.ts +2 -2
  145. package/dist/api/compiler/printer/factory-base.js +7 -3
  146. package/dist/api/compiler/printer/factory.js +3 -1
  147. package/dist/api/compiler/printer/helpers.js +10 -1
  148. package/dist/api/compiler/printer/name-generator.d.ts +1 -1
  149. package/dist/api/compiler/printer/name-generator.js +35 -16
  150. package/dist/api/compiler/printer/printer.d.ts +1 -0
  151. package/dist/api/compiler/printer/printer.js +303 -281
  152. package/dist/api/compiler/printer/utilities.js +149 -147
  153. package/dist/api/compiler/program-checker.d.ts +8 -2
  154. package/dist/api/compiler/program-checker.js +84 -34
  155. package/dist/api/compiler/program-utilities.d.ts +3 -1
  156. package/dist/api/compiler/program-utilities.js +28 -15
  157. package/dist/api/compiler/program.d.ts +2 -0
  158. package/dist/api/compiler/program.js +69 -57
  159. package/dist/api/compiler/pseudo-bigint.d.ts +2 -0
  160. package/dist/api/compiler/pseudo-bigint.js +18 -0
  161. package/dist/api/compiler/regexp-checker.d.ts +1 -1
  162. package/dist/api/compiler/regexp-checker.js +93 -76
  163. package/dist/api/compiler/relations.d.ts +27 -4
  164. package/dist/api/compiler/relations.js +337 -180
  165. package/dist/api/compiler/reparser.js +60 -56
  166. package/dist/api/compiler/scanner.d.ts +19 -2
  167. package/dist/api/compiler/scanner.js +123 -108
  168. package/dist/api/compiler/shared-results.d.ts +463 -0
  169. package/dist/api/compiler/shared-results.js +2128 -0
  170. package/dist/api/compiler/sourcemap.js +2 -2
  171. package/dist/api/compiler/symbol-accessibility.js +87 -74
  172. package/dist/api/compiler/symbol.d.ts +22 -13
  173. package/dist/api/compiler/symbol.js +15 -1
  174. package/dist/api/compiler/syntax-kind.d.ts +198 -197
  175. package/dist/api/compiler/transformers/alias-references.js +247 -139
  176. package/dist/api/compiler/transformers/async-utilities.js +25 -25
  177. package/dist/api/compiler/transformers/async.d.ts +0 -1
  178. package/dist/api/compiler/transformers/async.js +64 -77
  179. package/dist/api/compiler/transformers/class-fields.d.ts +1 -0
  180. package/dist/api/compiler/transformers/class-fields.js +81 -78
  181. package/dist/api/compiler/transformers/commonjs-module.js +18 -15
  182. package/dist/api/compiler/transformers/const-enum-inliner.js +1 -1
  183. package/dist/api/compiler/transformers/declarations-diagnostics.js +247 -244
  184. package/dist/api/compiler/transformers/declarations-pseudo.js +100 -100
  185. package/dist/api/compiler/transformers/declarations-resolver.d.ts +0 -3
  186. package/dist/api/compiler/transformers/declarations-syntactic.d.ts +1 -2
  187. package/dist/api/compiler/transformers/declarations-syntactic.js +134 -156
  188. package/dist/api/compiler/transformers/declarations-tracker.js +18 -18
  189. package/dist/api/compiler/transformers/declarations.d.ts +4 -1
  190. package/dist/api/compiler/transformers/declarations.js +305 -238
  191. package/dist/api/compiler/transformers/decorator-metadata.d.ts +1 -1
  192. package/dist/api/compiler/transformers/decorator-metadata.js +53 -45
  193. package/dist/api/compiler/transformers/decorator-utilities.js +24 -24
  194. package/dist/api/compiler/transformers/destructuring.js +19 -18
  195. package/dist/api/compiler/transformers/emit-resolver.js +1 -1
  196. package/dist/api/compiler/transformers/es-decorators.js +55 -55
  197. package/dist/api/compiler/transformers/external-module-info.js +3 -3
  198. package/dist/api/compiler/transformers/for-await.js +25 -25
  199. package/dist/api/compiler/transformers/import-elision.js +14 -14
  200. package/dist/api/compiler/transformers/jsx.js +12 -12
  201. package/dist/api/compiler/transformers/legacy-decorators.js +17 -17
  202. package/dist/api/compiler/transformers/module.js +8 -8
  203. package/dist/api/compiler/transformers/named-evaluation.js +4 -4
  204. package/dist/api/compiler/transformers/object-rest-spread.js +20 -20
  205. package/dist/api/compiler/transformers/optional-chain.js +10 -10
  206. package/dist/api/compiler/transformers/reference-resolver.d.ts +12 -1
  207. package/dist/api/compiler/transformers/reference-resolver.js +131 -69
  208. package/dist/api/compiler/transformers/runtime-syntax.js +35 -31
  209. package/dist/api/compiler/transformers/subtree-facts.js +47 -47
  210. package/dist/api/compiler/transformers/syntax-facts.js +56 -58
  211. package/dist/api/compiler/transformers/type-eraser.js +73 -66
  212. package/dist/api/compiler/transformers/type-serialization.js +24 -24
  213. package/dist/api/compiler/transformers/using.js +12 -12
  214. package/dist/api/compiler/transformers/utilities.js +77 -77
  215. package/dist/api/compiler/transformers/visitor-base.js +172 -172
  216. package/dist/api/compiler/transformers/visitor-hooks.js +6 -2
  217. package/dist/api/compiler/tsconfig.d.ts +10 -2
  218. package/dist/api/compiler/tsconfig.js +136 -48
  219. package/dist/api/compiler/type-printer.js +40 -3
  220. package/dist/api/compiler/types.d.ts +2 -1
  221. package/dist/api/library/ast.generated.d.ts +42 -39
  222. package/dist/api/library/ast.generated.js +1 -1
  223. package/dist/api/library/compiler-options.generated.d.ts +111 -100
  224. package/dist/api/library/compiler-options.generated.js +1 -1
  225. package/dist/api/library/disk.js +12 -1
  226. package/dist/api/library/enums.generated.d.ts +206 -206
  227. package/dist/api/library/enums.generated.js +206 -206
  228. package/dist/api/library/nodes.js +26 -26
  229. package/package.json +9 -9
  230. package/src/compiler/ast-utilities.ts +99 -7
  231. package/src/compiler/ast.ts +55 -26
  232. package/src/compiler/binder.ts +39 -4
  233. package/src/compiler/character-codes.ts +2 -2
  234. package/src/compiler/checker-calls.ts +76 -8
  235. package/src/compiler/checker-classes.ts +78 -24
  236. package/src/compiler/checker-contextual.ts +6 -1
  237. package/src/compiler/checker-declarations.ts +31 -4
  238. package/src/compiler/checker-declared-types.ts +8 -5
  239. package/src/compiler/checker-decorators.ts +1 -1
  240. package/src/compiler/checker-deprecation.ts +29 -8
  241. package/src/compiler/checker-destructuring.ts +10 -3
  242. package/src/compiler/checker-emit-helpers.ts +1 -0
  243. package/src/compiler/checker-emit-resolver.ts +16 -6
  244. package/src/compiler/checker-expressions.ts +79 -46
  245. package/src/compiler/checker-functions.ts +21 -6
  246. package/src/compiler/checker-generated-code.ts +2 -22
  247. package/src/compiler/checker-grammar.ts +133 -60
  248. package/src/compiler/checker-heritage.ts +22 -21
  249. package/src/compiler/checker-inference.ts +514 -87
  250. package/src/compiler/checker-iteration.ts +18 -31
  251. package/src/compiler/checker-javascript.ts +1 -1
  252. package/src/compiler/checker-jsdoc.ts +50 -27
  253. package/src/compiler/checker-jsx.ts +26 -4
  254. package/src/compiler/checker-members.ts +197 -55
  255. package/src/compiler/checker-modules.ts +332 -65
  256. package/src/compiler/checker-narrowing.ts +98 -19
  257. package/src/compiler/checker-object-literals.ts +3 -0
  258. package/src/compiler/checker-operators.ts +11 -4
  259. package/src/compiler/checker-property-access.ts +7 -2
  260. package/src/compiler/checker-services.ts +39 -12
  261. package/src/compiler/checker-signatures.ts +15 -1
  262. package/src/compiler/checker-source-file.ts +39 -13
  263. package/src/compiler/checker-statements.ts +3 -2
  264. package/src/compiler/checker-symbol-types.ts +29 -6
  265. package/src/compiler/checker-symbols.ts +158 -15
  266. package/src/compiler/checker-type-factory.ts +120 -21
  267. package/src/compiler/checker-type-nodes.ts +46 -3
  268. package/src/compiler/checker-type-operators.ts +83 -26
  269. package/src/compiler/checker-types.ts +147 -4
  270. package/src/compiler/checker-unused.ts +9 -14
  271. package/src/compiler/checker.ts +168 -41
  272. package/src/compiler/command-line.ts +28 -28
  273. package/src/compiler/compile-program.ts +51 -25
  274. package/src/compiler/decoder.ts +13 -4
  275. package/src/compiler/diagnostic-messages.ts +1973 -1892
  276. package/src/compiler/emitter.ts +57 -8
  277. package/src/compiler/encoder.ts +23 -8
  278. package/src/compiler/file-include.ts +9 -3
  279. package/src/compiler/file-loader.ts +139 -32
  280. package/src/compiler/help.ts +10 -14
  281. package/src/compiler/incremental.ts +86 -18
  282. package/src/compiler/init.ts +2 -7
  283. package/src/compiler/instantiation.ts +77 -22
  284. package/src/compiler/jsdoc.ts +3 -1
  285. package/src/compiler/link-tables.ts +82 -37
  286. package/src/compiler/locales/cs-CZ.ts +1 -1
  287. package/src/compiler/locales/de-DE.ts +1 -1
  288. package/src/compiler/locales/es-ES.ts +1 -1
  289. package/src/compiler/locales/fr-FR.ts +1 -1
  290. package/src/compiler/locales/it-IT.ts +1 -1
  291. package/src/compiler/locales/ja-JP.ts +1 -1
  292. package/src/compiler/locales/ko-KR.ts +1 -1
  293. package/src/compiler/locales/pl-PL.ts +1 -1
  294. package/src/compiler/locales/pt-BR.ts +1 -1
  295. package/src/compiler/locales/ru-RU.ts +1 -1
  296. package/src/compiler/locales/tr-TR.ts +1 -1
  297. package/src/compiler/locales/zh-CN.ts +1 -1
  298. package/src/compiler/locales/zh-TW.ts +1 -1
  299. package/src/compiler/module-resolution.ts +44 -8
  300. package/src/compiler/module-specifiers.ts +62 -20
  301. package/src/compiler/name-resolver.ts +9 -1
  302. package/src/compiler/node-builder-names.ts +236 -54
  303. package/src/compiler/node-builder-pseudo.ts +4 -7
  304. package/src/compiler/node-builder-reuse.ts +5 -4
  305. package/src/compiler/node-builder.ts +130 -31
  306. package/src/compiler/option-declarations.ts +33 -103
  307. package/src/compiler/options.ts +23 -62
  308. package/src/compiler/output-paths.ts +5 -18
  309. package/src/compiler/package-entrypoints.ts +345 -0
  310. package/src/compiler/package-json.ts +4 -4
  311. package/src/compiler/parallel-check.ts +197 -8
  312. package/src/compiler/parallel-emit.ts +1 -1
  313. package/src/compiler/parser.ts +156 -39
  314. package/src/compiler/path.ts +22 -2
  315. package/src/compiler/printer/emit-context.ts +16 -0
  316. package/src/compiler/printer/factory-base.ts +10 -3
  317. package/src/compiler/printer/factory.ts +4 -1
  318. package/src/compiler/printer/helpers.ts +10 -1
  319. package/src/compiler/printer/name-generator.ts +24 -2
  320. package/src/compiler/printer/printer.ts +35 -14
  321. package/src/compiler/printer/utilities.ts +8 -2
  322. package/src/compiler/program-checker.ts +53 -5
  323. package/src/compiler/program-utilities.ts +23 -10
  324. package/src/compiler/program.ts +13 -1
  325. package/src/compiler/pseudo-bigint.ts +17 -0
  326. package/src/compiler/regexp-checker.ts +63 -30
  327. package/src/compiler/relations.ts +233 -77
  328. package/src/compiler/reparser.ts +7 -2
  329. package/src/compiler/scanner.ts +109 -79
  330. package/src/compiler/shared-results.ts +2414 -0
  331. package/src/compiler/show-config.ts +18 -1
  332. package/src/compiler/sourcemap.ts +2 -2
  333. package/src/compiler/symbol-accessibility.ts +26 -3
  334. package/src/compiler/symbol.ts +31 -14
  335. package/src/compiler/syntax-kind.ts +188 -187
  336. package/src/compiler/thread-entry.ts +19 -2
  337. package/src/compiler/transformers/alias-references.ts +123 -4
  338. package/src/compiler/transformers/async.ts +2 -17
  339. package/src/compiler/transformers/class-fields.ts +13 -12
  340. package/src/compiler/transformers/commonjs-module.ts +11 -7
  341. package/src/compiler/transformers/declarations-diagnostics.ts +5 -3
  342. package/src/compiler/transformers/declarations-pseudo.ts +2 -4
  343. package/src/compiler/transformers/declarations-resolver.ts +0 -3
  344. package/src/compiler/transformers/declarations-syntactic.ts +1 -21
  345. package/src/compiler/transformers/declarations.ts +134 -48
  346. package/src/compiler/transformers/decorator-metadata.ts +9 -1
  347. package/src/compiler/transformers/destructuring.ts +4 -3
  348. package/src/compiler/transformers/external-module-info.ts +1 -1
  349. package/src/compiler/transformers/jsx.ts +2 -1
  350. package/src/compiler/transformers/reference-resolver.ts +83 -19
  351. package/src/compiler/transformers/runtime-syntax.ts +6 -1
  352. package/src/compiler/transformers/syntax-facts.ts +2 -7
  353. package/src/compiler/transformers/type-eraser.ts +10 -1
  354. package/src/compiler/transformers/type-serialization.ts +3 -2
  355. package/src/compiler/transformers/visitor-base.ts +2 -1
  356. package/src/compiler/transformers/visitor-hooks.ts +9 -4
  357. package/src/compiler/tsc-build.ts +3 -0
  358. package/src/compiler/tsc-cli.ts +2 -0
  359. package/src/compiler/tsc-compile.ts +7 -2
  360. package/src/compiler/tsc-watch.ts +74 -45
  361. package/src/compiler/tsconfig.ts +176 -19
  362. package/src/compiler/type-printer.ts +36 -2
  363. package/src/compiler/types.ts +2 -1
  364. package/src/library/ast.generated.ts +57 -41
  365. package/src/library/compiler-options.generated.ts +117 -103
  366. package/src/library/disk.ts +10 -1
  367. package/src/library/enums.generated.ts +196 -196
@@ -2,7 +2,7 @@
2
2
  // values, alias targets and module exports, like tsgo's checker services. These answer *some*
3
3
  // symbol or type for any node; the checker itself uses the precise functions they call.
4
4
  import { getArguments, getExpression, getInitializer, getName, getParameters, getPropertyName, getSymbol, getTagName, getText, getType, getTypeArguments, isDeclarationNode, NodeVisitor, } from './ast.js';
5
- import { compareNodePositions, getExternalModuleName, isAssignmentOperator, isFunctionLike, isImportCall, isLiteralImportTypeNode, isStringLiteralLike, isTypeDeclaration, nodeIsMissing, } from './ast-utilities.js';
5
+ import { compareNodePositions, getExternalModuleName, isAssignmentOperator, isFunctionLike, isImportCall, isLiteralImportTypeNode, isNameOfHeritageClauseTypeReference, isStringLiteralLike, isTypeDeclaration, nodeIsMissing, isImportPhaseMetaProperty, } from './ast-utilities.js';
6
6
  import { getNameOfDeclaration, getSourceFileOfNode, getThisContainer, isAssignmentTarget, isBindableObjectDefinePropertyCall, isClassLike, isEnumConst, isExternalOrCommonJSModule, isVariableDeclarationInitializedToRequire, } from './binder-utilities.js';
7
7
  import { getResolvedSignature, tryGetRestTypeOfSignature } from './checker-calls.js';
8
8
  import { getContextualType } from './checker-contextual.js';
@@ -10,7 +10,7 @@ import { computeEnumMemberValues, getBaseTypes, getDeclaredTypeOfClassOrInterfac
10
10
  import { checkExpression, checkExpressionCached, checkPropertyAccessExpression, checkQualifiedName, isThisInTypeQuery, } from './checker-expressions.js';
11
11
  import { getIntrinsicTagSymbol, isJsxIntrinsicTagName } from './checker-jsx.js';
12
12
  import { getApplicableIndexInfo, getIndexInfosOfType, getPropertyOfType, getTypeWithThisArgument, isApplicableIndexType, } from './checker-members.js';
13
- import { checkNewTargetMetaProperty, getExternalModuleMember, getHostSignatureFromJSDoc, getSymbolOfPartOfRightHandSideOfImportEquals, getTargetOfAliasDeclaration, resolveExternalModuleName, resolveJSDocMemberName, } from './checker-modules.js';
13
+ import { checkNewTargetMetaProperty, getExternalModuleMember, getHostSignatureFromJSDoc, getSymbolOfPartOfRightHandSideOfImportEquals, getTargetOfAliasDeclaration, resolveExternalModuleName, resolveJSDocMemberName, checkImportAttributesExpression, getImportAttributesTypeForModuleSpecifier, } from './checker-modules.js';
14
14
  import { getSymbolHasInstanceMethodOfObjectType } from './checker-operators.js';
15
15
  import { getSymbolForPrivateIdentifierExpression } from './checker-property-access.js';
16
16
  import { getSignatureFromDeclaration } from './checker-signatures.js';
@@ -29,7 +29,7 @@ export function getSymbolAtLocation(c, node) {
29
29
  }
30
30
  /** The symbol a node refers to, reporting resolution errors unless `ignoreErrors`. */
31
31
  export function getSymbolAtLocationWorker(c, node, ignoreErrors) {
32
- if (node.kind === 307 /* SyntaxKind.SourceFile */)
32
+ if (node.kind === 308 /* SyntaxKind.SourceFile */)
33
33
  return isExternalOrCommonJSModule(node) ? getSymbolOfDeclaration(c, node) : undefined;
34
34
  const parent = node.parent;
35
35
  const grandParent = parent.parent;
@@ -47,14 +47,14 @@ export function getSymbolAtLocationWorker(c, node, ignoreErrors) {
47
47
  if (node.kind === 79 /* SyntaxKind.Identifier */) {
48
48
  if (isInRightSideOfImportOrExportAssignment(node))
49
49
  return getSymbolOfNameOrPropertyAccessExpression(c, node);
50
- if (parent.kind === 209 /* SyntaxKind.BindingElement */ &&
51
- grandParent.kind === 207 /* SyntaxKind.ObjectBindingPattern */ &&
50
+ if (parent.kind === 210 /* SyntaxKind.BindingElement */ &&
51
+ grandParent.kind === 208 /* SyntaxKind.ObjectBindingPattern */ &&
52
52
  node === getPropertyName(parent)) {
53
53
  const property = getPropertyOfType(c, getTypeOfNode(c, grandParent), getText(node));
54
54
  if (property !== undefined)
55
55
  return property;
56
56
  }
57
- else if (parent.kind === 237 /* SyntaxKind.MetaProperty */ && parent.name === node) {
57
+ else if (parent.kind === 238 /* SyntaxKind.MetaProperty */ && parent.name === node) {
58
58
  const meta = parent;
59
59
  // `target` in `new.target`.
60
60
  if (meta.keywordToken === 104 /* SyntaxKind.NewKeyword */ && getText(node) === 'target')
@@ -65,7 +65,7 @@ export function getSymbolAtLocationWorker(c, node, ignoreErrors) {
65
65
  // Other meta properties are invalid syntax.
66
66
  return undefined;
67
67
  }
68
- else if (parent.kind === 333 /* SyntaxKind.JSDocParameterTag */ && getName(parent) === node) {
68
+ else if (parent.kind === 334 /* SyntaxKind.JSDocParameterTag */ && getName(parent) === node) {
69
69
  const fn = getNodeAtPosition(getSourceFileOfNode(node), node.pos, false);
70
70
  if (isFunctionLike(fn)) {
71
71
  for (const param of getParameters(fn).nodes) {
@@ -79,20 +79,20 @@ export function getSymbolAtLocationWorker(c, node, ignoreErrors) {
79
79
  switch (node.kind) {
80
80
  case 79 /* SyntaxKind.Identifier */:
81
81
  case 80 /* SyntaxKind.PrivateIdentifier */:
82
- case 212 /* SyntaxKind.PropertyAccessExpression */:
83
- case 167 /* SyntaxKind.QualifiedName */:
82
+ case 213 /* SyntaxKind.PropertyAccessExpression */:
83
+ case 168 /* SyntaxKind.QualifiedName */:
84
84
  if (!isThisInTypeQuery(node))
85
85
  return getSymbolOfNameOrPropertyAccessExpression(c, node);
86
86
  return getSymbolOfThis(c, node);
87
87
  case 109 /* SyntaxKind.ThisKeyword */:
88
88
  return getSymbolOfThis(c, node);
89
- case 198 /* SyntaxKind.ThisType */:
89
+ case 199 /* SyntaxKind.ThisType */:
90
90
  return getTypeFromThisTypeNode(c, node).symbol;
91
91
  case 107 /* SyntaxKind.SuperKeyword */:
92
92
  return checkExpression(c, node).symbol;
93
93
  case 136 /* SyntaxKind.ConstructorKeyword */:
94
94
  // The keyword of a constructor overload.
95
- return parent.kind === 177 /* SyntaxKind.Constructor */ ? getSymbol(parent.parent) : undefined;
95
+ return parent.kind === 178 /* SyntaxKind.Constructor */ ? getSymbol(parent.parent) : undefined;
96
96
  case 10 /* SyntaxKind.StringLiteral */:
97
97
  case 14 /* SyntaxKind.NoSubstitutionTemplateLiteral */:
98
98
  // Module names: `import x = require("m")`, import and export declarations, `require("m")`,
@@ -100,18 +100,18 @@ export function getSymbolAtLocationWorker(c, node, ignoreErrors) {
100
100
  if ((grandParent !== undefined &&
101
101
  isExternalModuleImportEqualsDeclaration(grandParent) &&
102
102
  grandParent.moduleReference.expression === node) ||
103
- ((parent.kind === 273 /* SyntaxKind.ImportDeclaration */ ||
104
- parent.kind === 346 /* SyntaxKind.JSImportDeclaration */ ||
105
- parent.kind === 279 /* SyntaxKind.ExportDeclaration */) &&
103
+ ((parent.kind === 274 /* SyntaxKind.ImportDeclaration */ ||
104
+ parent.kind === 347 /* SyntaxKind.JSImportDeclaration */ ||
105
+ parent.kind === 280 /* SyntaxKind.ExportDeclaration */) &&
106
106
  getExternalModuleName(parent) === node) ||
107
107
  (grandParent !== undefined && isVariableDeclarationInitializedToRequire(grandParent)) ||
108
108
  isImportCall(parent) ||
109
- (parent.kind === 202 /* SyntaxKind.LiteralType */ &&
109
+ (parent.kind === 203 /* SyntaxKind.LiteralType */ &&
110
110
  grandParent !== undefined &&
111
111
  isLiteralImportTypeNode(grandParent) &&
112
112
  grandParent.argument === parent))
113
- return resolveExternalModuleName(c, node, node, ignoreErrors);
114
- if (parent.kind === 214 /* SyntaxKind.CallExpression */ &&
113
+ return resolveExternalModuleName(c, node, node, ignoreErrors, getImportAttributesTypeForModuleSpecifier(c, node));
114
+ if (parent.kind === 215 /* SyntaxKind.CallExpression */ &&
115
115
  isBindableObjectDefinePropertyCall(parent) &&
116
116
  getArguments(parent).nodes[1] === node)
117
117
  return getSymbolOfDeclaration(c, parent);
@@ -123,20 +123,20 @@ export function getSymbolAtLocationWorker(c, node, ignoreErrors) {
123
123
  case 38 /* SyntaxKind.EqualsGreaterThanToken */:
124
124
  case 85 /* SyntaxKind.ClassKeyword */:
125
125
  return getSymbolOfDeclaration(c, parent);
126
- case 206 /* SyntaxKind.ImportType */:
126
+ case 207 /* SyntaxKind.ImportType */:
127
127
  if (isLiteralImportTypeNode(node))
128
128
  return getSymbolAtLocationWorker(c, node.argument.literal, ignoreErrors);
129
129
  return undefined;
130
130
  case 94 /* SyntaxKind.ExportKeyword */:
131
- return parent.kind === 278 /* SyntaxKind.ExportAssignment */ ? getSymbol(parent) : undefined;
131
+ return parent.kind === 279 /* SyntaxKind.ExportAssignment */ ? getSymbol(parent) : undefined;
132
132
  case 101 /* SyntaxKind.ImportKeyword */:
133
- if (parent.kind === 237 /* SyntaxKind.MetaProperty */ && parent.name.text === 'defer')
133
+ if (isImportPhaseMetaProperty(parent))
134
134
  return undefined;
135
- return parent.kind === 237 /* SyntaxKind.MetaProperty */ ? checkMetaPropertyKeyword(c).symbol : undefined;
135
+ return parent.kind === 238 /* SyntaxKind.MetaProperty */ ? checkMetaPropertyKeyword(c).symbol : undefined;
136
136
  case 104 /* SyntaxKind.NewKeyword */:
137
- return parent.kind === 237 /* SyntaxKind.MetaProperty */ ? checkMetaPropertyKeyword(c).symbol : undefined;
137
+ return parent.kind === 238 /* SyntaxKind.MetaProperty */ ? checkMetaPropertyKeyword(c).symbol : undefined;
138
138
  case 103 /* SyntaxKind.InstanceOfKeyword */:
139
- if (parent.kind === 227 /* SyntaxKind.BinaryExpression */) {
139
+ if (parent.kind === 228 /* SyntaxKind.BinaryExpression */) {
140
140
  const t = checkExpressionCached(c, parent.right);
141
141
  const hasInstanceMethodType = getSymbolHasInstanceMethodOfObjectType(c, t);
142
142
  if (hasInstanceMethodType !== undefined && hasInstanceMethodType.symbol !== undefined)
@@ -144,9 +144,9 @@ export function getSymbolAtLocationWorker(c, node, ignoreErrors) {
144
144
  return t.symbol;
145
145
  }
146
146
  return undefined;
147
- case 237 /* SyntaxKind.MetaProperty */:
147
+ case 238 /* SyntaxKind.MetaProperty */:
148
148
  return checkExpression(c, node).symbol;
149
- case 296 /* SyntaxKind.JsxNamespacedName */:
149
+ case 297 /* SyntaxKind.JsxNamespacedName */:
150
150
  if (isJsxTagName(node) && isJsxIntrinsicTagName(node)) {
151
151
  const symbol = getIntrinsicTagSymbol(c, parent);
152
152
  return symbol === c.unknownSymbol ? undefined : symbol;
@@ -171,11 +171,11 @@ function getSymbolOfThis(c, node) {
171
171
  function getSymbolOfLiteralIndex(c, node) {
172
172
  const parent = node.parent;
173
173
  let objectType;
174
- if (parent.kind === 213 /* SyntaxKind.ElementAccessExpression */) {
174
+ if (parent.kind === 214 /* SyntaxKind.ElementAccessExpression */) {
175
175
  if (parent.argumentExpression === node)
176
176
  objectType = checkExpressionCached(c, parent.expression);
177
177
  }
178
- else if (parent.kind === 202 /* SyntaxKind.LiteralType */ && parent.parent.kind === 200 /* SyntaxKind.IndexedAccessType */)
178
+ else if (parent.kind === 203 /* SyntaxKind.LiteralType */ && parent.parent.kind === 201 /* SyntaxKind.IndexedAccessType */)
179
179
  objectType = getTypeFromTypeNode(c, parent.parent.objectType);
180
180
  return objectType !== undefined ? getPropertyOfType(c, objectType, getText(node)) : undefined;
181
181
  }
@@ -183,7 +183,7 @@ function getSymbolOfNameOrPropertyAccessExpression(c, nameIn) {
183
183
  let name = nameIn;
184
184
  if (isDeclarationName(name))
185
185
  return getSymbolOfDeclaration(c, name.parent);
186
- if (name.parent.kind === 278 /* SyntaxKind.ExportAssignment */ && isEntityNameExpression(name)) {
186
+ if (name.parent.kind === 279 /* SyntaxKind.ExportAssignment */ && isEntityNameExpression(name)) {
187
187
  // An entity name that doesn't resolve as one may still check as a property access.
188
188
  const meaning = 111551 /* SymbolFlags.Value */ | 788968 /* SymbolFlags.Type */ | 1920 /* SymbolFlags.Namespace */ | 2097152 /* SymbolFlags.Alias */;
189
189
  const success = resolveEntityName(c, name, meaning, true, false, undefined);
@@ -204,10 +204,11 @@ function getSymbolOfNameOrPropertyAccessExpression(c, nameIn) {
204
204
  }
205
205
  while (isRightSideOfQualifiedNameOrPropertyAccess(name))
206
206
  name = name.parent;
207
- if (isInNameOfExpressionWithTypeArguments(name)) {
207
+ if (isInNameOfExpressionWithTypeArgumentsOrHeritageTypeReference(name)) {
208
208
  let meaning;
209
- if (name.parent.kind === 234 /* SyntaxKind.ExpressionWithTypeArguments */) {
210
- // `extends Bar<T>` in an interface is a type, `foo<T>` a value, and a class `extends` both.
209
+ if (name.parent.kind === 235 /* SyntaxKind.ExpressionWithTypeArguments */ ||
210
+ name.parent.kind === 185 /* SyntaxKind.TypeReference */) {
211
+ // A heritage element name is a type, `foo<T>` a value, and a class `extends` both.
211
212
  meaning = isPartOfTypeNode(name) ? 788968 /* SymbolFlags.Type */ : 111551 /* SymbolFlags.Value */;
212
213
  if (isExpressionWithTypeArgumentsInClassExtendsClause(name.parent))
213
214
  meaning |= 111551 /* SymbolFlags.Value */;
@@ -252,11 +253,11 @@ function getSymbolOfNameOrPropertyAccessExpression(c, nameIn) {
252
253
  }
253
254
  if (name.kind === 80 /* SyntaxKind.PrivateIdentifier */)
254
255
  return getSymbolForPrivateIdentifierExpression(c, name);
255
- if (name.kind === 212 /* SyntaxKind.PropertyAccessExpression */ || name.kind === 167 /* SyntaxKind.QualifiedName */) {
256
+ if (name.kind === 213 /* SyntaxKind.PropertyAccessExpression */ || name.kind === 168 /* SyntaxKind.QualifiedName */) {
256
257
  const cached = c.resolvedSymbols.get(name.id);
257
258
  if (cached !== undefined)
258
259
  return cached;
259
- if (name.kind === 212 /* SyntaxKind.PropertyAccessExpression */) {
260
+ if (name.kind === 213 /* SyntaxKind.PropertyAccessExpression */) {
260
261
  const access = name;
261
262
  checkPropertyAccessExpression(c, access, false);
262
263
  if (c.resolvedSymbols.get(name.id) === undefined && access.name.kind !== 80 /* SyntaxKind.PrivateIdentifier */)
@@ -264,19 +265,21 @@ function getSymbolOfNameOrPropertyAccessExpression(c, nameIn) {
264
265
  }
265
266
  else
266
267
  checkQualifiedName(c, name);
267
- if (c.resolvedSymbols.get(name.id) === undefined && isJSDoc && name.kind === 167 /* SyntaxKind.QualifiedName */)
268
+ if (c.resolvedSymbols.get(name.id) === undefined && isJSDoc && name.kind === 168 /* SyntaxKind.QualifiedName */)
268
269
  return resolveJSDocMemberName(c, name);
269
270
  return c.resolvedSymbols.get(name.id);
270
271
  }
271
272
  }
272
273
  else if (isEntityName(name) && isTypeReferenceIdentifier(name)) {
273
- const meaning = name.parent.kind === 184 /* SyntaxKind.TypeReference */ ? 788968 /* SymbolFlags.Type */ : 1920 /* SymbolFlags.Namespace */;
274
+ const meaning = name.parent.kind === 185 /* SyntaxKind.TypeReference */ ? 788968 /* SymbolFlags.Type */ : 1920 /* SymbolFlags.Namespace */;
274
275
  const symbol = resolveEntityName(c, name, meaning, true, true, undefined);
275
276
  if (symbol !== undefined && symbol !== c.unknownSymbol)
276
277
  return symbol;
278
+ if (isNameOfHeritageClauseTypeReference(name))
279
+ return undefined;
277
280
  return getUnresolvedSymbolForEntityName(c, name);
278
281
  }
279
- if (name.parent.kind === 183 /* SyntaxKind.TypePredicate */)
282
+ if (name.parent.kind === 184 /* SyntaxKind.TypePredicate */)
280
283
  return resolveEntityName(c, name, 1 /* SymbolFlags.FunctionScopedVariable */, true, false, undefined);
281
284
  return undefined;
282
285
  }
@@ -294,7 +297,7 @@ function getApplicableIndexSymbol(c, t, keyType) {
294
297
  if (other.declaration !== undefined && isApplicableIndexType(c, keyType, other.keyType))
295
298
  declarations.push(other.declaration);
296
299
  if (declarations.length !== 0) {
297
- const symbol = c.newSymbolWithCheckFlags(4 /* SymbolFlags.Property */, "\uFFFEindex" /* InternalSymbolName.Index */, 8388608 /* CheckFlags.IndexSymbol */);
300
+ const symbol = c.newSymbolWithCheckFlags(4 /* SymbolFlags.Property */, "\uFFFEindex" /* InternalSymbolName.Index */, 67108864 /* CheckFlags.IndexSymbol */);
298
301
  setDeclarations(symbol, declarations);
299
302
  symbol.valueDeclaration = declarations[0];
300
303
  symbol.parent = t.symbol;
@@ -329,13 +332,13 @@ function checkMetaPropertyKeyword(c) {
329
332
  export function getTypeAtLocation(c, node) {
330
333
  return getTypeOfNode(c, getReparsedNodeForNode(node));
331
334
  }
332
- function getTypeOfNode(c, node) {
333
- if (node.kind === 307 /* SyntaxKind.SourceFile */ && !isExternalOrCommonJSModule(node))
335
+ export function getTypeOfNode(c, node) {
336
+ if (node.kind === 308 /* SyntaxKind.SourceFile */ && !isExternalOrCommonJSModule(node))
334
337
  return c.errorType;
335
338
  // Semantic questions inside `with` blocks have no answer.
336
339
  if ((node.flags & 16777216 /* NodeFlags.InWithStatement */) !== 0)
337
340
  return c.errorType;
338
- const heritage = getClassOfHeritageExpression(node);
341
+ const heritage = getClassOfHeritageElement(node);
339
342
  const classType = heritage !== undefined ? getDeclaredTypeOfClassOrInterface(c, getSymbolOfDeclaration(c, heritage)) : undefined;
340
343
  if (isPartOfTypeNode(node)) {
341
344
  const typeFromTypeNode = getTypeFromTypeNode(c, node);
@@ -356,7 +359,7 @@ function getTypeOfNode(c, node) {
356
359
  const symbol = getSymbolAtLocationWorker(c, node, false);
357
360
  return symbol !== undefined ? getDeclaredTypeOfSymbol(c, symbol) : c.errorType;
358
361
  }
359
- if (node.kind === 209 /* SyntaxKind.BindingElement */)
362
+ if (node.kind === 210 /* SyntaxKind.BindingElement */)
360
363
  return getTypeForVariableLikeDeclaration(c, node, true) ?? c.errorType;
361
364
  if (isDeclaration(node)) {
362
365
  const symbol = getSymbolOfDeclaration(c, node);
@@ -377,11 +380,11 @@ function getTypeOfNode(c, node) {
377
380
  }
378
381
  const parent = node.parent;
379
382
  if (parent !== undefined &&
380
- parent.kind === 237 /* SyntaxKind.MetaProperty */ &&
383
+ parent.kind === 238 /* SyntaxKind.MetaProperty */ &&
381
384
  parent.keywordToken === node.kind)
382
385
  return checkMetaPropertyKeyword(c);
383
- if (node.kind === 301 /* SyntaxKind.ImportAttributes */)
384
- return getCachedGlobalType(c, 'ImportAttributes', 0, true);
386
+ if (node.kind === 302 /* SyntaxKind.ImportAttributes */)
387
+ return checkImportAttributesExpression(c, node);
385
388
  return c.errorType;
386
389
  }
387
390
  function getRegularTypeOfExpression(c, node) {
@@ -396,8 +399,8 @@ export function getTypeOfSymbolAtLocation(c, symbolIn, locationIn) {
396
399
  // A reference to the symbol that isn't only assigned to has a flow type.
397
400
  if ((location.kind === 79 /* SyntaxKind.Identifier */ || location.kind === 80 /* SyntaxKind.PrivateIdentifier */) &&
398
401
  !(isJsxTagName(location) ||
399
- location.parent.kind === 292 /* SyntaxKind.JsxAttribute */ ||
400
- location.parent.kind === 296 /* SyntaxKind.JsxNamespacedName */)) {
402
+ location.parent.kind === 293 /* SyntaxKind.JsxAttribute */ ||
403
+ location.parent.kind === 297 /* SyntaxKind.JsxNamespacedName */)) {
401
404
  if (isRightSideOfQualifiedNameOrPropertyAccess(location))
402
405
  location = location.parent;
403
406
  if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
@@ -408,7 +411,7 @@ export function getTypeOfSymbolAtLocation(c, symbolIn, locationIn) {
408
411
  }
409
412
  }
410
413
  if (isDeclarationName(location) &&
411
- location.parent.kind === 179 /* SyntaxKind.SetAccessor */ &&
414
+ location.parent.kind === 180 /* SyntaxKind.SetAccessor */ &&
412
415
  getAnnotatedAccessorTypeNode(location.parent) !== undefined)
413
416
  return getWriteTypeOfAccessors(c, getSymbol(location.parent));
414
417
  // A hypothetical reference has no flow information, so it gets the declared type.
@@ -420,14 +423,14 @@ export function getTypeOfSymbolAtLocation(c, symbolIn, locationIn) {
420
423
  // ---- Other queries
421
424
  /** The value symbol of a shorthand property assignment's name. */
422
425
  export function getShorthandAssignmentValueSymbol(c, node) {
423
- if (node === undefined || node.kind !== 304 /* SyntaxKind.ShorthandPropertyAssignment */)
426
+ if (node === undefined || node.kind !== 305 /* SyntaxKind.ShorthandPropertyAssignment */)
424
427
  return undefined;
425
428
  return resolveEntityName(c, node.name, 111551 /* SymbolFlags.Value */ | 2097152 /* SymbolFlags.Alias */, true, false, undefined);
426
429
  }
427
430
  /** The local symbol an export specifier, or the identifier of one, refers to. Throws for other nodes. */
428
431
  export function getExportSpecifierLocalTargetSymbol(c, node) {
429
432
  const meaning = 111551 /* SymbolFlags.Value */ | 788968 /* SymbolFlags.Type */ | 1920 /* SymbolFlags.Namespace */ | 2097152 /* SymbolFlags.Alias */;
430
- if (node.kind === 282 /* SyntaxKind.ExportSpecifier */) {
433
+ if (node.kind === 283 /* SyntaxKind.ExportSpecifier */) {
431
434
  const exportDeclaration = node.parent.parent;
432
435
  if (getExternalModuleName(exportDeclaration) !== undefined)
433
436
  return getExternalModuleMember(c, exportDeclaration, node, false);
@@ -444,7 +447,7 @@ export function getExportSpecifierLocalTargetSymbol(c, node) {
444
447
  }
445
448
  /** The value of an enum member, or of a reference to a const enum member. */
446
449
  export function getConstantValue(c, node) {
447
- if (node.kind === 306 /* SyntaxKind.EnumMember */)
450
+ if (node.kind === 307 /* SyntaxKind.EnumMember */)
448
451
  return getEnumMemberValue(c, node);
449
452
  // Checking the expression records the symbol it resolves to.
450
453
  if (c.resolvedSymbols.get(node.id) === undefined)
@@ -511,14 +514,14 @@ export function querySignatureFromDeclaration(c, node) {
511
514
  /** The signature a call-like expression resolves to. Throws for other nodes. */
512
515
  export function queryResolvedSignature(c, node) {
513
516
  switch (node.kind) {
514
- case 214 /* SyntaxKind.CallExpression */:
515
- case 215 /* SyntaxKind.NewExpression */:
516
- case 216 /* SyntaxKind.TaggedTemplateExpression */:
517
- case 171 /* SyntaxKind.Decorator */:
518
- case 290 /* SyntaxKind.JsxOpeningFragment */:
519
- case 287 /* SyntaxKind.JsxOpeningElement */:
520
- case 286 /* SyntaxKind.JsxSelfClosingElement */:
521
- case 227 /* SyntaxKind.BinaryExpression */:
517
+ case 215 /* SyntaxKind.CallExpression */:
518
+ case 216 /* SyntaxKind.NewExpression */:
519
+ case 217 /* SyntaxKind.TaggedTemplateExpression */:
520
+ case 172 /* SyntaxKind.Decorator */:
521
+ case 291 /* SyntaxKind.JsxOpeningFragment */:
522
+ case 288 /* SyntaxKind.JsxOpeningElement */:
523
+ case 287 /* SyntaxKind.JsxSelfClosingElement */:
524
+ case 228 /* SyntaxKind.BinaryExpression */:
522
525
  return getResolvedSignature(c, node, 0 /* CheckMode.Normal */);
523
526
  }
524
527
  throw new Error('getResolvedSignature expects a call-like expression');
@@ -601,31 +604,31 @@ class ChildCollector extends NodeVisitor {
601
604
  }
602
605
  }
603
606
  export function isEntityName(node) {
604
- return node.kind === 79 /* SyntaxKind.Identifier */ || node.kind === 167 /* SyntaxKind.QualifiedName */;
607
+ return node.kind === 79 /* SyntaxKind.Identifier */ || node.kind === 168 /* SyntaxKind.QualifiedName */;
605
608
  }
606
609
  function isBindingPattern(node) {
607
- return node.kind === 207 /* SyntaxKind.ObjectBindingPattern */ || node.kind === 208 /* SyntaxKind.ArrayBindingPattern */;
610
+ return node.kind === 208 /* SyntaxKind.ObjectBindingPattern */ || node.kind === 209 /* SyntaxKind.ArrayBindingPattern */;
608
611
  }
609
612
  function isImportOrExportSpecifier(node) {
610
- return node.kind === 277 /* SyntaxKind.ImportSpecifier */ || node.kind === 282 /* SyntaxKind.ExportSpecifier */;
613
+ return node.kind === 278 /* SyntaxKind.ImportSpecifier */ || node.kind === 283 /* SyntaxKind.ExportSpecifier */;
611
614
  }
612
615
  function isClassOrInterfaceLike(node) {
613
- return (node.kind === 264 /* SyntaxKind.ClassDeclaration */ ||
614
- node.kind === 232 /* SyntaxKind.ClassExpression */ ||
615
- node.kind === 265 /* SyntaxKind.InterfaceDeclaration */);
616
+ return (node.kind === 265 /* SyntaxKind.ClassDeclaration */ ||
617
+ node.kind === 233 /* SyntaxKind.ClassExpression */ ||
618
+ node.kind === 266 /* SyntaxKind.InterfaceDeclaration */);
616
619
  }
617
620
  function isJSDocLinkLike(node) {
618
- return (node.kind === 319 /* SyntaxKind.JSDocLink */ ||
619
- node.kind === 320 /* SyntaxKind.JSDocLinkCode */ ||
620
- node.kind === 321 /* SyntaxKind.JSDocLinkPlain */);
621
+ return (node.kind === 320 /* SyntaxKind.JSDocLink */ ||
622
+ node.kind === 321 /* SyntaxKind.JSDocLinkCode */ ||
623
+ node.kind === 322 /* SyntaxKind.JSDocLinkPlain */);
621
624
  }
622
625
  export function isDeclaration(node) {
623
- if (node.kind === 169 /* SyntaxKind.TypeParameter */)
626
+ if (node.kind === 170 /* SyntaxKind.TypeParameter */)
624
627
  return node.parent !== undefined;
625
628
  return isDeclarationNode(node);
626
629
  }
627
630
  export function isDeclarationName(name) {
628
- return (name.kind !== 307 /* SyntaxKind.SourceFile */ &&
631
+ return (name.kind !== 308 /* SyntaxKind.SourceFile */ &&
629
632
  !isBindingPattern(name) &&
630
633
  isDeclaration(name.parent) &&
631
634
  getName(name.parent) === name);
@@ -638,48 +641,48 @@ function isDeclarationNameOrImportPropertyName(name) {
638
641
  }
639
642
  export function isLiteralComputedPropertyDeclarationName(node) {
640
643
  return ((isStringLiteralLike(node) || node.kind === 8 /* SyntaxKind.NumericLiteral */) &&
641
- node.parent.kind === 168 /* SyntaxKind.ComputedPropertyName */ &&
644
+ node.parent.kind === 169 /* SyntaxKind.ComputedPropertyName */ &&
642
645
  isDeclaration(node.parent.parent));
643
646
  }
644
647
  function isExternalModuleImportEqualsDeclaration(node) {
645
- return (node.kind === 272 /* SyntaxKind.ImportEqualsDeclaration */ &&
646
- node.moduleReference.kind === 284 /* SyntaxKind.ExternalModuleReference */);
648
+ return (node.kind === 273 /* SyntaxKind.ImportEqualsDeclaration */ &&
649
+ node.moduleReference.kind === 285 /* SyntaxKind.ExternalModuleReference */);
647
650
  }
648
651
  export function isInRightSideOfImportOrExportAssignment(nodeIn) {
649
652
  let node = nodeIn;
650
- while (node.parent.kind === 167 /* SyntaxKind.QualifiedName */)
653
+ while (node.parent.kind === 168 /* SyntaxKind.QualifiedName */)
651
654
  node = node.parent;
652
655
  const parent = node.parent;
653
- return ((parent.kind === 272 /* SyntaxKind.ImportEqualsDeclaration */ &&
656
+ return ((parent.kind === 273 /* SyntaxKind.ImportEqualsDeclaration */ &&
654
657
  parent.moduleReference === node) ||
655
- (parent.kind === 278 /* SyntaxKind.ExportAssignment */ && getExpression(parent) === node));
658
+ (parent.kind === 279 /* SyntaxKind.ExportAssignment */ && getExpression(parent) === node));
656
659
  }
657
660
  /** The `import()` type whose qualifier contains `node`. */
658
661
  function isImportTypeQualifierPart(nodeIn) {
659
662
  let node = nodeIn;
660
663
  let parent = node.parent;
661
- while (parent !== undefined && parent.kind === 167 /* SyntaxKind.QualifiedName */) {
664
+ while (parent !== undefined && parent.kind === 168 /* SyntaxKind.QualifiedName */) {
662
665
  node = parent;
663
666
  parent = parent.parent;
664
667
  }
665
- if (parent !== undefined && parent.kind === 206 /* SyntaxKind.ImportType */ && parent.qualifier === node)
668
+ if (parent !== undefined && parent.kind === 207 /* SyntaxKind.ImportType */ && parent.qualifier === node)
666
669
  return parent;
667
670
  return undefined;
668
671
  }
669
- function isInNameOfExpressionWithTypeArguments(nodeIn) {
672
+ function isInNameOfExpressionWithTypeArgumentsOrHeritageTypeReference(nodeIn) {
670
673
  let node = nodeIn;
671
- while (node.parent.kind === 212 /* SyntaxKind.PropertyAccessExpression */)
674
+ while (node.parent.kind === 213 /* SyntaxKind.PropertyAccessExpression */ || node.parent.kind === 168 /* SyntaxKind.QualifiedName */)
672
675
  node = node.parent;
673
- return node.parent.kind === 234 /* SyntaxKind.ExpressionWithTypeArguments */;
676
+ return node.parent.kind === 235 /* SyntaxKind.ExpressionWithTypeArguments */ || isNameOfHeritageClauseTypeReference(node);
674
677
  }
675
678
  export function isRightSideOfQualifiedNameOrPropertyAccess(node) {
676
679
  const parent = node.parent;
677
680
  switch (parent.kind) {
678
- case 167 /* SyntaxKind.QualifiedName */:
681
+ case 168 /* SyntaxKind.QualifiedName */:
679
682
  return parent.right === node;
680
- case 212 /* SyntaxKind.PropertyAccessExpression */:
683
+ case 213 /* SyntaxKind.PropertyAccessExpression */:
681
684
  return parent.name === node;
682
- case 237 /* SyntaxKind.MetaProperty */:
685
+ case 238 /* SyntaxKind.MetaProperty */:
683
686
  return parent.name === node;
684
687
  }
685
688
  return false;
@@ -688,18 +691,18 @@ function isRightSideOfAccessExpression(node) {
688
691
  const parent = node.parent;
689
692
  if (parent === undefined)
690
693
  return false;
691
- if (parent.kind === 212 /* SyntaxKind.PropertyAccessExpression */)
694
+ if (parent.kind === 213 /* SyntaxKind.PropertyAccessExpression */)
692
695
  return parent.name === node;
693
- if (parent.kind === 213 /* SyntaxKind.ElementAccessExpression */)
696
+ if (parent.kind === 214 /* SyntaxKind.ElementAccessExpression */)
694
697
  return parent.argumentExpression === node;
695
698
  return false;
696
699
  }
697
700
  function isJsxTagName(node) {
698
701
  const parent = node.parent;
699
702
  switch (parent.kind) {
700
- case 287 /* SyntaxKind.JsxOpeningElement */:
701
- case 288 /* SyntaxKind.JsxClosingElement */:
702
- case 286 /* SyntaxKind.JsxSelfClosingElement */:
703
+ case 288 /* SyntaxKind.JsxOpeningElement */:
704
+ case 289 /* SyntaxKind.JsxClosingElement */:
705
+ case 287 /* SyntaxKind.JsxSelfClosingElement */:
703
706
  return getTagName(parent) === node;
704
707
  }
705
708
  return false;
@@ -708,16 +711,21 @@ export function isJSDocNameReferenceContext(node) {
708
711
  if ((node.flags & 4194304 /* NodeFlags.JSDoc */) === 0)
709
712
  return false;
710
713
  for (let current = node; current !== undefined; current = current.parent)
711
- if (current.kind === 309 /* SyntaxKind.JSDocNameReference */ || isJSDocLinkLike(current))
714
+ if (current.kind === 310 /* SyntaxKind.JSDocNameReference */ || isJSDocLinkLike(current))
712
715
  return true;
713
716
  return false;
714
717
  }
715
718
  /** The class of an expression with type arguments in its heritage clause. */
716
719
  function getClassOfHeritageExpression(node) {
717
- if (node.kind !== 234 /* SyntaxKind.ExpressionWithTypeArguments */)
720
+ return node.kind === 235 /* SyntaxKind.ExpressionWithTypeArguments */ ? getClassOfHeritageElement(node) : undefined;
721
+ }
722
+ /** The class of a heritage clause element: an expression with type arguments, or a type reference in
723
+ * `implements`. */
724
+ function getClassOfHeritageElement(node) {
725
+ if (node.kind !== 235 /* SyntaxKind.ExpressionWithTypeArguments */ && node.kind !== 185 /* SyntaxKind.TypeReference */)
718
726
  return undefined;
719
727
  const parent = node.parent;
720
- return parent.kind === 299 /* SyntaxKind.HeritageClause */ && isClassLike(parent.parent) ? parent.parent : undefined;
728
+ return parent.kind === 300 /* SyntaxKind.HeritageClause */ && isClassLike(parent.parent) ? parent.parent : undefined;
721
729
  }
722
730
  function isImplementsExpression(node) {
723
731
  return node.parent.token === 118 /* SyntaxKind.ImplementsKeyword */;
@@ -731,13 +739,13 @@ function isTypeDeclarationName(name) {
731
739
  /** Whether a type reference names `node`, as `T`, `N.T` or the namespace part of one. */
732
740
  function isTypeReferenceIdentifier(nodeIn) {
733
741
  let node = nodeIn;
734
- while (node.parent.kind === 167 /* SyntaxKind.QualifiedName */)
742
+ while (node.parent.kind === 168 /* SyntaxKind.QualifiedName */)
735
743
  node = node.parent;
736
- return node.parent.kind === 184 /* SyntaxKind.TypeReference */;
744
+ return node.parent.kind === 185 /* SyntaxKind.TypeReference */;
737
745
  }
738
746
  export function isPartOfTypeNode(node) {
739
747
  const kind = node.kind;
740
- if (kind >= 183 /* SyntaxKind.FirstTypeNode */ && kind <= 206 /* SyntaxKind.LastTypeNode */)
748
+ if (kind >= 184 /* SyntaxKind.FirstTypeNode */ && kind <= 207 /* SyntaxKind.LastTypeNode */)
741
749
  return true;
742
750
  switch (kind) {
743
751
  case 132 /* SyntaxKind.AnyKeyword */:
@@ -753,21 +761,21 @@ export function isPartOfTypeNode(node) {
753
761
  case 146 /* SyntaxKind.NeverKeyword */:
754
762
  return true;
755
763
  case 115 /* SyntaxKind.VoidKeyword */:
756
- return node.parent.kind !== 223 /* SyntaxKind.VoidExpression */;
757
- case 234 /* SyntaxKind.ExpressionWithTypeArguments */:
764
+ return node.parent.kind !== 224 /* SyntaxKind.VoidExpression */;
765
+ case 235 /* SyntaxKind.ExpressionWithTypeArguments */:
758
766
  return isPartOfTypeExpressionWithTypeArguments(node);
759
- case 169 /* SyntaxKind.TypeParameter */:
760
- return node.parent.kind === 201 /* SyntaxKind.MappedType */ || node.parent.kind === 196 /* SyntaxKind.InferType */;
767
+ case 170 /* SyntaxKind.TypeParameter */:
768
+ return node.parent.kind === 202 /* SyntaxKind.MappedType */ || node.parent.kind === 197 /* SyntaxKind.InferType */;
761
769
  case 79 /* SyntaxKind.Identifier */: {
762
770
  const parent = node.parent;
763
- if (parent.kind === 167 /* SyntaxKind.QualifiedName */ && parent.right === node)
771
+ if (parent.kind === 168 /* SyntaxKind.QualifiedName */ && parent.right === node)
764
772
  return isPartOfTypeNodeInParent(parent);
765
- if (parent.kind === 212 /* SyntaxKind.PropertyAccessExpression */ && parent.name === node)
773
+ if (parent.kind === 213 /* SyntaxKind.PropertyAccessExpression */ && parent.name === node)
766
774
  return isPartOfTypeNodeInParent(parent);
767
775
  return isPartOfTypeNodeInParent(node);
768
776
  }
769
- case 167 /* SyntaxKind.QualifiedName */:
770
- case 212 /* SyntaxKind.PropertyAccessExpression */:
777
+ case 168 /* SyntaxKind.QualifiedName */:
778
+ case 213 /* SyntaxKind.PropertyAccessExpression */:
771
779
  case 109 /* SyntaxKind.ThisKeyword */:
772
780
  return isPartOfTypeNodeInParent(node);
773
781
  }
@@ -775,45 +783,45 @@ export function isPartOfTypeNode(node) {
775
783
  }
776
784
  function isPartOfTypeExpressionWithTypeArguments(node) {
777
785
  const parent = node.parent;
778
- return ((parent.kind === 299 /* SyntaxKind.HeritageClause */ &&
786
+ return ((parent.kind === 300 /* SyntaxKind.HeritageClause */ &&
779
787
  (!isClassLike(parent.parent) || parent.token === 118 /* SyntaxKind.ImplementsKeyword */)) ||
780
- parent.kind === 324 /* SyntaxKind.JSDocImplementsTag */ ||
781
- parent.kind === 323 /* SyntaxKind.JSDocAugmentsTag */);
788
+ parent.kind === 325 /* SyntaxKind.JSDocImplementsTag */ ||
789
+ parent.kind === 324 /* SyntaxKind.JSDocAugmentsTag */);
782
790
  }
783
791
  // Only the parent is tested: in `let a: A.B.C`, `C` and `A.B.C` are type nodes but `A.B` isn't.
784
792
  function isPartOfTypeNodeInParent(node) {
785
793
  const parent = node.parent;
786
- if (parent.kind === 187 /* SyntaxKind.TypeQuery */)
794
+ if (parent.kind === 188 /* SyntaxKind.TypeQuery */)
787
795
  return false;
788
- if (parent.kind === 206 /* SyntaxKind.ImportType */)
796
+ if (parent.kind === 207 /* SyntaxKind.ImportType */)
789
797
  return !parent.isTypeOf;
790
- if (parent.kind >= 183 /* SyntaxKind.FirstTypeNode */ && parent.kind <= 206 /* SyntaxKind.LastTypeNode */)
798
+ if (parent.kind >= 184 /* SyntaxKind.FirstTypeNode */ && parent.kind <= 207 /* SyntaxKind.LastTypeNode */)
791
799
  return true;
792
800
  switch (parent.kind) {
793
- case 234 /* SyntaxKind.ExpressionWithTypeArguments */:
801
+ case 235 /* SyntaxKind.ExpressionWithTypeArguments */:
794
802
  return isPartOfTypeExpressionWithTypeArguments(parent);
795
- case 169 /* SyntaxKind.TypeParameter */:
803
+ case 170 /* SyntaxKind.TypeParameter */:
796
804
  return node === parent.constraint;
797
- case 261 /* SyntaxKind.VariableDeclaration */:
798
- case 170 /* SyntaxKind.Parameter */:
799
- case 173 /* SyntaxKind.PropertyDeclaration */:
800
- case 172 /* SyntaxKind.PropertySignature */:
801
- case 263 /* SyntaxKind.FunctionDeclaration */:
802
- case 219 /* SyntaxKind.FunctionExpression */:
803
- case 220 /* SyntaxKind.ArrowFunction */:
804
- case 177 /* SyntaxKind.Constructor */:
805
- case 175 /* SyntaxKind.MethodDeclaration */:
806
- case 174 /* SyntaxKind.MethodSignature */:
807
- case 178 /* SyntaxKind.GetAccessor */:
808
- case 179 /* SyntaxKind.SetAccessor */:
809
- case 180 /* SyntaxKind.CallSignature */:
810
- case 181 /* SyntaxKind.ConstructSignature */:
811
- case 182 /* SyntaxKind.IndexSignature */:
812
- case 217 /* SyntaxKind.TypeAssertionExpression */:
805
+ case 262 /* SyntaxKind.VariableDeclaration */:
806
+ case 171 /* SyntaxKind.Parameter */:
807
+ case 174 /* SyntaxKind.PropertyDeclaration */:
808
+ case 173 /* SyntaxKind.PropertySignature */:
809
+ case 264 /* SyntaxKind.FunctionDeclaration */:
810
+ case 220 /* SyntaxKind.FunctionExpression */:
811
+ case 221 /* SyntaxKind.ArrowFunction */:
812
+ case 178 /* SyntaxKind.Constructor */:
813
+ case 176 /* SyntaxKind.MethodDeclaration */:
814
+ case 175 /* SyntaxKind.MethodSignature */:
815
+ case 179 /* SyntaxKind.GetAccessor */:
816
+ case 180 /* SyntaxKind.SetAccessor */:
817
+ case 181 /* SyntaxKind.CallSignature */:
818
+ case 182 /* SyntaxKind.ConstructSignature */:
819
+ case 183 /* SyntaxKind.IndexSignature */:
820
+ case 218 /* SyntaxKind.TypeAssertionExpression */:
813
821
  return node === getType(parent);
814
- case 214 /* SyntaxKind.CallExpression */:
815
- case 215 /* SyntaxKind.NewExpression */:
816
- case 216 /* SyntaxKind.TaggedTemplateExpression */: {
822
+ case 215 /* SyntaxKind.CallExpression */:
823
+ case 216 /* SyntaxKind.NewExpression */:
824
+ case 217 /* SyntaxKind.TaggedTemplateExpression */: {
817
825
  const typeArguments = getTypeArguments(parent);
818
826
  return typeArguments !== undefined && typeArguments.nodes.includes(node);
819
827
  }
@@ -828,49 +836,49 @@ export function isExpressionNode(nodeIn) {
828
836
  case 111 /* SyntaxKind.TrueKeyword */:
829
837
  case 96 /* SyntaxKind.FalseKeyword */:
830
838
  case 13 /* SyntaxKind.RegularExpressionLiteral */:
831
- case 210 /* SyntaxKind.ArrayLiteralExpression */:
832
- case 211 /* SyntaxKind.ObjectLiteralExpression */:
833
- case 212 /* SyntaxKind.PropertyAccessExpression */:
834
- case 213 /* SyntaxKind.ElementAccessExpression */:
835
- case 214 /* SyntaxKind.CallExpression */:
836
- case 215 /* SyntaxKind.NewExpression */:
837
- case 216 /* SyntaxKind.TaggedTemplateExpression */:
838
- case 235 /* SyntaxKind.AsExpression */:
839
- case 217 /* SyntaxKind.TypeAssertionExpression */:
840
- case 239 /* SyntaxKind.SatisfiesExpression */:
841
- case 236 /* SyntaxKind.NonNullExpression */:
842
- case 218 /* SyntaxKind.ParenthesizedExpression */:
843
- case 219 /* SyntaxKind.FunctionExpression */:
844
- case 232 /* SyntaxKind.ClassExpression */:
845
- case 220 /* SyntaxKind.ArrowFunction */:
846
- case 223 /* SyntaxKind.VoidExpression */:
847
- case 221 /* SyntaxKind.DeleteExpression */:
848
- case 222 /* SyntaxKind.TypeOfExpression */:
849
- case 225 /* SyntaxKind.PrefixUnaryExpression */:
850
- case 226 /* SyntaxKind.PostfixUnaryExpression */:
851
- case 227 /* SyntaxKind.BinaryExpression */:
852
- case 228 /* SyntaxKind.ConditionalExpression */:
853
- case 231 /* SyntaxKind.SpreadElement */:
854
- case 229 /* SyntaxKind.TemplateExpression */:
855
- case 233 /* SyntaxKind.OmittedExpression */:
856
- case 285 /* SyntaxKind.JsxElement */:
857
- case 286 /* SyntaxKind.JsxSelfClosingElement */:
858
- case 289 /* SyntaxKind.JsxFragment */:
859
- case 230 /* SyntaxKind.YieldExpression */:
860
- case 224 /* SyntaxKind.AwaitExpression */:
839
+ case 211 /* SyntaxKind.ArrayLiteralExpression */:
840
+ case 212 /* SyntaxKind.ObjectLiteralExpression */:
841
+ case 213 /* SyntaxKind.PropertyAccessExpression */:
842
+ case 214 /* SyntaxKind.ElementAccessExpression */:
843
+ case 215 /* SyntaxKind.CallExpression */:
844
+ case 216 /* SyntaxKind.NewExpression */:
845
+ case 217 /* SyntaxKind.TaggedTemplateExpression */:
846
+ case 236 /* SyntaxKind.AsExpression */:
847
+ case 218 /* SyntaxKind.TypeAssertionExpression */:
848
+ case 240 /* SyntaxKind.SatisfiesExpression */:
849
+ case 237 /* SyntaxKind.NonNullExpression */:
850
+ case 219 /* SyntaxKind.ParenthesizedExpression */:
851
+ case 220 /* SyntaxKind.FunctionExpression */:
852
+ case 233 /* SyntaxKind.ClassExpression */:
853
+ case 221 /* SyntaxKind.ArrowFunction */:
854
+ case 224 /* SyntaxKind.VoidExpression */:
855
+ case 222 /* SyntaxKind.DeleteExpression */:
856
+ case 223 /* SyntaxKind.TypeOfExpression */:
857
+ case 226 /* SyntaxKind.PrefixUnaryExpression */:
858
+ case 227 /* SyntaxKind.PostfixUnaryExpression */:
859
+ case 228 /* SyntaxKind.BinaryExpression */:
860
+ case 229 /* SyntaxKind.ConditionalExpression */:
861
+ case 232 /* SyntaxKind.SpreadElement */:
862
+ case 230 /* SyntaxKind.TemplateExpression */:
863
+ case 234 /* SyntaxKind.OmittedExpression */:
864
+ case 286 /* SyntaxKind.JsxElement */:
865
+ case 287 /* SyntaxKind.JsxSelfClosingElement */:
866
+ case 290 /* SyntaxKind.JsxFragment */:
867
+ case 231 /* SyntaxKind.YieldExpression */:
868
+ case 225 /* SyntaxKind.AwaitExpression */:
861
869
  return true;
862
- case 237 /* SyntaxKind.MetaProperty */:
870
+ case 238 /* SyntaxKind.MetaProperty */:
863
871
  // `import.defer` in `import.defer(...)` isn't an expression.
864
872
  return !isImportCall(node.parent) || getExpression(node.parent) !== node;
865
- case 234 /* SyntaxKind.ExpressionWithTypeArguments */:
866
- return node.parent.kind !== 299 /* SyntaxKind.HeritageClause */;
867
- case 167 /* SyntaxKind.QualifiedName */:
868
- while (node.parent.kind === 167 /* SyntaxKind.QualifiedName */)
873
+ case 235 /* SyntaxKind.ExpressionWithTypeArguments */:
874
+ return node.parent.kind !== 300 /* SyntaxKind.HeritageClause */;
875
+ case 168 /* SyntaxKind.QualifiedName */:
876
+ while (node.parent.kind === 168 /* SyntaxKind.QualifiedName */)
869
877
  node = node.parent;
870
878
  return isNameReferenceParent(node) || isJsxTagName(node);
871
879
  case 80 /* SyntaxKind.PrivateIdentifier */: {
872
880
  const parent = node.parent;
873
- return (parent.kind === 227 /* SyntaxKind.BinaryExpression */ &&
881
+ return (parent.kind === 228 /* SyntaxKind.BinaryExpression */ &&
874
882
  parent.left === node &&
875
883
  parent.operatorToken.kind === 102 /* SyntaxKind.InKeyword */);
876
884
  }
@@ -890,55 +898,59 @@ export function isExpressionNode(nodeIn) {
890
898
  /** Whether `node`'s parent is a `typeof` query, a JSDoc link or a JSDoc name reference. */
891
899
  function isNameReferenceParent(node) {
892
900
  const parent = node.parent;
893
- return (parent.kind === 187 /* SyntaxKind.TypeQuery */ || isJSDocLinkLike(parent) || parent.kind === 309 /* SyntaxKind.JSDocNameReference */);
901
+ return (parent.kind === 188 /* SyntaxKind.TypeQuery */ || isJSDocLinkLike(parent) || parent.kind === 310 /* SyntaxKind.JSDocNameReference */);
894
902
  }
895
903
  function isInExpressionContext(node) {
896
904
  const parent = node.parent;
897
905
  switch (parent.kind) {
898
- case 261 /* SyntaxKind.VariableDeclaration */:
899
- case 170 /* SyntaxKind.Parameter */:
900
- case 173 /* SyntaxKind.PropertyDeclaration */:
901
- case 172 /* SyntaxKind.PropertySignature */:
902
- case 306 /* SyntaxKind.EnumMember */:
903
- case 303 /* SyntaxKind.PropertyAssignment */:
904
- case 209 /* SyntaxKind.BindingElement */:
906
+ case 262 /* SyntaxKind.VariableDeclaration */:
907
+ case 171 /* SyntaxKind.Parameter */:
908
+ case 174 /* SyntaxKind.PropertyDeclaration */:
909
+ case 173 /* SyntaxKind.PropertySignature */:
910
+ case 307 /* SyntaxKind.EnumMember */:
911
+ case 304 /* SyntaxKind.PropertyAssignment */:
912
+ case 210 /* SyntaxKind.BindingElement */:
905
913
  return getInitializer(parent) === node;
906
- case 245 /* SyntaxKind.ExpressionStatement */:
907
- case 246 /* SyntaxKind.IfStatement */:
908
- case 247 /* SyntaxKind.DoStatement */:
909
- case 248 /* SyntaxKind.WhileStatement */:
910
- case 254 /* SyntaxKind.ReturnStatement */:
911
- case 255 /* SyntaxKind.WithStatement */:
912
- case 256 /* SyntaxKind.SwitchStatement */:
913
- case 297 /* SyntaxKind.CaseClause */:
914
- case 298 /* SyntaxKind.DefaultClause */:
915
- case 258 /* SyntaxKind.ThrowStatement */:
916
- case 217 /* SyntaxKind.TypeAssertionExpression */:
917
- case 235 /* SyntaxKind.AsExpression */:
918
- case 240 /* SyntaxKind.TemplateSpan */:
919
- case 168 /* SyntaxKind.ComputedPropertyName */:
920
- case 239 /* SyntaxKind.SatisfiesExpression */:
914
+ case 246 /* SyntaxKind.ExpressionStatement */:
915
+ case 247 /* SyntaxKind.IfStatement */:
916
+ case 248 /* SyntaxKind.DoStatement */:
917
+ case 249 /* SyntaxKind.WhileStatement */:
918
+ case 255 /* SyntaxKind.ReturnStatement */:
919
+ case 256 /* SyntaxKind.WithStatement */:
920
+ case 257 /* SyntaxKind.SwitchStatement */:
921
+ case 298 /* SyntaxKind.CaseClause */:
922
+ case 299 /* SyntaxKind.DefaultClause */:
923
+ case 259 /* SyntaxKind.ThrowStatement */:
924
+ case 218 /* SyntaxKind.TypeAssertionExpression */:
925
+ case 236 /* SyntaxKind.AsExpression */:
926
+ case 241 /* SyntaxKind.TemplateSpan */:
927
+ case 169 /* SyntaxKind.ComputedPropertyName */:
928
+ case 240 /* SyntaxKind.SatisfiesExpression */:
921
929
  return getExpression(parent) === node;
922
- case 249 /* SyntaxKind.ForStatement */: {
930
+ case 250 /* SyntaxKind.ForStatement */: {
923
931
  const s = parent;
924
- return ((s.initializer === node && node.kind !== 262 /* SyntaxKind.VariableDeclarationList */) ||
932
+ return ((s.initializer === node && node.kind !== 263 /* SyntaxKind.VariableDeclarationList */) ||
925
933
  s.condition === node ||
926
934
  s.incrementor === node);
927
935
  }
928
- case 250 /* SyntaxKind.ForInStatement */:
929
- case 251 /* SyntaxKind.ForOfStatement */: {
936
+ case 251 /* SyntaxKind.ForInStatement */:
937
+ case 252 /* SyntaxKind.ForOfStatement */: {
930
938
  const s = parent;
931
- return (s.initializer === node && node.kind !== 262 /* SyntaxKind.VariableDeclarationList */) || s.expression === node;
939
+ return (s.initializer === node && node.kind !== 263 /* SyntaxKind.VariableDeclarationList */) || s.expression === node;
932
940
  }
933
- case 171 /* SyntaxKind.Decorator */:
934
- case 295 /* SyntaxKind.JsxExpression */:
935
- case 294 /* SyntaxKind.JsxSpreadAttribute */:
936
- case 305 /* SyntaxKind.SpreadAssignment */:
941
+ case 172 /* SyntaxKind.Decorator */:
942
+ case 296 /* SyntaxKind.JsxExpression */:
943
+ case 295 /* SyntaxKind.JsxSpreadAttribute */:
944
+ case 306 /* SyntaxKind.SpreadAssignment */:
937
945
  return true;
938
- case 234 /* SyntaxKind.ExpressionWithTypeArguments */:
946
+ case 235 /* SyntaxKind.ExpressionWithTypeArguments */:
939
947
  return getExpression(parent) === node && !isPartOfTypeNode(parent);
940
- case 304 /* SyntaxKind.ShorthandPropertyAssignment */:
948
+ case 305 /* SyntaxKind.ShorthandPropertyAssignment */:
941
949
  return parent.objectAssignmentInitializer === node;
950
+ case 220 /* SyntaxKind.FunctionExpression */:
951
+ case 233 /* SyntaxKind.ClassExpression */:
952
+ // The name of a function or class expression is a declaration name, not an expression.
953
+ return getName(parent) !== node;
942
954
  }
943
955
  return isExpressionNode(parent);
944
956
  }
@@ -950,27 +962,27 @@ function accessKind(node) {
950
962
  if (parent === undefined)
951
963
  return 0 /* AccessKind.Read */;
952
964
  switch (parent.kind) {
953
- case 218 /* SyntaxKind.ParenthesizedExpression */:
954
- case 210 /* SyntaxKind.ArrayLiteralExpression */:
965
+ case 219 /* SyntaxKind.ParenthesizedExpression */:
966
+ case 211 /* SyntaxKind.ArrayLiteralExpression */:
955
967
  return accessKind(parent);
956
- case 225 /* SyntaxKind.PrefixUnaryExpression */:
957
- case 226 /* SyntaxKind.PostfixUnaryExpression */: {
958
- const operator = parent.kind === 225 /* SyntaxKind.PrefixUnaryExpression */
968
+ case 226 /* SyntaxKind.PrefixUnaryExpression */:
969
+ case 227 /* SyntaxKind.PostfixUnaryExpression */: {
970
+ const operator = parent.kind === 226 /* SyntaxKind.PrefixUnaryExpression */
959
971
  ? parent.operator
960
972
  : parent.operator;
961
973
  return operator === 45 /* SyntaxKind.PlusPlusToken */ || operator === 46 /* SyntaxKind.MinusMinusToken */
962
974
  ? 2 /* AccessKind.ReadWrite */
963
975
  : 0 /* AccessKind.Read */;
964
976
  }
965
- case 227 /* SyntaxKind.BinaryExpression */: {
977
+ case 228 /* SyntaxKind.BinaryExpression */: {
966
978
  const binary = parent;
967
979
  if (binary.left === node && isAssignmentOperator(binary.operatorToken.kind))
968
980
  return binary.operatorToken.kind === 63 /* SyntaxKind.EqualsToken */ ? 1 /* AccessKind.Write */ : 2 /* AccessKind.ReadWrite */;
969
981
  return 0 /* AccessKind.Read */;
970
982
  }
971
- case 212 /* SyntaxKind.PropertyAccessExpression */:
983
+ case 213 /* SyntaxKind.PropertyAccessExpression */:
972
984
  return parent.name !== node ? 0 /* AccessKind.Read */ : accessKind(parent);
973
- case 303 /* SyntaxKind.PropertyAssignment */: {
985
+ case 304 /* SyntaxKind.PropertyAssignment */: {
974
986
  const parentAccess = accessKind(parent.parent);
975
987
  // In `({ x: v } = o)`, the `x` is read and `v` written.
976
988
  if (node === getName(parent)) {
@@ -982,13 +994,13 @@ function accessKind(node) {
982
994
  }
983
995
  return parentAccess;
984
996
  }
985
- case 304 /* SyntaxKind.ShorthandPropertyAssignment */:
997
+ case 305 /* SyntaxKind.ShorthandPropertyAssignment */:
986
998
  // The local variable is what's accessed.
987
999
  if (node === parent.objectAssignmentInitializer)
988
1000
  return 0 /* AccessKind.Read */;
989
1001
  return accessKind(parent.parent);
990
- case 250 /* SyntaxKind.ForInStatement */:
991
- case 251 /* SyntaxKind.ForOfStatement */:
1002
+ case 251 /* SyntaxKind.ForInStatement */:
1003
+ case 252 /* SyntaxKind.ForOfStatement */:
992
1004
  return node === parent.initializer ? 1 /* AccessKind.Write */ : 0 /* AccessKind.Read */;
993
1005
  }
994
1006
  return 0 /* AccessKind.Read */;