arkanalyzer 1.0.86 → 1.0.87

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 (400) hide show
  1. package/README.en.md +69 -65
  2. package/README.md +56 -70
  3. package/config/arkanalyzer.json +7 -2
  4. package/docs/cppFrontend/ArkAnalyzer-cpp_usage_guide.md +245 -0
  5. package/docs/cppFrontend/cpp_frontend_build_guide.md +126 -0
  6. package/docs/cppFrontend/cpp_frontend_user_guide.md +175 -0
  7. package/docs/cppFrontend/img.png +0 -0
  8. package/docs/cppFrontend/img_1.png +0 -0
  9. package/docs/cppFrontend/img_10.png +0 -0
  10. package/docs/cppFrontend/img_11.png +0 -0
  11. package/docs/cppFrontend/img_12.png +0 -0
  12. package/docs/cppFrontend/img_13.png +0 -0
  13. package/docs/cppFrontend/img_14.png +0 -0
  14. package/docs/cppFrontend/img_15.png +0 -0
  15. package/docs/cppFrontend/img_16.png +0 -0
  16. package/docs/cppFrontend/img_17.png +0 -0
  17. package/docs/cppFrontend/img_18.png +0 -0
  18. package/docs/cppFrontend/img_19.png +0 -0
  19. package/docs/cppFrontend/img_2.png +0 -0
  20. package/docs/cppFrontend/img_20.png +0 -0
  21. package/docs/cppFrontend/img_21.png +0 -0
  22. package/docs/cppFrontend/img_22.png +0 -0
  23. package/docs/cppFrontend/img_23.png +0 -0
  24. package/docs/cppFrontend/img_3.png +0 -0
  25. package/docs/cppFrontend/img_4.png +0 -0
  26. package/docs/cppFrontend/img_5.png +0 -0
  27. package/docs/cppFrontend/img_6.png +0 -0
  28. package/docs/cppFrontend/img_7.png +0 -0
  29. package/docs/cppFrontend/img_8.png +0 -0
  30. package/docs/cppFrontend/img_9.png +0 -0
  31. package/docs/sig_programanalysis.en.md +66 -0
  32. package/docs/sig_programanalysis.md +73 -0
  33. package/lib/Config.d.ts +32 -1
  34. package/lib/Config.d.ts.map +1 -1
  35. package/lib/Config.js +76 -2
  36. package/lib/Scene.d.ts +25 -2
  37. package/lib/Scene.d.ts.map +1 -1
  38. package/lib/Scene.js +148 -40
  39. package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +4 -3
  40. package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
  41. package/lib/callgraph/algorithm/AbstractAnalysis.js +17 -17
  42. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +6 -1
  43. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
  44. package/lib/callgraph/algorithm/RapidTypeAnalysis.js +117 -14
  45. package/lib/callgraph/common/Statistics.d.ts +4 -2
  46. package/lib/callgraph/common/Statistics.d.ts.map +1 -1
  47. package/lib/callgraph/common/Statistics.js +14 -2
  48. package/lib/callgraph/model/CallGraph.d.ts +12 -8
  49. package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
  50. package/lib/callgraph/model/CallGraph.js +53 -29
  51. package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +1 -0
  52. package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -1
  53. package/lib/callgraph/model/builder/CallGraphBuilder.js +5 -1
  54. package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
  55. package/lib/callgraph/pointerAnalysis/Pag.js +3 -0
  56. package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +4 -2
  57. package/lib/cli/cli.d.ts +3 -0
  58. package/lib/cli/cli.d.ts.map +1 -0
  59. package/lib/cli/cli.js +82 -0
  60. package/lib/cli/commands/cg.d.ts +32 -0
  61. package/lib/cli/commands/cg.d.ts.map +1 -0
  62. package/lib/cli/commands/cg.js +401 -0
  63. package/lib/cli/commands/index.d.ts +6 -0
  64. package/lib/cli/commands/index.d.ts.map +1 -0
  65. package/lib/cli/commands/index.js +64 -0
  66. package/lib/cli/commands/ir.d.ts +26 -0
  67. package/lib/cli/commands/ir.d.ts.map +1 -0
  68. package/lib/cli/commands/ir.js +94 -0
  69. package/lib/core/base/Constant.d.ts +1 -1
  70. package/lib/core/base/Constant.d.ts.map +1 -1
  71. package/lib/core/base/Constant.js +1 -1
  72. package/lib/core/base/Expr.d.ts +29 -5
  73. package/lib/core/base/Expr.d.ts.map +1 -1
  74. package/lib/core/base/Expr.js +144 -22
  75. package/lib/core/base/Position.d.ts +14 -0
  76. package/lib/core/base/Position.d.ts.map +1 -1
  77. package/lib/core/base/Position.js +27 -0
  78. package/lib/core/base/Ref.d.ts +1 -0
  79. package/lib/core/base/Ref.d.ts.map +1 -1
  80. package/lib/core/base/Ref.js +4 -1
  81. package/lib/core/base/Type.d.ts +64 -24
  82. package/lib/core/base/Type.d.ts.map +1 -1
  83. package/lib/core/base/Type.js +144 -49
  84. package/lib/core/common/ArkError.d.ts +26 -2
  85. package/lib/core/common/ArkError.d.ts.map +1 -1
  86. package/lib/core/common/ArkError.js +56 -2
  87. package/lib/core/common/ArkIRTransformer.d.ts +11 -10
  88. package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
  89. package/lib/core/common/ArkIRTransformer.js +1 -1
  90. package/lib/core/common/ArkValueTransformer.d.ts +14 -12
  91. package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
  92. package/lib/core/common/ArkValueTransformer.js +1 -5
  93. package/lib/core/common/Const.d.ts +3 -0
  94. package/lib/core/common/Const.d.ts.map +1 -1
  95. package/lib/core/common/Const.js +4 -1
  96. package/lib/core/common/DummyMainCreater.d.ts +23 -13
  97. package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
  98. package/lib/core/common/DummyMainCreater.js +66 -43
  99. package/lib/core/common/EtsConst.d.ts +11 -0
  100. package/lib/core/common/EtsConst.d.ts.map +1 -1
  101. package/lib/core/common/EtsConst.js +12 -1
  102. package/lib/core/common/IRInference.d.ts.map +1 -1
  103. package/lib/core/common/IRInference.js +5 -1
  104. package/lib/core/common/ModelUtils.d.ts +4 -7
  105. package/lib/core/common/ModelUtils.d.ts.map +1 -1
  106. package/lib/core/common/ModelUtils.js +77 -110
  107. package/lib/core/common/SdkUtils.d.ts +1 -1
  108. package/lib/core/common/SdkUtils.d.ts.map +1 -1
  109. package/lib/core/common/SdkUtils.js +14 -5
  110. package/lib/core/common/TypeInference.d.ts.map +1 -1
  111. package/lib/core/common/TypeInference.js +9 -3
  112. package/lib/core/graph/BaseExplicitGraph.d.ts +4 -4
  113. package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
  114. package/lib/core/graph/BaseExplicitGraph.js +15 -8
  115. package/lib/core/graph/BasicBlock.d.ts.map +1 -1
  116. package/lib/core/graph/Scc.d.ts.map +1 -1
  117. package/lib/core/graph/Scc.js +7 -2
  118. package/lib/core/graph/builder/CfgBuilder.d.ts +10 -7
  119. package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
  120. package/lib/core/graph/builder/CfgBuilder.js +12 -5
  121. package/lib/core/inference/Inference.d.ts.map +1 -1
  122. package/lib/core/inference/Inference.js +7 -0
  123. package/lib/core/inference/ModelInference.d.ts +1 -1
  124. package/lib/core/inference/ModelInference.d.ts.map +1 -1
  125. package/lib/core/inference/ValueInference.d.ts +3 -2
  126. package/lib/core/inference/ValueInference.d.ts.map +1 -1
  127. package/lib/core/inference/ValueInference.js +64 -12
  128. package/lib/core/inference/abc/AbcInference.d.ts +28 -2
  129. package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
  130. package/lib/core/inference/abc/AbcInference.js +105 -4
  131. package/lib/core/model/ArkBaseModel.d.ts +14 -1
  132. package/lib/core/model/ArkBaseModel.d.ts.map +1 -1
  133. package/lib/core/model/ArkBaseModel.js +61 -2
  134. package/lib/core/model/ArkBody.d.ts.map +1 -1
  135. package/lib/core/model/ArkBody.js +1 -3
  136. package/lib/core/model/ArkClass.d.ts +22 -2
  137. package/lib/core/model/ArkClass.d.ts.map +1 -1
  138. package/lib/core/model/ArkClass.js +59 -28
  139. package/lib/core/model/ArkField.d.ts.map +1 -1
  140. package/lib/core/model/ArkField.js +3 -1
  141. package/lib/core/model/ArkFile.d.ts +4 -1
  142. package/lib/core/model/ArkFile.d.ts.map +1 -1
  143. package/lib/core/model/ArkFile.js +44 -3
  144. package/lib/core/model/ArkImport.d.ts.map +1 -1
  145. package/lib/core/model/ArkImport.js +9 -1
  146. package/lib/core/model/ArkMethod.d.ts +5 -0
  147. package/lib/core/model/ArkMethod.d.ts.map +1 -1
  148. package/lib/core/model/ArkMethod.js +33 -1
  149. package/lib/core/model/ArkNamespace.d.ts +2 -0
  150. package/lib/core/model/ArkNamespace.d.ts.map +1 -1
  151. package/lib/core/model/ArkNamespace.js +11 -0
  152. package/lib/core/model/ArkSignature.d.ts +3 -3
  153. package/lib/core/model/ArkSignature.d.ts.map +1 -1
  154. package/lib/core/model/ArkSignature.js +14 -9
  155. package/lib/core/model/builder/ArkClassBuilder.d.ts +2 -0
  156. package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
  157. package/lib/core/model/builder/ArkClassBuilder.js +3 -3
  158. package/lib/core/model/builder/ArkMethodBuilder.d.ts +4 -1
  159. package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
  160. package/lib/core/model/builder/ArkMethodBuilder.js +19 -6
  161. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +1 -0
  162. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
  163. package/lib/core/model/builder/ArkNamespaceBuilder.js +2 -1
  164. package/lib/core/model/builder/BodyBuilder.d.ts +4 -0
  165. package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
  166. package/lib/core/model/builder/builderUtils.d.ts +1 -0
  167. package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
  168. package/lib/core/model/builder/builderUtils.js +7 -3
  169. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts +296 -0
  170. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts.map +1 -0
  171. package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.js +145 -0
  172. package/lib/frontend/cppFrontend/ast/astUtils.d.ts +51 -0
  173. package/lib/frontend/cppFrontend/ast/astUtils.d.ts.map +1 -0
  174. package/lib/frontend/cppFrontend/ast/astUtils.js +470 -0
  175. package/lib/frontend/cppFrontend/ast/const.d.ts +30 -0
  176. package/lib/frontend/cppFrontend/ast/const.d.ts.map +1 -0
  177. package/lib/frontend/cppFrontend/ast/const.js +134 -0
  178. package/lib/frontend/cppFrontend/base/Constant.d.ts +9 -0
  179. package/lib/frontend/cppFrontend/base/Constant.d.ts.map +1 -0
  180. package/lib/frontend/cppFrontend/base/Constant.js +33 -0
  181. package/lib/frontend/cppFrontend/base/Expr.d.ts +174 -0
  182. package/lib/frontend/cppFrontend/base/Expr.d.ts.map +1 -0
  183. package/lib/frontend/cppFrontend/base/Expr.js +530 -0
  184. package/lib/frontend/cppFrontend/base/Ref.d.ts +25 -0
  185. package/lib/frontend/cppFrontend/base/Ref.d.ts.map +1 -0
  186. package/lib/frontend/cppFrontend/base/Ref.js +53 -0
  187. package/lib/frontend/cppFrontend/base/Trap.d.ts +8 -0
  188. package/lib/frontend/cppFrontend/base/Trap.d.ts.map +1 -0
  189. package/lib/frontend/cppFrontend/base/Trap.js +28 -0
  190. package/lib/frontend/cppFrontend/base/Type.d.ts +264 -0
  191. package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -0
  192. package/lib/frontend/cppFrontend/base/Type.js +600 -0
  193. package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts +109 -0
  194. package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -0
  195. package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +925 -0
  196. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +477 -0
  197. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -0
  198. package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +2746 -0
  199. package/lib/frontend/cppFrontend/common/Builtin.d.ts +57 -0
  200. package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -0
  201. package/lib/frontend/cppFrontend/common/Builtin.js +106 -0
  202. package/lib/frontend/cppFrontend/common/IRInference.d.ts +94 -0
  203. package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -0
  204. package/lib/frontend/cppFrontend/common/IRInference.js +1087 -0
  205. package/lib/frontend/cppFrontend/common/IRUtils.d.ts +23 -0
  206. package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -0
  207. package/lib/frontend/cppFrontend/common/IRUtils.js +168 -0
  208. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +44 -0
  209. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -0
  210. package/lib/frontend/cppFrontend/common/ModelUtils.js +567 -0
  211. package/lib/frontend/cppFrontend/common/TypeInference.d.ts +278 -0
  212. package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -0
  213. package/lib/frontend/cppFrontend/common/TypeInference.js +1354 -0
  214. package/lib/frontend/cppFrontend/common/ValueUtil.d.ts +16 -0
  215. package/lib/frontend/cppFrontend/common/ValueUtil.d.ts.map +1 -0
  216. package/lib/frontend/cppFrontend/common/ValueUtil.js +61 -0
  217. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts +182 -0
  218. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -0
  219. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +1435 -0
  220. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts +21 -0
  221. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts.map +1 -0
  222. package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.js +303 -0
  223. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts +15 -0
  224. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts.map +1 -0
  225. package/lib/frontend/cppFrontend/graph/builder/IfBuilder.js +161 -0
  226. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts +21 -0
  227. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts.map +1 -0
  228. package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.js +261 -0
  229. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts +12 -0
  230. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts.map +1 -0
  231. package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.js +155 -0
  232. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts +29 -0
  233. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts.map +1 -0
  234. package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.js +302 -0
  235. package/lib/frontend/cppFrontend/inference/CxxInference.d.ts +10 -0
  236. package/lib/frontend/cppFrontend/inference/CxxInference.d.ts.map +1 -0
  237. package/lib/frontend/cppFrontend/inference/CxxInference.js +41 -0
  238. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +28 -0
  239. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -0
  240. package/lib/frontend/cppFrontend/inference/CxxModelInference.js +98 -0
  241. package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts +20 -0
  242. package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -0
  243. package/lib/frontend/cppFrontend/inference/CxxValueInference.js +128 -0
  244. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts +11 -0
  245. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -0
  246. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +413 -0
  247. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts +5 -0
  248. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -0
  249. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +61 -0
  250. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +17 -0
  251. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -0
  252. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +285 -0
  253. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts +6 -0
  254. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts.map +1 -0
  255. package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.js +57 -0
  256. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts +14 -0
  257. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -0
  258. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +422 -0
  259. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +8 -0
  260. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
  261. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +194 -0
  262. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +59 -0
  263. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -0
  264. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +605 -0
  265. package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts +46 -0
  266. package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -0
  267. package/lib/frontend/cppFrontend/model/builder/builderUtils.js +499 -0
  268. package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts +44 -0
  269. package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts.map +1 -0
  270. package/lib/frontend/cppFrontend/utils/cmakeUtils.js +240 -0
  271. package/lib/index.d.ts +1 -0
  272. package/lib/index.d.ts.map +1 -1
  273. package/lib/index.js +7 -1
  274. package/lib/node_modules/ohos-typescript/.ohos-typescript-version +1 -0
  275. package/{node_modules → lib/node_modules}/ohos-typescript/package.json +2 -1
  276. package/lib/save/CGJsonPrinter.d.ts +8 -0
  277. package/lib/save/CGJsonPrinter.d.ts.map +1 -0
  278. package/lib/save/CGJsonPrinter.js +41 -0
  279. package/lib/save/GraphPrinter.js +2 -2
  280. package/lib/save/json/JsonDto.d.ts +86 -2
  281. package/lib/save/json/JsonDto.d.ts.map +1 -1
  282. package/lib/save/json/JsonSerialization.d.ts +1 -1
  283. package/lib/save/json/JsonSerialization.d.ts.map +1 -1
  284. package/lib/save/json/JsonSerialization.js +235 -145
  285. package/lib/save/source/SourceTransformer.d.ts.map +1 -1
  286. package/lib/save/source/SourceTransformer.js +0 -3
  287. package/lib/utils/CxxSceneUtils.d.ts +11 -0
  288. package/lib/utils/CxxSceneUtils.d.ts.map +1 -0
  289. package/lib/utils/CxxSceneUtils.js +178 -0
  290. package/lib/utils/FileUtils.d.ts +7 -8
  291. package/lib/utils/FileUtils.d.ts.map +1 -1
  292. package/lib/utils/FileUtils.js +27 -45
  293. package/lib/utils/LRUCacheDecorator.d.ts +20 -0
  294. package/lib/utils/LRUCacheDecorator.d.ts.map +1 -0
  295. package/lib/utils/LRUCacheDecorator.js +89 -0
  296. package/lib/utils/ModuleUtils.d.ts +39 -0
  297. package/lib/utils/ModuleUtils.d.ts.map +1 -0
  298. package/lib/utils/ModuleUtils.js +261 -0
  299. package/package.json +10 -7
  300. /package/{node_modules → lib/node_modules}/ohos-typescript/LICENSE +0 -0
  301. /package/{node_modules → lib/node_modules}/ohos-typescript/README.OpenSource +0 -0
  302. /package/{node_modules → lib/node_modules}/ohos-typescript/README.md +0 -0
  303. /package/{node_modules → lib/node_modules}/ohos-typescript/SECURITY.md +0 -0
  304. /package/{node_modules → lib/node_modules}/ohos-typescript/ThirdPartyNoticeText.txt +0 -0
  305. /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsc +0 -0
  306. /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsserver +0 -0
  307. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/README.md +0 -0
  308. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cancellationToken.js +0 -0
  309. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -0
  310. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -0
  311. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -0
  312. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -0
  313. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -0
  314. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -0
  315. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -0
  316. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.d.ts +0 -0
  317. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.d.ts +0 -0
  318. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -0
  319. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.collection.d.ts +0 -0
  320. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.core.d.ts +0 -0
  321. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.d.ts +0 -0
  322. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.generator.d.ts +0 -0
  323. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.iterable.d.ts +0 -0
  324. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.promise.d.ts +0 -0
  325. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.proxy.d.ts +0 -0
  326. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.reflect.d.ts +0 -0
  327. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.d.ts +0 -0
  328. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -0
  329. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.array.include.d.ts +0 -0
  330. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.d.ts +0 -0
  331. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.full.d.ts +0 -0
  332. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.d.ts +0 -0
  333. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.full.d.ts +0 -0
  334. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.intl.d.ts +0 -0
  335. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.object.d.ts +0 -0
  336. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.sharedmemory.d.ts +0 -0
  337. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.string.d.ts +0 -0
  338. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.typedarrays.d.ts +0 -0
  339. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -0
  340. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asynciterable.d.ts +0 -0
  341. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.d.ts +0 -0
  342. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.full.d.ts +0 -0
  343. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.intl.d.ts +0 -0
  344. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.promise.d.ts +0 -0
  345. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.regexp.d.ts +0 -0
  346. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.array.d.ts +0 -0
  347. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.d.ts +0 -0
  348. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.full.d.ts +0 -0
  349. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.intl.d.ts +0 -0
  350. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.object.d.ts +0 -0
  351. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.string.d.ts +0 -0
  352. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.symbol.d.ts +0 -0
  353. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.bigint.d.ts +0 -0
  354. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.d.ts +0 -0
  355. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.date.d.ts +0 -0
  356. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.full.d.ts +0 -0
  357. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.intl.d.ts +0 -0
  358. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.number.d.ts +0 -0
  359. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.promise.d.ts +0 -0
  360. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.sharedmemory.d.ts +0 -0
  361. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.string.d.ts +0 -0
  362. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
  363. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.d.ts +0 -0
  364. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.full.d.ts +0 -0
  365. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.intl.d.ts +0 -0
  366. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.promise.d.ts +0 -0
  367. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.string.d.ts +0 -0
  368. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.weakref.d.ts +0 -0
  369. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.array.d.ts +0 -0
  370. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.d.ts +0 -0
  371. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.error.d.ts +0 -0
  372. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.full.d.ts +0 -0
  373. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.intl.d.ts +0 -0
  374. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.object.d.ts +0 -0
  375. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.sharedmemory.d.ts +0 -0
  376. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.string.d.ts +0 -0
  377. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es5.d.ts +0 -0
  378. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es6.d.ts +0 -0
  379. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.d.ts +0 -0
  380. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.full.d.ts +0 -0
  381. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.intl.d.ts +0 -0
  382. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.scripthost.d.ts +0 -0
  383. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.d.ts +0 -0
  384. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -0
  385. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -0
  386. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -0
  387. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -0
  388. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -0
  389. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -0
  390. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsc.js +0 -0
  391. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserver.js +0 -0
  392. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.d.ts +0 -0
  393. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.js +0 -0
  394. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typesMap.json +0 -0
  395. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.d.ts +0 -0
  396. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.js +0 -0
  397. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typingsInstaller.js +0 -0
  398. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/watchGuard.js +0 -0
  399. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -0
  400. /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -0
@@ -23,8 +23,46 @@ const TSConst_1 = require("../common/TSConst");
23
23
  * @category core/base/type
24
24
  */
25
25
  class Type {
26
+ /** True if this type can contain other types and thus participate in cycles */
27
+ canParticipateInCycle() {
28
+ return false;
29
+ }
30
+ /**
31
+ * Returns a short display name for this type when used as a cycle back-reference.
32
+ * Override in named types (AliasType, ClassType, GenericType, UnclearReferenceType)
33
+ * to return the type name; default returns UNKNOWN_KEYWORD for anonymous types.
34
+ */
35
+ getDisplayNameForCycle() {
36
+ return TSConst_1.UNKNOWN_KEYWORD;
37
+ }
26
38
  toString() {
27
- return this.getTypeString();
39
+ return this.toStringWithVisited(new Set());
40
+ }
41
+ /**
42
+ * Converts type to string with cycle detection. Use when recursing into child types.
43
+ * Only container types are tracked in visited. We add on enter and remove on leave
44
+ * so that the same type in different branches (e.g. UnionType(A|B) where both use
45
+ * NumberType) is not falsely detected as a cycle.
46
+ * When a cycle is detected, returns the type's display name (e.g. A for AliasType)
47
+ * instead of a generic placeholder.
48
+ * @internal Package-internal use only. Prefer toString() for public API.
49
+ * @param visited Set of container types in the recursion path; omitted or undefined uses a new empty set (same root semantics as {@link toString}).
50
+ */
51
+ toStringWithVisited(visited = new Set()) {
52
+ if (this.canParticipateInCycle() && visited.has(this)) {
53
+ return this.getDisplayNameForCycle();
54
+ }
55
+ if (this.canParticipateInCycle()) {
56
+ visited.add(this);
57
+ }
58
+ try {
59
+ return this.getTypeString(visited);
60
+ }
61
+ finally {
62
+ if (this.canParticipateInCycle()) {
63
+ visited.delete(this);
64
+ }
65
+ }
28
66
  }
29
67
  }
30
68
  exports.Type = Type;
@@ -39,7 +77,7 @@ class AnyType extends Type {
39
77
  constructor() {
40
78
  super();
41
79
  }
42
- getTypeString() {
80
+ getTypeString(_visited) {
43
81
  return TSConst_1.ANY_KEYWORD;
44
82
  }
45
83
  }
@@ -56,7 +94,7 @@ class UnknownType extends Type {
56
94
  constructor() {
57
95
  super();
58
96
  }
59
- getTypeString() {
97
+ getTypeString(_visited) {
60
98
  return TSConst_1.UNKNOWN_KEYWORD;
61
99
  }
62
100
  }
@@ -67,6 +105,12 @@ UnknownType.INSTANCE = new UnknownType();
67
105
  * @category core/base/type
68
106
  */
69
107
  class UnclearReferenceType extends Type {
108
+ canParticipateInCycle() {
109
+ return true;
110
+ }
111
+ getDisplayNameForCycle() {
112
+ return this.name;
113
+ }
70
114
  constructor(name, genericTypes = []) {
71
115
  super();
72
116
  this.name = name;
@@ -78,10 +122,10 @@ class UnclearReferenceType extends Type {
78
122
  getGenericTypes() {
79
123
  return this.genericTypes;
80
124
  }
81
- getTypeString() {
125
+ getTypeString(visited = new Set()) {
82
126
  let str = this.name;
83
127
  if (this.genericTypes.length > 0) {
84
- str += '<' + this.genericTypes.join(',') + '>';
128
+ str += '<' + this.genericTypes.map(t => t.toStringWithVisited(visited)).join(',') + '>';
85
129
  }
86
130
  return str;
87
131
  }
@@ -99,7 +143,7 @@ class PrimitiveType extends Type {
99
143
  getName() {
100
144
  return this.name;
101
145
  }
102
- getTypeString() {
146
+ getTypeString(_visited) {
103
147
  return this.name;
104
148
  }
105
149
  }
@@ -138,6 +182,10 @@ class BigIntType extends PrimitiveType {
138
182
  }
139
183
  exports.BigIntType = BigIntType;
140
184
  BigIntType.INSTANCE = new BigIntType();
185
+ /**
186
+ * StringType type
187
+ * @category core/base/type
188
+ */
141
189
  class StringType extends PrimitiveType {
142
190
  constructor() {
143
191
  super(TSConst_1.STRING_KEYWORD);
@@ -149,7 +197,7 @@ class StringType extends PrimitiveType {
149
197
  exports.StringType = StringType;
150
198
  StringType.INSTANCE = new StringType();
151
199
  /**
152
- * null type
200
+ * Null type in TS/ArkTS, and it also refers to nullptr in Cxx.
153
201
  * @category core/base/type
154
202
  */
155
203
  class NullType extends PrimitiveType {
@@ -188,7 +236,7 @@ class LiteralType extends PrimitiveType {
188
236
  getLiteralName() {
189
237
  return this.literalName;
190
238
  }
191
- getTypeString() {
239
+ getTypeString(_visited) {
192
240
  return this.literalName.toString();
193
241
  }
194
242
  }
@@ -200,6 +248,9 @@ LiteralType.FALSE = new LiteralType(false);
200
248
  * @category core/base/type
201
249
  */
202
250
  class UnionType extends Type {
251
+ canParticipateInCycle() {
252
+ return true;
253
+ }
203
254
  constructor(types, currType = UnknownType.getInstance()) {
204
255
  super();
205
256
  this.types = [...types];
@@ -214,14 +265,14 @@ class UnionType extends Type {
214
265
  setCurrType(newType) {
215
266
  this.currType = newType;
216
267
  }
217
- getTypeString() {
218
- let typesString = [];
268
+ getTypeString(visited = new Set()) {
269
+ const typesString = [];
219
270
  this.getTypes().forEach(t => {
220
271
  if (t instanceof UnionType || t instanceof IntersectionType) {
221
- typesString.push(`(${t.toString()})`);
272
+ typesString.push(`(${t.toStringWithVisited(visited)})`);
222
273
  }
223
274
  else {
224
- typesString.push(t.toString());
275
+ typesString.push(t.toStringWithVisited(visited));
225
276
  }
226
277
  });
227
278
  return typesString.join('|');
@@ -246,6 +297,9 @@ exports.UnionType = UnionType;
246
297
  * @category core/base/type
247
298
  */
248
299
  class IntersectionType extends Type {
300
+ canParticipateInCycle() {
301
+ return true;
302
+ }
249
303
  constructor(types) {
250
304
  super();
251
305
  this.types = [...types];
@@ -253,14 +307,14 @@ class IntersectionType extends Type {
253
307
  getTypes() {
254
308
  return this.types;
255
309
  }
256
- getTypeString() {
257
- let typesString = [];
310
+ getTypeString(visited = new Set()) {
311
+ const typesString = [];
258
312
  this.getTypes().forEach(t => {
259
313
  if (t instanceof UnionType || t instanceof IntersectionType) {
260
- typesString.push(`(${t.toString()})`);
314
+ typesString.push(`(${t.toStringWithVisited(visited)})`);
261
315
  }
262
316
  else {
263
- typesString.push(t.toString());
317
+ typesString.push(t.toStringWithVisited(visited));
264
318
  }
265
319
  });
266
320
  return typesString.join('&');
@@ -278,12 +332,16 @@ class VoidType extends Type {
278
332
  constructor() {
279
333
  super();
280
334
  }
281
- getTypeString() {
335
+ getTypeString(_visited) {
282
336
  return TSConst_1.VOID_KEYWORD;
283
337
  }
284
338
  }
285
339
  exports.VoidType = VoidType;
286
340
  VoidType.INSTANCE = new VoidType();
341
+ /**
342
+ * NeverType type
343
+ * @category core/base/type
344
+ */
287
345
  class NeverType extends Type {
288
346
  static getInstance() {
289
347
  return this.INSTANCE;
@@ -291,7 +349,7 @@ class NeverType extends Type {
291
349
  constructor() {
292
350
  super();
293
351
  }
294
- getTypeString() {
352
+ getTypeString(_visited) {
295
353
  return TSConst_1.NEVER_KEYWORD;
296
354
  }
297
355
  }
@@ -302,6 +360,9 @@ NeverType.INSTANCE = new NeverType();
302
360
  * @category core/base/type
303
361
  */
304
362
  class FunctionType extends Type {
363
+ canParticipateInCycle() {
364
+ return true;
365
+ }
305
366
  constructor(methodSignature, realGenericTypes) {
306
367
  super();
307
368
  this.methodSignature = methodSignature;
@@ -313,8 +374,14 @@ class FunctionType extends Type {
313
374
  getRealGenericTypes() {
314
375
  return this.realGenericTypes;
315
376
  }
316
- getTypeString() {
317
- return this.methodSignature.toString();
377
+ getTypeString(visited = new Set()) {
378
+ const sig = this.methodSignature.getMethodSubSignature();
379
+ const classStr = this.methodSignature.getDeclaringClassSignature().toString();
380
+ const paramStrs = sig.getParameterTypes()
381
+ .map(t => t ? t.toStringWithVisited(visited) : UnknownType.getInstance().toString())
382
+ .join(', ');
383
+ const methodPart = (sig.isStatic() ? '[static]' : '') + sig.getMethodName() + '(' + paramStrs + ')';
384
+ return classStr + '.' + methodPart;
318
385
  }
319
386
  }
320
387
  exports.FunctionType = FunctionType;
@@ -330,16 +397,22 @@ class ClosureType extends FunctionType {
330
397
  getLexicalEnv() {
331
398
  return this.lexicalEnv;
332
399
  }
333
- getTypeString() {
334
- return 'closures: ' + super.getTypeString();
400
+ getTypeString(visited = new Set()) {
401
+ return 'closures: ' + super.getTypeString(visited);
335
402
  }
336
403
  }
337
404
  exports.ClosureType = ClosureType;
338
405
  /**
339
- * type of an object
406
+ * type of object
340
407
  * @category core/base/type
341
408
  */
342
409
  class ClassType extends Type {
410
+ canParticipateInCycle() {
411
+ return true;
412
+ }
413
+ getDisplayNameForCycle() {
414
+ return this.classSignature.toString();
415
+ }
343
416
  constructor(classSignature, realGenericTypes) {
344
417
  super();
345
418
  this.classSignature = classSignature;
@@ -357,12 +430,10 @@ class ClassType extends Type {
357
430
  setRealGenericTypes(types) {
358
431
  this.realGenericTypes = types;
359
432
  }
360
- getTypeString() {
361
- var _a;
433
+ getTypeString(visited = new Set()) {
362
434
  let temp = this.classSignature.toString();
363
- let generic = (_a = this.realGenericTypes) === null || _a === void 0 ? void 0 : _a.join(',');
364
- if (generic) {
365
- temp += `<${generic}>`;
435
+ if (this.realGenericTypes && this.realGenericTypes.length > 0) {
436
+ temp += `<${this.realGenericTypes.map(t => t.toStringWithVisited(visited)).join(',')}>`;
366
437
  }
367
438
  return temp;
368
439
  }
@@ -382,6 +453,9 @@ exports.ClassType = ClassType;
382
453
  ```
383
454
  */
384
455
  class ArrayType extends Type {
456
+ canParticipateInCycle() {
457
+ return true;
458
+ }
385
459
  constructor(baseType, dimension) {
386
460
  super();
387
461
  this.baseType = baseType;
@@ -406,16 +480,18 @@ class ArrayType extends Type {
406
480
  getReadonlyFlag() {
407
481
  return this.readonlyFlag;
408
482
  }
409
- getTypeString() {
483
+ getTypeString(visited = new Set()) {
410
484
  const strs = [];
411
485
  if (this.getReadonlyFlag()) {
412
486
  strs.push('readonly ');
413
487
  }
414
- if (this.baseType instanceof UnionType || this.baseType instanceof IntersectionType) {
415
- strs.push('(' + this.baseType.toString() + ')');
416
- }
417
- else if (this.baseType) {
418
- strs.push(this.baseType.toString());
488
+ if (this.baseType) {
489
+ if (this.baseType instanceof UnionType || this.baseType instanceof IntersectionType) {
490
+ strs.push('(' + this.baseType.toStringWithVisited(visited) + ')');
491
+ }
492
+ else {
493
+ strs.push(this.baseType.toStringWithVisited(visited));
494
+ }
419
495
  }
420
496
  for (let i = 0; i < this.dimension; i++) {
421
497
  strs.push('[]');
@@ -438,6 +514,9 @@ exports.ArrayType = ArrayType;
438
514
  ```
439
515
  */
440
516
  class TupleType extends Type {
517
+ canParticipateInCycle() {
518
+ return true;
519
+ }
441
520
  constructor(types) {
442
521
  super();
443
522
  this.types = types;
@@ -451,11 +530,12 @@ class TupleType extends Type {
451
530
  getReadonlyFlag() {
452
531
  return this.readonlyFlag;
453
532
  }
454
- getTypeString() {
533
+ getTypeString(visited = new Set()) {
534
+ const typesStr = this.types.map(t => t.toStringWithVisited(visited)).join(', ');
455
535
  if (this.getReadonlyFlag()) {
456
- return 'readonly [' + this.types.join(', ') + ']';
536
+ return 'readonly [' + typesStr + ']';
457
537
  }
458
- return '[' + this.types.join(', ') + ']';
538
+ return '[' + typesStr + ']';
459
539
  }
460
540
  }
461
541
  exports.TupleType = TupleType;
@@ -478,6 +558,12 @@ exports.TupleType = TupleType;
478
558
  ```
479
559
  */
480
560
  class AliasType extends Type {
561
+ canParticipateInCycle() {
562
+ return true;
563
+ }
564
+ getDisplayNameForCycle() {
565
+ return this.name;
566
+ }
481
567
  constructor(name, originalType, signature, genericTypes) {
482
568
  super();
483
569
  this.name = name;
@@ -494,12 +580,15 @@ class AliasType extends Type {
494
580
  getOriginalType() {
495
581
  return this.originalType;
496
582
  }
497
- getTypeString() {
498
- var _a, _b, _c;
499
- let res = this.getSignature().toString();
500
- let generic = (_b = (_a = this.getRealGenericTypes()) === null || _a === void 0 ? void 0 : _a.join(',')) !== null && _b !== void 0 ? _b : (_c = this.getGenericTypes()) === null || _c === void 0 ? void 0 : _c.join(',');
501
- if (generic) {
502
- res += `<${generic}>`;
583
+ getTypeString(visited = new Set()) {
584
+ let res = this.getSignature().toString(visited);
585
+ const realGeneric = this.getRealGenericTypes();
586
+ const generic = this.getGenericTypes();
587
+ if (realGeneric && realGeneric.length > 0) {
588
+ res += `<${realGeneric.map(t => t.toStringWithVisited(visited)).join(',')}>`;
589
+ }
590
+ else if (generic && generic.length > 0) {
591
+ res += `<${generic.map(gt => gt.toStringWithVisited(visited)).join(',')}>`;
503
592
  }
504
593
  return res;
505
594
  }
@@ -550,6 +639,12 @@ class AliasType extends Type {
550
639
  }
551
640
  exports.AliasType = AliasType;
552
641
  class GenericType extends Type {
642
+ canParticipateInCycle() {
643
+ return true;
644
+ }
645
+ getDisplayNameForCycle() {
646
+ return this.name;
647
+ }
553
648
  constructor(name, defaultType, constraint) {
554
649
  super();
555
650
  this.index = 0;
@@ -579,13 +674,13 @@ class GenericType extends Type {
579
674
  var _a;
580
675
  return (_a = this.index) !== null && _a !== void 0 ? _a : 0;
581
676
  }
582
- getTypeString() {
677
+ getTypeString(visited = new Set()) {
583
678
  let str = this.name;
584
679
  if (this.constraint) {
585
- str += ' extends ' + this.constraint.toString();
680
+ str += ' extends ' + this.constraint.toStringWithVisited(visited);
586
681
  }
587
682
  if (this.defaultType) {
588
- str += ' = ' + this.defaultType.toString();
683
+ str += ' = ' + this.defaultType.toStringWithVisited(visited);
589
684
  }
590
685
  return str;
591
686
  }
@@ -599,7 +694,7 @@ class AnnotationType extends Type {
599
694
  getOriginType() {
600
695
  return this.originType;
601
696
  }
602
- getTypeString() {
697
+ getTypeString(_visited) {
603
698
  return this.originType;
604
699
  }
605
700
  }
@@ -647,7 +742,7 @@ class LexicalEnvType extends Type {
647
742
  addClosure(closure) {
648
743
  this.closures.push(closure);
649
744
  }
650
- getTypeString() {
745
+ getTypeString(_visited) {
651
746
  return `[${this.getClosures().join(', ')}]`;
652
747
  }
653
748
  }
@@ -664,7 +759,7 @@ class EnumValueType extends Type {
664
759
  getConstant() {
665
760
  return this.constant;
666
761
  }
667
- getTypeString() {
762
+ getTypeString(_visited) {
668
763
  return this.signature.toString();
669
764
  }
670
765
  }
@@ -1,15 +1,39 @@
1
1
  export declare enum ArkErrorCode {
2
2
  OK = 0,
3
- CLASS_INSTANCE_FIELD_UNDEFINDED = -1,
3
+ CLASS_INSTANCE_FIELD_UNDEFINED = -1,
4
4
  BB_MORE_THAN_ONE_BRANCH_RET_STMT = -2,
5
5
  BB_BRANCH_RET_STMT_NOT_AT_END = -3,
6
6
  CFG_NOT_FOUND_START_BLOCK = -4,
7
7
  CFG_HAS_UNREACHABLE_BLOCK = -5,
8
8
  METHOD_SIGNATURE_UNDEFINED = -6,
9
- METHOD_SIGNATURE_LINE_UNMATCHED = -7
9
+ METHOD_SIGNATURE_LINE_UNMATCHED = -7,
10
+ /** CLI: invalid flag value or unsupported option */
11
+ CLI_INVALID_OPTION = -8,
12
+ /** CLI: method reference matches more than one method */
13
+ CLI_AMBIGUOUS_METHOD_REF = -9,
14
+ /** CLI: entry method could not be resolved */
15
+ CLI_ENTRY_METHOD_NOT_FOUND = -10
10
16
  }
11
17
  export interface ArkError {
12
18
  errCode: ArkErrorCode;
13
19
  errMsg?: string;
14
20
  }
21
+ /**
22
+ * Error thrown by ArkAnalyzer when reporting a structured {@link ArkError}.
23
+ * Static helpers produce unified console text for operators.
24
+ */
25
+ export declare class ArkAnalyzerError extends Error {
26
+ readonly arkError: ArkError;
27
+ constructor(arkError: ArkError);
28
+ getErrCode(): number;
29
+ toString(): string;
30
+ /** Resolve numeric {@link ArkErrorCode} to its enum member name for display. */
31
+ private static getArkErrorCodeName;
32
+ /**
33
+ * Human-readable stderr format for operators:
34
+ * `arkanalyzer: error: [<code>] (<errCode>) <message>`
35
+ * Multi-line `errMsg` is printed on following lines, each prefixed with `arkanalyzer: error: | `.
36
+ */
37
+ private static formatArkErrorConsole;
38
+ }
15
39
  //# sourceMappingURL=ArkError.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ArkError.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkError.ts"],"names":[],"mappings":"AAeA,oBAAY,YAAY;IACpB,EAAE,IAAI;IACN,+BAA+B,KAAK;IACpC,gCAAgC,KAAK;IACrC,6BAA6B,KAAK;IAClC,yBAAyB,KAAK;IAC9B,yBAAyB,KAAK;IAC9B,0BAA0B,KAAK;IAC/B,+BAA+B,KAAK;CACvC;AAED,MAAM,WAAW,QAAQ;IACrB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB"}
1
+ {"version":3,"file":"ArkError.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkError.ts"],"names":[],"mappings":"AAeA,oBAAY,YAAY;IACpB,EAAE,IAAI;IACN,8BAA8B,KAAK;IACnC,gCAAgC,KAAK;IACrC,6BAA6B,KAAK;IAClC,yBAAyB,KAAK;IAC9B,yBAAyB,KAAK;IAC9B,0BAA0B,KAAK;IAC/B,+BAA+B,KAAK;IACpC,oDAAoD;IACpD,kBAAkB,KAAK;IACvB,yDAAyD;IACzD,wBAAwB,KAAK;IAC7B,8CAA8C;IAC9C,0BAA0B,MAAM;CACnC;AAED,MAAM,WAAW,QAAQ;IACrB,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACvC,SAAgB,QAAQ,EAAE,QAAQ,CAAC;gBAEvB,QAAQ,EAAE,QAAQ;IAO9B,UAAU,IAAI,MAAM;IAIX,QAAQ,IAAI,MAAM;IAI3B,gFAAgF;IAChF,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAKlC;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,qBAAqB;CAmBvC"}
@@ -14,15 +14,69 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.ArkErrorCode = void 0;
17
+ exports.ArkAnalyzerError = exports.ArkErrorCode = void 0;
18
18
  var ArkErrorCode;
19
19
  (function (ArkErrorCode) {
20
20
  ArkErrorCode[ArkErrorCode["OK"] = 0] = "OK";
21
- ArkErrorCode[ArkErrorCode["CLASS_INSTANCE_FIELD_UNDEFINDED"] = -1] = "CLASS_INSTANCE_FIELD_UNDEFINDED";
21
+ ArkErrorCode[ArkErrorCode["CLASS_INSTANCE_FIELD_UNDEFINED"] = -1] = "CLASS_INSTANCE_FIELD_UNDEFINED";
22
22
  ArkErrorCode[ArkErrorCode["BB_MORE_THAN_ONE_BRANCH_RET_STMT"] = -2] = "BB_MORE_THAN_ONE_BRANCH_RET_STMT";
23
23
  ArkErrorCode[ArkErrorCode["BB_BRANCH_RET_STMT_NOT_AT_END"] = -3] = "BB_BRANCH_RET_STMT_NOT_AT_END";
24
24
  ArkErrorCode[ArkErrorCode["CFG_NOT_FOUND_START_BLOCK"] = -4] = "CFG_NOT_FOUND_START_BLOCK";
25
25
  ArkErrorCode[ArkErrorCode["CFG_HAS_UNREACHABLE_BLOCK"] = -5] = "CFG_HAS_UNREACHABLE_BLOCK";
26
26
  ArkErrorCode[ArkErrorCode["METHOD_SIGNATURE_UNDEFINED"] = -6] = "METHOD_SIGNATURE_UNDEFINED";
27
27
  ArkErrorCode[ArkErrorCode["METHOD_SIGNATURE_LINE_UNMATCHED"] = -7] = "METHOD_SIGNATURE_LINE_UNMATCHED";
28
+ /** CLI: invalid flag value or unsupported option */
29
+ ArkErrorCode[ArkErrorCode["CLI_INVALID_OPTION"] = -8] = "CLI_INVALID_OPTION";
30
+ /** CLI: method reference matches more than one method */
31
+ ArkErrorCode[ArkErrorCode["CLI_AMBIGUOUS_METHOD_REF"] = -9] = "CLI_AMBIGUOUS_METHOD_REF";
32
+ /** CLI: entry method could not be resolved */
33
+ ArkErrorCode[ArkErrorCode["CLI_ENTRY_METHOD_NOT_FOUND"] = -10] = "CLI_ENTRY_METHOD_NOT_FOUND";
28
34
  })(ArkErrorCode = exports.ArkErrorCode || (exports.ArkErrorCode = {}));
35
+ /**
36
+ * Error thrown by ArkAnalyzer when reporting a structured {@link ArkError}.
37
+ * Static helpers produce unified console text for operators.
38
+ */
39
+ class ArkAnalyzerError extends Error {
40
+ constructor(arkError) {
41
+ var _a;
42
+ super((_a = arkError.errMsg) !== null && _a !== void 0 ? _a : `ArkErrorCode(${arkError.errCode})`);
43
+ this.name = 'ArkAnalyzerError';
44
+ this.arkError = arkError;
45
+ Object.setPrototypeOf(this, new.target.prototype);
46
+ }
47
+ getErrCode() {
48
+ return this.arkError.errCode;
49
+ }
50
+ toString() {
51
+ return ArkAnalyzerError.formatArkErrorConsole(this.arkError);
52
+ }
53
+ /** Resolve numeric {@link ArkErrorCode} to its enum member name for display. */
54
+ static getArkErrorCodeName(errCode) {
55
+ const name = ArkErrorCode[errCode];
56
+ return typeof name === 'string' ? name : `UNKNOWN_${errCode}`;
57
+ }
58
+ /**
59
+ * Human-readable stderr format for operators:
60
+ * `arkanalyzer: error: [<code>] (<errCode>) <message>`
61
+ * Multi-line `errMsg` is printed on following lines, each prefixed with `arkanalyzer: error: | `.
62
+ */
63
+ static formatArkErrorConsole(arkError) {
64
+ var _a;
65
+ const code = ArkAnalyzerError.getArkErrorCodeName(arkError.errCode);
66
+ const errCode = arkError.errCode;
67
+ const message = (_a = arkError.errMsg) !== null && _a !== void 0 ? _a : '';
68
+ const head = `arkanalyzer: error: [${code}] (${errCode})`;
69
+ if (!message) {
70
+ return head;
71
+ }
72
+ if (!message.includes('\n')) {
73
+ return `${head} ${message}`;
74
+ }
75
+ const body = message
76
+ .split('\n')
77
+ .map((line) => `arkanalyzer: error: | ${line}`)
78
+ .join('\n');
79
+ return `${head}\n${body}`;
80
+ }
81
+ }
82
+ exports.ArkAnalyzerError = ArkAnalyzerError;
@@ -1,4 +1,4 @@
1
- import { BinaryOperator, UnaryOperator } from '../base/Expr';
1
+ import { AliasTypeExpr, BinaryOperator, UnaryOperator } from '../base/Expr';
2
2
  import { GlobalRef } from '../base/Ref';
3
3
  import { Value } from '../base/Value';
4
4
  import * as ts from 'ohos-typescript';
@@ -7,6 +7,7 @@ import { ArkAliasTypeDefineStmt, Stmt } from '../base/Stmt';
7
7
  import { AliasType } from '../base/Type';
8
8
  import { ArkMethod } from '../model/ArkMethod';
9
9
  import { FullPosition } from '../base/Position';
10
+ import { ArkValueTransformer } from './ArkValueTransformer';
10
11
  export type ValueAndStmts = {
11
12
  value: Value;
12
13
  valueOriginalPositions: FullPosition[];
@@ -22,12 +23,12 @@ export declare class ArkIRTransformer {
22
23
  static readonly DUMMY_CONDITIONAL_OPERATOR_IF_TRUE_STMT: string;
23
24
  static readonly DUMMY_CONDITIONAL_OPERATOR_IF_FALSE_STMT: string;
24
25
  static readonly DUMMY_CONDITIONAL_OPERATOR_END_STMT: string;
25
- private sourceFile;
26
- private declaringMethod;
27
- private inBuilderMethod;
28
- private builderMethodContextFlag;
29
- private stmtsHaveOriginalText;
30
- private arkValueTransformer;
26
+ protected sourceFile: ts.SourceFile;
27
+ protected declaringMethod: ArkMethod;
28
+ protected inBuilderMethod: boolean;
29
+ protected builderMethodContextFlag: boolean;
30
+ protected stmtsHaveOriginalText: Set<Stmt>;
31
+ protected arkValueTransformer: ArkValueTransformer;
31
32
  constructor(sourceFile: ts.SourceFile, declaringMethod: ArkMethod);
32
33
  getLocals(): Set<Local>;
33
34
  getGlobals(): Map<string, GlobalRef> | null;
@@ -36,8 +37,8 @@ export declare class ArkIRTransformer {
36
37
  prebuildStmts(): Stmt[];
37
38
  tsNodeToStmts(node: ts.Node): Stmt[];
38
39
  tsNodeToValueAndStmts(node: ts.Node): ValueAndStmts;
39
- private functionDeclarationToStmts;
40
- private classDeclarationToStmts;
40
+ protected functionDeclarationToStmts(functionDeclarationNode: ts.FunctionDeclaration): Stmt[];
41
+ protected classDeclarationToStmts(node: ts.ClassDeclaration): Stmt[];
41
42
  private parameterPropertyToStmts;
42
43
  private parameterToStmts;
43
44
  private returnStatementToStmts;
@@ -46,7 +47,7 @@ export declare class ArkIRTransformer {
46
47
  private addInvokeStmts;
47
48
  private shouldGenerateExtraAssignStmt;
48
49
  private typeAliasDeclarationToStmts;
49
- private generateAliasTypeExpr;
50
+ protected generateAliasTypeExpr(rightOp: ts.TypeNode, aliasType: AliasType): AliasTypeExpr;
50
51
  private resolveImportTypeNode;
51
52
  switchStatementToValueAndStmts(switchStatement: ts.SwitchStatement): ValueAndStmts[];
52
53
  private forStatementToStmts;
@@ -1 +1 @@
1
- {"version":3,"file":"ArkIRTransformer.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkIRTransformer.ts"],"names":[],"mappings":"AAeA,OAAO,EAOH,cAAc,EAGd,aAAa,EAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAA2E,SAAS,EAAE,MAAM,aAAa,CAAC;AACjH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAA2F,IAAI,EAAE,MAAM,cAAc,CAAC;AACrJ,OAAO,EAAE,SAAS,EAA6E,MAAM,cAAc,CAAC;AAKpH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAI/C,OAAO,EAAE,YAAY,EAAmB,MAAM,kBAAkB,CAAC;AAYjE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BAAqB;IAU7B,OAAO,CAAC,kBAAkB;IAiB1B,OAAO,CAAC,yBAAyB;IAOjC,OAAO,CAAC,uBAAuB;IAYxB,gBAAgB,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,IAAI;WAU7C,oBAAoB,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,GAAG,aAAa,GAAG,IAAI;WAahE,qBAAqB,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,GAAG,cAAc,GAAG,IAAI;IAqDzE,0BAA0B,CAAC,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,GAAG,aAAa;IAmB/F,uBAAuB,CAC1B,SAAS,EAAE,KAAK,EAChB,uBAAuB,EAAE,YAAY,EAAE,EACvC,UAAU,EAAE,KAAK,EACjB,wBAAwB,EAAE,YAAY,EAAE,GACzC,IAAI,EAAE;IA+BF,2BAA2B,CAAC,wBAAwB,EAAE,OAAO,GAAG,IAAI;CAG9E"}
@@ -267,7 +267,7 @@ class ArkIRTransformer {
267
267
  if (paramLocal === undefined) {
268
268
  return stmts;
269
269
  }
270
- const { value: paramInitValue, valueOriginalPositions: paramInitPositions, stmts: paramInitStmts, } = this.tsNodeToValueAndStmts(paramNode.initializer);
270
+ const { value: paramInitValue, valueOriginalPositions: paramInitPositions, stmts: paramInitStmts } = this.tsNodeToValueAndStmts(paramNode.initializer);
271
271
  stmts.push(...paramInitStmts);
272
272
  const ifStmt = new Stmt_1.ArkIfStmt(new Expr_1.ArkConditionExpr(paramLocal, ValueUtil_1.ValueUtil.getUndefinedConst(), Expr_1.RelationalBinaryOperator.Equality));
273
273
  ifStmt.setOperandOriginalPositions([Position_1.FullPosition.DEFAULT, Position_1.FullPosition.DEFAULT]);