arkanalyzer 1.0.93 → 2.0.0-beta1

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 (326) hide show
  1. package/lib/Config.d.ts +7 -0
  2. package/lib/Config.d.ts.map +1 -1
  3. package/lib/Scene.d.ts +134 -170
  4. package/lib/Scene.d.ts.map +1 -1
  5. package/lib/Scene.js +412 -976
  6. package/lib/callgraph/algorithm/AbstractAnalysis.js +3 -2
  7. package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
  8. package/lib/callgraph/algorithm/RapidTypeAnalysis.js +2 -3
  9. package/lib/callgraph/model/CallGraph.js +1 -1
  10. package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts +1 -3
  11. package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts.map +1 -1
  12. package/lib/callgraph/pointerAnalysis/PTAUtils.js +17 -7
  13. package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
  14. package/lib/callgraph/pointerAnalysis/Pag.js +4 -14
  15. package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -1
  16. package/lib/callgraph/pointerAnalysis/PagBuilder.js +2 -1
  17. package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -1
  18. package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +1 -2
  19. package/lib/callgraph/pointerAnalysis/plugins/WorkerPlugin.d.ts.map +1 -1
  20. package/lib/callgraph/pointerAnalysis/plugins/WorkerPlugin.js +0 -1
  21. package/lib/cli/commands/cg.d.ts +1 -0
  22. package/lib/cli/commands/cg.d.ts.map +1 -1
  23. package/lib/cli/commands/cg.js +22 -18
  24. package/lib/cli/commands/ir.d.ts +1 -0
  25. package/lib/cli/commands/ir.d.ts.map +1 -1
  26. package/lib/cli/commands/ir.js +5 -2
  27. package/lib/core/base/Constant.d.ts +5 -5
  28. package/lib/core/base/Constant.d.ts.map +1 -1
  29. package/lib/core/base/Constant.js +12 -9
  30. package/lib/core/base/Expr.d.ts +36 -20
  31. package/lib/core/base/Expr.d.ts.map +1 -1
  32. package/lib/core/base/Expr.js +206 -94
  33. package/lib/core/base/Local.d.ts +10 -20
  34. package/lib/core/base/Local.d.ts.map +1 -1
  35. package/lib/core/base/Local.js +25 -28
  36. package/lib/core/base/Position.d.ts +6 -0
  37. package/lib/core/base/Position.d.ts.map +1 -1
  38. package/lib/core/base/Position.js +37 -11
  39. package/lib/core/base/Ref.d.ts +45 -33
  40. package/lib/core/base/Ref.d.ts.map +1 -1
  41. package/lib/core/base/Ref.js +225 -51
  42. package/lib/core/base/Stmt.d.ts +19 -9
  43. package/lib/core/base/Stmt.d.ts.map +1 -1
  44. package/lib/core/base/Stmt.js +135 -52
  45. package/lib/core/base/Type.d.ts +67 -4
  46. package/lib/core/base/Type.d.ts.map +1 -1
  47. package/lib/core/base/Type.js +391 -20
  48. package/lib/core/base/TypeExpr.d.ts +6 -4
  49. package/lib/core/base/TypeExpr.d.ts.map +1 -1
  50. package/lib/core/base/TypeExpr.js +34 -10
  51. package/lib/core/base/Value.d.ts +20 -2
  52. package/lib/core/base/Value.d.ts.map +1 -1
  53. package/lib/core/base/Value.js +12 -0
  54. package/lib/core/common/ArkIRTransformer.d.ts +18 -0
  55. package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
  56. package/lib/core/common/ArkIRTransformer.js +94 -75
  57. package/lib/core/common/ArkValueTransformer.d.ts +21 -3
  58. package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
  59. package/lib/core/common/ArkValueTransformer.js +458 -266
  60. package/lib/core/common/Builtin.d.ts +48 -24
  61. package/lib/core/common/Builtin.d.ts.map +1 -1
  62. package/lib/core/common/Builtin.js +90 -52
  63. package/lib/core/common/CanonicalizerValidator.d.ts +308 -0
  64. package/lib/core/common/CanonicalizerValidator.d.ts.map +1 -0
  65. package/lib/core/common/CanonicalizerValidator.js +888 -0
  66. package/lib/core/common/Const.d.ts +3 -3
  67. package/lib/core/common/Const.d.ts.map +1 -1
  68. package/lib/core/common/Const.js +3 -3
  69. package/lib/core/common/DummyMainCreater.d.ts +2 -21
  70. package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
  71. package/lib/core/common/DummyMainCreater.js +8 -105
  72. package/lib/core/common/IRInference.d.ts +55 -3
  73. package/lib/core/common/IRInference.d.ts.map +1 -1
  74. package/lib/core/common/IRInference.js +407 -126
  75. package/lib/core/common/IRUtils.d.ts +1 -0
  76. package/lib/core/common/IRUtils.d.ts.map +1 -1
  77. package/lib/core/common/IRUtils.js +44 -13
  78. package/lib/core/common/ModelUtils.d.ts +44 -20
  79. package/lib/core/common/ModelUtils.d.ts.map +1 -1
  80. package/lib/core/common/ModelUtils.js +378 -208
  81. package/lib/core/common/SdkUtils.d.ts +35 -5
  82. package/lib/core/common/SdkUtils.d.ts.map +1 -1
  83. package/lib/core/common/SdkUtils.js +203 -59
  84. package/lib/core/common/SignatureCanonicalizer.d.ts +95 -0
  85. package/lib/core/common/SignatureCanonicalizer.d.ts.map +1 -0
  86. package/lib/core/common/SignatureCanonicalizer.js +116 -0
  87. package/lib/core/common/SignatureCanonicalizerRegistry.d.ts +176 -0
  88. package/lib/core/common/SignatureCanonicalizerRegistry.d.ts.map +1 -0
  89. package/lib/core/common/SignatureCanonicalizerRegistry.js +343 -0
  90. package/lib/core/common/SignatureModelCanonicalizer.d.ts +69 -0
  91. package/lib/core/common/SignatureModelCanonicalizer.d.ts.map +1 -0
  92. package/lib/core/common/SignatureModelCanonicalizer.js +109 -0
  93. package/lib/core/common/StmtUseReplacer.d.ts +1 -0
  94. package/lib/core/common/StmtUseReplacer.d.ts.map +1 -1
  95. package/lib/core/common/StmtUseReplacer.js +9 -0
  96. package/lib/core/common/StringUtils.d.ts +12 -1
  97. package/lib/core/common/StringUtils.d.ts.map +1 -1
  98. package/lib/core/common/StringUtils.js +36 -17
  99. package/lib/core/common/TempSignatureCanonicalizer.d.ts +82 -0
  100. package/lib/core/common/TempSignatureCanonicalizer.d.ts.map +1 -0
  101. package/lib/core/common/TempSignatureCanonicalizer.js +177 -0
  102. package/lib/core/common/TypeInference.d.ts +24 -6
  103. package/lib/core/common/TypeInference.d.ts.map +1 -1
  104. package/lib/core/common/TypeInference.js +243 -117
  105. package/lib/core/common/ValueUtil.d.ts +2 -1
  106. package/lib/core/common/ValueUtil.d.ts.map +1 -1
  107. package/lib/core/common/ValueUtil.js +4 -1
  108. package/lib/core/graph/Cfg.d.ts.map +1 -1
  109. package/lib/core/graph/Cfg.js +21 -6
  110. package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
  111. package/lib/core/graph/builder/CfgBuilder.js +46 -33
  112. package/lib/core/graph/builder/IfBuilder.d.ts.map +1 -1
  113. package/lib/core/graph/builder/IfBuilder.js +6 -2
  114. package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -1
  115. package/lib/core/graph/builder/ViewTreeBuilder.js +6 -2
  116. package/lib/core/inference/ModelInference.d.ts +24 -4
  117. package/lib/core/inference/ModelInference.d.ts.map +1 -1
  118. package/lib/core/inference/ModelInference.js +273 -79
  119. package/lib/core/inference/ValueInference.d.ts +3 -2
  120. package/lib/core/inference/ValueInference.d.ts.map +1 -1
  121. package/lib/core/inference/ValueInference.js +90 -40
  122. package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
  123. package/lib/core/inference/abc/AbcInference.js +28 -15
  124. package/lib/core/inference/arkts/ArkTsInference.d.ts +9 -3
  125. package/lib/core/inference/arkts/ArkTsInference.d.ts.map +1 -1
  126. package/lib/core/inference/arkts/ArkTsInference.js +54 -16
  127. package/lib/core/model/ArkClass.d.ts +192 -18
  128. package/lib/core/model/ArkClass.d.ts.map +1 -1
  129. package/lib/core/model/ArkClass.js +852 -122
  130. package/lib/core/model/ArkExport.d.ts.map +1 -1
  131. package/lib/core/model/ArkExport.js +1 -2
  132. package/lib/core/model/ArkField.d.ts +34 -2
  133. package/lib/core/model/ArkField.d.ts.map +1 -1
  134. package/lib/core/model/ArkField.js +89 -14
  135. package/lib/core/model/ArkFile.d.ts +72 -12
  136. package/lib/core/model/ArkFile.d.ts.map +1 -1
  137. package/lib/core/model/ArkFile.js +275 -65
  138. package/lib/core/model/ArkImport.d.ts.map +1 -1
  139. package/lib/core/model/ArkImport.js +1 -2
  140. package/lib/core/model/ArkMethod.d.ts +101 -15
  141. package/lib/core/model/ArkMethod.d.ts.map +1 -1
  142. package/lib/core/model/ArkMethod.js +252 -39
  143. package/lib/core/model/ArkModule.d.ts +1 -1
  144. package/lib/core/model/ArkModule.js +1 -1
  145. package/lib/core/model/ArkNamespace.d.ts +80 -10
  146. package/lib/core/model/ArkNamespace.d.ts.map +1 -1
  147. package/lib/core/model/ArkNamespace.js +309 -76
  148. package/lib/core/model/ArkSignature.d.ts +242 -18
  149. package/lib/core/model/ArkSignature.d.ts.map +1 -1
  150. package/lib/core/model/ArkSignature.js +725 -95
  151. package/lib/core/model/builder/ArkClassBuilder.d.ts +6 -3
  152. package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
  153. package/lib/core/model/builder/ArkClassBuilder.js +119 -73
  154. package/lib/core/model/builder/ArkExportBuilder.d.ts +1 -1
  155. package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -1
  156. package/lib/core/model/builder/ArkExportBuilder.js +1 -1
  157. package/lib/core/model/builder/ArkFieldBuilder.d.ts +0 -2
  158. package/lib/core/model/builder/ArkFieldBuilder.d.ts.map +1 -1
  159. package/lib/core/model/builder/ArkFieldBuilder.js +9 -43
  160. package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -1
  161. package/lib/core/model/builder/ArkFileBuilder.js +32 -33
  162. package/lib/core/model/builder/ArkMethodBuilder.d.ts +10 -3
  163. package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
  164. package/lib/core/model/builder/ArkMethodBuilder.js +40 -26
  165. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +3 -2
  166. package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
  167. package/lib/core/model/builder/ArkNamespaceBuilder.js +45 -77
  168. package/lib/core/model/builder/ArkSignatureBuilder.d.ts +9 -0
  169. package/lib/core/model/builder/ArkSignatureBuilder.d.ts.map +1 -1
  170. package/lib/core/model/builder/ArkSignatureBuilder.js +26 -3
  171. package/lib/core/model/builder/BodyBuilder.d.ts +1 -0
  172. package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
  173. package/lib/core/model/builder/BodyBuilder.js +37 -11
  174. package/lib/core/model/builder/builderUtils.d.ts +11 -1
  175. package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
  176. package/lib/core/model/builder/builderUtils.js +124 -90
  177. package/lib/frontend/FrontendBuilder.d.ts +10 -6
  178. package/lib/frontend/FrontendBuilder.d.ts.map +1 -1
  179. package/lib/frontend/FrontendBuilder.js +19 -45
  180. package/lib/frontend/ModuleScene.d.ts +43 -0
  181. package/lib/frontend/ModuleScene.d.ts.map +1 -0
  182. package/lib/frontend/ModuleScene.js +143 -0
  183. package/lib/frontend/SceneBuildStage.d.ts +15 -0
  184. package/lib/frontend/SceneBuildStage.d.ts.map +1 -0
  185. package/lib/frontend/SceneBuildStage.js +32 -0
  186. package/lib/frontend/SceneBuilder.d.ts +153 -0
  187. package/lib/frontend/SceneBuilder.d.ts.map +1 -0
  188. package/lib/frontend/SceneBuilder.js +859 -0
  189. package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts +0 -2
  190. package/lib/frontend/arktsFrontend/ArktsFrontend.d.ts.map +1 -1
  191. package/lib/frontend/arktsFrontend/ArktsFrontend.js +0 -18
  192. package/lib/frontend/arktsFrontend/FileBodyRemount.d.ts +17 -0
  193. package/lib/frontend/arktsFrontend/FileBodyRemount.d.ts.map +1 -0
  194. package/lib/frontend/arktsFrontend/FileBodyRemount.js +187 -0
  195. package/lib/frontend/common/ModuleBuilder.d.ts +4 -2
  196. package/lib/frontend/common/ModuleBuilder.d.ts.map +1 -1
  197. package/lib/frontend/common/ModuleBuilder.js +19 -9
  198. package/lib/frontend/cppFrontend/CppFrontend.d.ts +0 -6
  199. package/lib/frontend/cppFrontend/CppFrontend.d.ts.map +1 -1
  200. package/lib/frontend/cppFrontend/CppFrontend.js +0 -56
  201. package/lib/frontend/cppFrontend/base/Type.d.ts +7 -0
  202. package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -1
  203. package/lib/frontend/cppFrontend/base/Type.js +29 -0
  204. package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -1
  205. package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +56 -56
  206. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +1 -1
  207. package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -1
  208. package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +124 -113
  209. package/lib/frontend/cppFrontend/common/Builtin.d.ts +29 -19
  210. package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -1
  211. package/lib/frontend/cppFrontend/common/Builtin.js +56 -35
  212. package/lib/frontend/cppFrontend/common/IRInference.d.ts +7 -2
  213. package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -1
  214. package/lib/frontend/cppFrontend/common/IRInference.js +61 -28
  215. package/lib/frontend/cppFrontend/common/IRUtils.d.ts +1 -0
  216. package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -1
  217. package/lib/frontend/cppFrontend/common/IRUtils.js +22 -10
  218. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +19 -0
  219. package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -1
  220. package/lib/frontend/cppFrontend/common/ModelUtils.js +84 -3
  221. package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -1
  222. package/lib/frontend/cppFrontend/common/TypeInference.js +44 -54
  223. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -1
  224. package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +2 -1
  225. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +1 -1
  226. package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -1
  227. package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -1
  228. package/lib/frontend/cppFrontend/inference/CxxValueInference.js +41 -5
  229. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -1
  230. package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +18 -28
  231. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -1
  232. package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +2 -3
  233. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +2 -2
  234. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -1
  235. package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +31 -24
  236. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -1
  237. package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +10 -16
  238. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +0 -2
  239. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
  240. package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +19 -37
  241. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +1 -0
  242. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -1
  243. package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +30 -3
  244. package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -1
  245. package/lib/frontend/cppFrontend/model/builder/builderUtils.js +8 -4
  246. package/lib/index.d.ts +3 -0
  247. package/lib/index.d.ts.map +1 -1
  248. package/lib/index.js +10 -2
  249. package/lib/save/json/JsonSerialization.js +2 -2
  250. package/lib/save/source/SourceStmt.js +1 -1
  251. package/lib/save/source/SourceTransformer.d.ts.map +1 -1
  252. package/lib/save/source/SourceTransformer.js +0 -9
  253. package/lib/statistics/StageStatistics.d.ts +195 -0
  254. package/lib/statistics/StageStatistics.d.ts.map +1 -0
  255. package/lib/statistics/StageStatistics.js +346 -0
  256. package/lib/statistics/StageStatisticsReporter.d.ts +58 -0
  257. package/lib/statistics/StageStatisticsReporter.d.ts.map +1 -0
  258. package/lib/statistics/StageStatisticsReporter.js +255 -0
  259. package/lib/utils/Canonicalizer.d.ts +9 -2
  260. package/lib/utils/Canonicalizer.d.ts.map +1 -1
  261. package/lib/utils/Canonicalizer.js +19 -2
  262. package/lib/utils/CxxSceneUtils.d.ts +7 -0
  263. package/lib/utils/CxxSceneUtils.d.ts.map +1 -1
  264. package/lib/utils/CxxSceneUtils.js +10 -1
  265. package/lib/utils/FileUtils.d.ts +0 -1
  266. package/lib/utils/FileUtils.d.ts.map +1 -1
  267. package/lib/utils/FileUtils.js +1 -9
  268. package/lib/utils/HashUtils.d.ts +9 -0
  269. package/lib/utils/HashUtils.d.ts.map +1 -0
  270. package/lib/utils/HashUtils.js +65 -0
  271. package/lib/utils/ModuleUtils.d.ts.map +1 -1
  272. package/lib/utils/ModuleUtils.js +24 -5
  273. package/lib/utils/VisitedSegment.d.ts +23 -0
  274. package/lib/utils/VisitedSegment.d.ts.map +1 -0
  275. package/lib/utils/VisitedSegment.js +64 -0
  276. package/lib/utils/callGraphUtils.d.ts.map +1 -1
  277. package/lib/utils/callGraphUtils.js +7 -7
  278. package/lib/utils/getAllFiles.d.ts.map +1 -1
  279. package/lib/utils/getAllFiles.js +11 -8
  280. package/lib/utils/logger.d.ts +4 -0
  281. package/lib/utils/logger.d.ts.map +1 -1
  282. package/lib/utils/logger.js +16 -0
  283. package/lib/utils/parseArkSourceFile.d.ts +33 -0
  284. package/lib/utils/parseArkSourceFile.d.ts.map +1 -0
  285. package/lib/utils/parseArkSourceFile.js +131 -0
  286. package/package.json +1 -1
  287. package/lib/node_modules/ohos-typescript/README.OpenSource +0 -11
  288. package/lib/node_modules/ohos-typescript/README.md +0 -81
  289. package/lib/node_modules/ohos-typescript/SECURITY.md +0 -41
  290. package/lib/node_modules/ohos-typescript/ThirdPartyNoticeText.txt +0 -193
  291. package/lib/node_modules/ohos-typescript/bin/tsc +0 -2
  292. package/lib/node_modules/ohos-typescript/bin/tsserver +0 -2
  293. package/lib/node_modules/ohos-typescript/lib/README.md +0 -5
  294. package/lib/node_modules/ohos-typescript/lib/cancellationToken.js +0 -86
  295. package/lib/node_modules/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -1880
  296. package/lib/node_modules/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -1880
  297. package/lib/node_modules/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -1880
  298. package/lib/node_modules/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -1880
  299. package/lib/node_modules/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -1880
  300. package/lib/node_modules/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -1880
  301. package/lib/node_modules/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -1880
  302. package/lib/node_modules/ohos-typescript/lib/lib.dom.d.ts +0 -18505
  303. package/lib/node_modules/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -341
  304. package/lib/node_modules/ohos-typescript/lib/lib.scripthost.d.ts +0 -327
  305. package/lib/node_modules/ohos-typescript/lib/lib.webworker.d.ts +0 -6192
  306. package/lib/node_modules/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -26
  307. package/lib/node_modules/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -175
  308. package/lib/node_modules/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -1880
  309. package/lib/node_modules/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -1880
  310. package/lib/node_modules/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -1880
  311. package/lib/node_modules/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -1880
  312. package/lib/node_modules/ohos-typescript/lib/tsc.js +0 -114551
  313. package/lib/node_modules/ohos-typescript/lib/tsserver.js +0 -179691
  314. package/lib/node_modules/ohos-typescript/lib/tsserverlibrary.d.ts +0 -13648
  315. package/lib/node_modules/ohos-typescript/lib/tsserverlibrary.js +0 -178688
  316. package/lib/node_modules/ohos-typescript/lib/typesMap.json +0 -497
  317. package/lib/node_modules/ohos-typescript/lib/typingsInstaller.js +0 -39871
  318. package/lib/node_modules/ohos-typescript/lib/watchGuard.js +0 -49
  319. package/lib/node_modules/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -1880
  320. package/lib/node_modules/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -1880
  321. package/lib/utils/DependenciesSort.d.ts +0 -3
  322. package/lib/utils/DependenciesSort.d.ts.map +0 -1
  323. package/lib/utils/DependenciesSort.js +0 -72
  324. package/lib/utils/crypto_utils.d.ts +0 -6
  325. package/lib/utils/crypto_utils.d.ts.map +0 -1
  326. package/lib/utils/crypto_utils.js +0 -57
@@ -46,6 +46,7 @@ var InstanceInvokeExprInference_1;
46
46
  Object.defineProperty(exports, "__esModule", { value: true });
47
47
  exports.LocalInference = exports.ArkCastExprInference = exports.ArkInstanceOfExprInference = exports.ArkConditionExprInference = exports.ArkNormalBinOpExprInference = exports.ArkNewArrayExprInference = exports.ArkNewExprInference = exports.ArkPtrInvokeExprInference = exports.StaticInvokeExprInference = exports.InstanceInvokeExprInference = exports.StaticFieldRefInference = exports.FieldRefInference = exports.ClosureFieldRefInference = exports.ParameterRefInference = exports.ValueInference = exports.Bind = exports.valueCtors = exports.InferLanguage = void 0;
48
48
  const Stmt_1 = require("../base/Stmt");
49
+ const SdkUtils_1 = require("../common/SdkUtils");
49
50
  const Type_1 = require("../base/Type");
50
51
  const TypeInference_1 = require("../common/TypeInference");
51
52
  const IRInference_1 = require("../common/IRInference");
@@ -189,7 +190,9 @@ let ClosureFieldRefInference = class ClosureFieldRefInference extends ValueInfer
189
190
  var _a;
190
191
  const type = value.getBase().getType();
191
192
  if (type instanceof Type_1.LexicalEnvType) {
192
- let newType = (_a = type.getClosures().find(c => c.getName() === value.getFieldName())) === null || _a === void 0 ? void 0 : _a.getType();
193
+ let newType = (_a = type
194
+ .getClosures()
195
+ .find(c => c.getName() === value.getFieldName())) === null || _a === void 0 ? void 0 : _a.getType();
193
196
  if (newType && !TypeInference_1.TypeInference.isUnclearType(newType)) {
194
197
  value.setType(newType);
195
198
  }
@@ -213,8 +216,9 @@ let FieldRefInference = class FieldRefInference extends ValueInference {
213
216
  * @returns {boolean} True if pre-inference should be performed, false otherwise
214
217
  */
215
218
  preInfer(value, stmt) {
216
- return IRInference_1.IRInference.needInfer(value.getFieldSignature().getDeclaringSignature().getDeclaringFileSignature()) ||
217
- TypeInference_1.TypeInference.isUnclearType(value.getType()) || value.getFieldSignature().isStatic();
219
+ return (IRInference_1.IRInference.needInfer(value.getFieldSignature().getDeclaringSignature().getDeclaringFileSignature()) ||
220
+ TypeInference_1.TypeInference.isUnclearType(value.getType()) ||
221
+ value.getFieldSignature().isStatic());
218
222
  }
219
223
  /**
220
224
  * Performs inference on a field reference within the context of a statement
@@ -248,8 +252,7 @@ let StaticFieldRefInference = class StaticFieldRefInference extends ValueInferen
248
252
  * @returns {boolean} True if pre-inference should be performed, false otherwise
249
253
  */
250
254
  preInfer(value, stmt) {
251
- return IRInference_1.IRInference.needInfer(value.getFieldSignature().getDeclaringSignature().getDeclaringFileSignature()) ||
252
- TypeInference_1.TypeInference.isUnclearType(value.getType());
255
+ return (IRInference_1.IRInference.needInfer(value.getFieldSignature().getDeclaringSignature().getDeclaringFileSignature()) || TypeInference_1.TypeInference.isUnclearType(value.getType()));
253
256
  }
254
257
  /**
255
258
  * Performs inference on a static field reference within the context of a statement
@@ -262,12 +265,14 @@ let StaticFieldRefInference = class StaticFieldRefInference extends ValueInferen
262
265
  const baseSignature = value.getFieldSignature().getDeclaringSignature();
263
266
  const baseName = baseSignature instanceof ArkSignature_1.ClassSignature ? baseSignature.getClassName() : baseSignature.getNamespaceName();
264
267
  const arkMethod = stmt.getCfg().getDeclaringMethod();
265
- const baseType = TypeInference_1.TypeInference.inferBaseType(baseName, arkMethod.getDeclaringArkClass());
266
- if (!baseType) {
267
- return undefined;
268
+ // Multi-candidate probing: same-name global entities are probed in order until the member resolves.
269
+ for (const baseType of TypeInference_1.TypeInference.inferBaseTypes(baseName, arkMethod.getDeclaringArkClass())) {
270
+ const result = IRInference_1.IRInference.inferInstanceMember(baseType, value, arkMethod, IRInference_1.IRInference.updateRefSignature);
271
+ if (result) {
272
+ return result === value ? undefined : result;
273
+ }
268
274
  }
269
- const result = IRInference_1.IRInference.inferInstanceMember(baseType, value, arkMethod, IRInference_1.IRInference.updateRefSignature);
270
- return !result || result === value ? undefined : result;
275
+ return undefined;
271
276
  }
272
277
  };
273
278
  StaticFieldRefInference = __decorate([
@@ -286,8 +291,8 @@ let InstanceInvokeExprInference = InstanceInvokeExprInference_1 = class Instance
286
291
  * @returns {boolean} True if pre-inference should be performed, false otherwise
287
292
  */
288
293
  preInfer(value, stmt) {
289
- return IRInference_1.IRInference.needInfer(value.getMethodSignature().getDeclaringClassSignature().getDeclaringFileSignature()) ||
290
- TypeInference_1.TypeInference.isUnclearType(value.getType());
294
+ return (IRInference_1.IRInference.needInfer(value.getMethodSignature().getDeclaringClassSignature().getDeclaringFileSignature()) ||
295
+ TypeInference_1.TypeInference.isUnclearType(value.getType()));
291
296
  }
292
297
  /**
293
298
  * Performs inference on an instance invocation expression within the context of a statement
@@ -300,24 +305,24 @@ let InstanceInvokeExprInference = InstanceInvokeExprInference_1 = class Instance
300
305
  const arkMethod = stmt.getCfg().getDeclaringMethod();
301
306
  const baseType = TypeInference_1.TypeInference.inferRefinedValueType(value.getBase(), arkMethod.getDeclaringArkFile().getScene());
302
307
  const result = IRInference_1.IRInference.inferInstanceMember(baseType, value, arkMethod, InstanceInvokeExprInference_1.inferInvokeExpr);
308
+ if (result === value) {
309
+ // isStatic 形态升级防御:签名已解析为 static 但 expr 停留 instance 形态的残余在此收敛——正常升级依赖 inferInvokeExpr 族返回替换 expr
310
+ // (invokeMatchedMethod 的 isStatic 分支),物化跟随/推导短路等场景可能就地 set 了 static 签名却未换形态(OperandOriginalPositions 实证)。
311
+ // base 为 super 时保持 instance(super.staticM() 的 postInfer base 替换语义优先,staticinvoke 丢弃 receiver 虽语义等价但保守排除)。
312
+ const sig = value.getMethodSignature();
313
+ if (sig.getMethodSubSignature().isStatic() && value.getBase().getName() !== TSConst_1.SUPER_NAME) {
314
+ return new Expr_1.ArkStaticInvokeExpr(sig, value.getArgs(), value.getRealGenericTypes(), value.getSpreadFlags());
315
+ }
316
+ }
303
317
  return !result || result === value ? undefined : result;
304
318
  }
305
319
  /**
306
320
  * Performs post-inference processing on invocation expressions
307
- * Handles special case for super() calls by replacing the base with 'this' local
308
321
  * @param {ArkInstanceInvokeExpr} value - The original invocation expression
309
322
  * @param {Value} newValue - The new value after inference
310
- * @param {Stmt} stmt - The statement containing the invocation
323
+ * @param {Stmt} stmt - The statement containing the expression
311
324
  */
312
325
  postInfer(value, newValue, stmt) {
313
- var _a;
314
- if (value instanceof Expr_1.ArkInstanceInvokeExpr && value.getBase().getName() === TSConst_1.SUPER_NAME) {
315
- const thisLocal = (_a = stmt.getCfg().getDeclaringMethod().getBody()) === null || _a === void 0 ? void 0 : _a.getLocals().get(TSConst_1.THIS_NAME);
316
- if (thisLocal) {
317
- value.setBase(thisLocal);
318
- thisLocal.addUsedStmt(stmt);
319
- }
320
- }
321
326
  super.postInfer(value, newValue, stmt);
322
327
  }
323
328
  getMethodName(expr, arkMethod) {
@@ -327,7 +332,7 @@ let InstanceInvokeExprInference = InstanceInvokeExprInference_1 = class Instance
327
332
  const methodName = expr.getMethodSignature().getMethodSubSignature().getMethodName();
328
333
  const scene = arkMethod.getDeclaringArkFile().getScene();
329
334
  if (baseType instanceof Type_1.ArrayType || baseType instanceof Type_1.TupleType) {
330
- const arrayInterface = scene.getSdkGlobal(Builtin_1.Builtin.ARRAY);
335
+ const arrayInterface = SdkUtils_1.SdkUtils.getSdkGlobal(Builtin_1.Builtin.ARRAY);
331
336
  const realTypes = baseType instanceof Type_1.ArrayType ? [baseType.getBaseType()] : undefined;
332
337
  if (arrayInterface instanceof ArkClass_1.ArkClass) {
333
338
  baseType = new Type_1.ClassType(arrayInterface.getSignature(), realTypes);
@@ -345,7 +350,8 @@ let InstanceInvokeExprInference = InstanceInvokeExprInference_1 = class Instance
345
350
  else if (baseType instanceof Type_1.AnnotationNamespaceType) {
346
351
  const namespace = scene.getNamespace(baseType.getNamespaceSignature());
347
352
  if (namespace) {
348
- const foundMethod = ModelUtils_1.ModelUtils.findPropertyInNamespace(methodName, namespace);
353
+ // 多实体探测:跨文件同名 ns(Intl 系)的后续文件实体持有该文件声明的成员
354
+ const foundMethod = ModelUtils_1.ModelUtils.findPropertyInNamespaces(methodName, namespace);
349
355
  if (foundMethod instanceof ArkMethod_1.ArkMethod) {
350
356
  let signature = foundMethod.matchMethodSignature(expr.getArgs());
351
357
  TypeInference_1.TypeInference.inferSignatureReturnType(signature, foundMethod);
@@ -391,12 +397,21 @@ let StaticInvokeExprInference = class StaticInvokeExprInference extends Instance
391
397
  }
392
398
  return undefined;
393
399
  }
394
- const baseType = this.getBaseType(expr, arkMethod);
395
- const result = baseType ? IRInference_1.IRInference.inferInstanceMember(baseType, expr, arkMethod, InstanceInvokeExprInference.inferInvokeExpr) :
396
- (arkMethod.getDeclaringArkFile().getLanguage() === ArkFile_1.Language.CXX ?
397
- IRInference_2.IRInference.inferStaticInvokeExprByMethodName(methodName, arkMethod, expr) :
398
- IRInference_1.IRInference.inferStaticInvokeExprByMethodName(methodName, arkMethod, expr));
399
- return !result || result === expr ? undefined : result;
400
+ // Multi-candidate probing: same-name global entities are probed in order until the invoke resolves;
401
+ // the by-name fallback chain runs only when no candidate exists at all.
402
+ const baseTypes = this.getBaseTypes(expr, arkMethod);
403
+ if (baseTypes.length > 0) {
404
+ for (const baseType of baseTypes) {
405
+ const result = IRInference_1.IRInference.inferInstanceMember(baseType, expr, arkMethod, InstanceInvokeExprInference.inferInvokeExpr);
406
+ if (result) {
407
+ return result === expr ? undefined : result;
408
+ }
409
+ }
410
+ return undefined;
411
+ }
412
+ return arkMethod.getDeclaringArkFile().getLanguage() === ArkFile_1.Language.CXX
413
+ ? IRInference_2.IRInference.inferStaticInvokeExprByMethodName(methodName, arkMethod, expr)
414
+ : IRInference_1.IRInference.inferStaticInvokeExprByMethodName(methodName, arkMethod, expr);
400
415
  }
401
416
  getBaseType(expr, arkMethod) {
402
417
  const className = expr.getMethodSignature().getDeclaringClassSignature().getClassName();
@@ -405,6 +420,14 @@ let StaticInvokeExprInference = class StaticInvokeExprInference extends Instance
405
420
  }
406
421
  return null;
407
422
  }
423
+ /** Multi-candidate variant of {@link getBaseType} (same-name global entities expanded). */
424
+ getBaseTypes(expr, arkMethod) {
425
+ const className = expr.getMethodSignature().getDeclaringClassSignature().getClassName();
426
+ if (className && className !== Const_1.UNKNOWN_CLASS_NAME) {
427
+ return TypeInference_1.TypeInference.inferBaseTypes(className, arkMethod.getDeclaringArkClass());
428
+ }
429
+ return [];
430
+ }
408
431
  };
409
432
  StaticInvokeExprInference = __decorate([
410
433
  Bind()
@@ -457,12 +480,20 @@ let ArkNewExprInference = class ArkNewExprInference extends ValueInference {
457
480
  return IRInference_1.IRInference.needInfer(value.getClassType().getClassSignature().getDeclaringFileSignature());
458
481
  }
459
482
  infer(value, stmt) {
460
- var _a;
483
+ var _a, _b, _c;
461
484
  const className = value.getClassType().getClassSignature().getClassName();
462
485
  const arkMethod = stmt.getCfg().getDeclaringMethod();
463
- let type = (_a = ModelUtils_1.ModelUtils.findDeclaredLocal(new Local_1.Local(className), arkMethod, 1)) === null || _a === void 0 ? void 0 : _a.getType();
486
+ let type = ModelUtils_1.ModelUtils.findDeclaredLocalType(className, arkMethod, 1);
487
+ if (TypeInference_1.TypeInference.isUnclearType(type)) {
488
+ // Deterministic local-class resolution along the method scope chain before
489
+ // the file-level fuzzy name search.
490
+ const localClass = ModelUtils_1.ModelUtils.findLocalClassInMethodChain(className, arkMethod);
491
+ if (localClass) {
492
+ type = new Type_1.ClassType(localClass.getSignature());
493
+ }
494
+ }
464
495
  if (TypeInference_1.TypeInference.isUnclearType(type)) {
465
- type = TypeInference_1.TypeInference.inferUnclearRefName(className, arkMethod.getDeclaringArkClass());
496
+ type = TypeInference_1.TypeInference.inferUnclearRefName(className, arkMethod.getDeclaringArkClass(), arkMethod);
466
497
  }
467
498
  if (type instanceof Type_1.AliasType) {
468
499
  const originType = TypeInference_1.TypeInference.replaceAliasType(type);
@@ -473,10 +504,27 @@ let ArkNewExprInference = class ArkNewExprInference extends ValueInference {
473
504
  type = originType;
474
505
  }
475
506
  }
476
- if (type && type instanceof Type_1.ClassType) {
477
- value.getClassType().setClassSignature(type.getClassSignature());
478
- TypeInference_1.TypeInference.inferRealGenericTypes(value.getClassType().getRealGenericTypes(), arkMethod.getDeclaringArkClass());
507
+ if (!(type instanceof Type_1.ClassType)) {
508
+ return undefined;
509
+ }
510
+ // 构造器对象升级:type 解析为构造器持有类(ns 内 declare const 的 %AC 字面量类——如 Intl.NumberFormat,或顶层 Constructor interface)时,
511
+ // `new` 的实例类型 = construct-signature(或 call)返回类型——对齐 Expr.ArkNewExpr.inferType 的 constructorSignature 升级链。
512
+ // 顶层场景原靠后续赋值传播兜底(%0 初始 unclear 可覆盖);
513
+ // ns 内 %AC 场景类型构建期已明确,narrowing 哲学下传播不覆盖,必须在此显式升级。
514
+ const scene = arkMethod.getDeclaringArkFile().getScene();
515
+ let instanceType = type;
516
+ const typeClass = scene.getClass(type.getClassSignature());
517
+ if (typeClass) {
518
+ const ctorReturn = (_b = (_a = typeClass.getMethodWithName(Const_1.CONSTRUCT_SIGNATURE_NAME)) === null || _a === void 0 ? void 0 : _a.getReturnType()) !== null && _b !== void 0 ? _b : (_c = typeClass.getMethodWithName(Const_1.CALL_SIGNATURE_NAME)) === null || _c === void 0 ? void 0 : _c.getReturnType();
519
+ if (ctorReturn) {
520
+ const replaced = TypeInference_1.TypeInference.replaceAliasType(ctorReturn);
521
+ if (replaced instanceof Type_1.ClassType) {
522
+ instanceType = replaced;
523
+ }
524
+ }
479
525
  }
526
+ value.getClassType().setClassSignature(instanceType.getClassSignature());
527
+ TypeInference_1.TypeInference.inferRealGenericTypes(value.getClassType().getRealGenericTypes(), arkMethod.getDeclaringArkClass());
480
528
  return undefined;
481
529
  }
482
530
  };
@@ -645,12 +693,14 @@ let LocalInference = class LocalInference extends ValueInference {
645
693
  return 'Local';
646
694
  }
647
695
  preInfer(value) {
648
- return TypeInference_1.TypeInference.isUnclearType(value.getType());
696
+ const type = value.getType();
697
+ return TypeInference_1.TypeInference.isUnclearType(type) || type instanceof Type_1.UndefinedType || type instanceof Type_1.NullType;
649
698
  }
650
699
  infer(value, stmt) {
651
- var _a, _b;
700
+ var _a;
652
701
  const name = value.getName();
653
- const arkClass = stmt.getCfg().getDeclaringMethod().getDeclaringArkClass();
702
+ const arkMethod = stmt.getCfg().getDeclaringMethod();
703
+ const arkClass = arkMethod.getDeclaringArkClass();
654
704
  // Special handling for 'this' reference - set to current class type
655
705
  if (name === TSConst_1.THIS_NAME) {
656
706
  value.setType(new Type_1.ClassType(arkClass.getSignature(), arkClass.getRealTypes()));
@@ -659,7 +709,7 @@ let LocalInference = class LocalInference extends ValueInference {
659
709
  let newType;
660
710
  // Skip temporary variables (those with name prefix) and look for declared locals
661
711
  if (!name.startsWith(Const_1.NAME_PREFIX)) {
662
- newType = (_b = (_a = ModelUtils_1.ModelUtils.findDeclaredLocal(value, stmt.getCfg().getDeclaringMethod(), 1)) === null || _a === void 0 ? void 0 : _a.getType()) !== null && _b !== void 0 ? _b : TypeInference_1.TypeInference.inferBaseType(name, arkClass);
712
+ newType = (_a = ModelUtils_1.ModelUtils.findDeclaredLocalType(name, arkMethod, 1)) !== null && _a !== void 0 ? _a : TypeInference_1.TypeInference.inferBaseType(name, arkClass);
663
713
  }
664
714
  if (newType) {
665
715
  value.setType(newType);
@@ -1 +1 @@
1
- {"version":3,"file":"AbcInference.d.ts","sourceRoot":"","sources":["../../../../src/core/inference/abc/AbcInference.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGxF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAQlD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAQ,iBAAiB,EAAiB,2BAA2B,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxH,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAGzC,OAAO,EAEH,qBAAqB,EACrB,mBAAmB,EAGtB,MAAM,gBAAgB,CAAC;AAIxB,OAAO,EAAsB,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AA+B5E,qBAAa,kBAAmB,SAAQ,eAAe;IAE5C,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAQ3C,OAAO,CAAC,kCAAkC;CA8B7C;AA6ED,qBAAa,mBAAoB,SAAQ,gBAAgB;IAE9C,wBAAwB,IAAI,mBAAmB;IAI/C,oBAAoB,IAAI,eAAe;IAIvC,kBAAkB,IAAI,aAAa;CAK7C;AAED,qBACa,oBAAqB,SAAQ,iBAAiB;IAChD,YAAY,IAAI,MAAM;IAItB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO;IAgBzD,KAAK,CAAC,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS;CAmB1E;AAED,qBACa,8BAA+B,SAAQ,2BAA2B;IAC3E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAa;IAE5C;;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AI,eAAe;IAIvC,kBAAkB,IAAI,aAAa;CAK7C;AAED,qBACa,oBAAqB,SAAQ,iBAAiB;IAChD,YAAY,IAAI,MAAM;IAItB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO;IAgBzD,KAAK,CAAC,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS;CAmB1E;AAED,qBACa,8BAA+B,SAAQ,2BAA2B;IAC3E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAa;IAE5C;;;;;;OAMG;IACI,KAAK,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS;IASzE;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;CAkB5B;AAED,qBACa,wBAAyB,SAAQ,cAAc,CAAC,qBAAqB,CAAC;IAC/E,OAAO,CAAC,MAAM,CAAC,UAAU,CAA0B;IAE5C,YAAY,IAAI,MAAM;IAItB,QAAQ,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO;IAI3D,KAAK,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS;CA4B5E"}
@@ -168,8 +168,8 @@ class AbcStmtInference extends ModelInference_1.StmtInference {
168
168
  target.setType(srcType);
169
169
  return target.getUsedStmts();
170
170
  }
171
- else if (target instanceof Ref_1.AbstractFieldRef && projectName === target.getFieldSignature().getDeclaringSignature()
172
- .getDeclaringFileSignature().getProjectName()) {
171
+ else if (target instanceof Ref_1.AbstractFieldRef &&
172
+ projectName === target.getFieldSignature().getDeclaringSignature().getDeclaringFileSignature().getProjectName()) {
173
173
  target.getFieldSignature().setType(srcType);
174
174
  }
175
175
  else if (target instanceof Ref_1.ArkParameterRef) {
@@ -220,12 +220,12 @@ let AbcFieldRefInference = class AbcFieldRefInference extends ValueInference_1.F
220
220
  if (signature instanceof ArkSignature_1.ClassSignature && signature.getDeclaringFileSignature().getProjectName() === scene.getProjectName()) {
221
221
  const cls = scene.getClass(signature);
222
222
  if (cls) {
223
- const field = new ArkField_1.ArkField();
224
- field.setDeclaringArkClass(cls);
225
- const fieldSignature = new ArkSignature_1.FieldSignature(value.getFieldSignature().getFieldName(), cls.getSignature(), Type_1.UnknownType.getInstance());
223
+ const field = new ArkField_1.ArkField(cls.getClassSigID());
224
+ const fieldSignature = new ArkSignature_1.FieldSignature(value.getFieldSignature().getFieldName(), cls.getClassSigID(), Type_1.UnknownType.getInstance());
226
225
  field.setSignature(fieldSignature);
227
226
  cls.addField(field);
228
- value.setFieldSignature(fieldSignature);
227
+ // 终点确定,graduateToFormal 直达。
228
+ value.graduateToFormal(field.getFieldSigID());
229
229
  }
230
230
  }
231
231
  }
@@ -260,7 +260,7 @@ let AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference_1 = class Ab
260
260
  var _a, _b;
261
261
  if (value.getBase().getName() === AbcInstanceInvokeExprInference_1.CONTEXT) {
262
262
  const scene = arkMethod.getDeclaringArkFile().getScene();
263
- const signature = (_a = scene.getSdkGlobal(AbcInstanceInvokeExprInference_1.CONTEXT)) === null || _a === void 0 ? void 0 : _a.getSignature();
263
+ const signature = (_a = SdkUtils_1.SdkUtils.getSdkGlobal(AbcInstanceInvokeExprInference_1.CONTEXT)) === null || _a === void 0 ? void 0 : _a.getSignature();
264
264
  if (signature instanceof ArkSignature_1.AliasTypeSignature) {
265
265
  const cls = (_b = scene.getMethod(signature.getDeclaringMethodSignature())) === null || _b === void 0 ? void 0 : _b.getDeclaringArkClass();
266
266
  if (cls) {
@@ -284,16 +284,29 @@ let AbcExceptionRefInference = AbcExceptionRefInference_1 = class AbcExceptionRe
284
284
  return TypeInference_1.TypeInference.isUnclearType(value.getType());
285
285
  }
286
286
  infer(value, stmt) {
287
- var _a;
288
- if (!AbcExceptionRefInference_1.ERROR_TYPE) {
289
- const scene = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getScene();
290
- const err = (_a = scene.getSdkArkFiles().find(e => e.getName().endsWith(EtsConst_1.OHOS_BASE_FILE))) === null || _a === void 0 ? void 0 : _a.getClassWithName(EtsConst_1.BUSINESS_ERROR);
291
- if (err instanceof ArkClass_1.ArkClass) {
292
- AbcExceptionRefInference_1.ERROR_TYPE = new Type_1.ClassType(err.getSignature(), err.getGenericsTypes());
293
- value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
287
+ if (AbcExceptionRefInference_1.ERROR_TYPE) {
288
+ value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
289
+ return undefined;
290
+ }
291
+ const scene = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getScene();
292
+ const errFile = scene.getSdkArkFiles().find(e => e.getName().endsWith(EtsConst_1.OHOS_BASE_FILE));
293
+ if (!errFile) {
294
+ return undefined;
295
+ }
296
+ // 签名直查:file 顶层 → 各 namespace(与 getClassWithName 的递归顺序一致),
297
+ // 免线性扫描与前缀模糊匹配
298
+ let err = null;
299
+ err = errFile.getClass(new ArkSignature_1.ClassSignature(EtsConst_1.BUSINESS_ERROR, errFile.getFileSigID()));
300
+ if (!err) {
301
+ for (const ns of errFile.getAllNamespacesUnderThisFile()) {
302
+ err = ns.getClass(new ArkSignature_1.ClassSignature(EtsConst_1.BUSINESS_ERROR, ns.getDeclaringFileID(), ns.getNamespaceSigID()));
303
+ if (err) {
304
+ break;
305
+ }
294
306
  }
295
307
  }
296
- else {
308
+ if (err instanceof ArkClass_1.ArkClass) {
309
+ AbcExceptionRefInference_1.ERROR_TYPE = new Type_1.ClassType(err.getSignature(), err.getGenericsTypes());
297
310
  value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
298
311
  }
299
312
  return undefined;
@@ -10,7 +10,7 @@ import { Local } from '../../base/Local';
10
10
  import { AliasTypeExpr, ArkInstanceInvokeExpr } from '../../base/Expr';
11
11
  export declare class ArkTsStmtInference extends StmtInference {
12
12
  constructor(valueInferences: ValueInference<Value>[]);
13
- typeSpread(stmt: Stmt, method: ArkMethod): Set<Stmt>;
13
+ typeSpread(stmt: Stmt, method: ArkMethod): Stmt[] | undefined;
14
14
  transferRight2Left(leftOp: Value, rightType: Type, method: ArkMethod): Stmt[] | undefined;
15
15
  static updateUnionType(target: Value, srcType: Type, method: ArkMethod): Stmt[] | undefined;
16
16
  static updateGlobalRef(ref: Value | null, srcType: Type): Stmt[] | undefined;
@@ -32,10 +32,16 @@ export declare class ArkTSFieldRefInference extends FieldRefInference {
32
32
  preInfer(value: ArkInstanceFieldRef, stmt: Stmt): boolean;
33
33
  /**
34
34
  * Checks if a value represents an anonymous class 'this' field reference
35
- * Identifies field references that access fields directly on 'this' in anonymous class constructors
35
+ * Identifies field references that access fields directly on 'this' in the AC's
36
+ * %instInit — the carrier of field-initializer expressions, where `this` lexically
37
+ * means the ENCLOSING this (rebound to the host class by inferThisLocal), so def-side
38
+ * member resolution against the AC would only degrade. The AC's own constructors keep
39
+ * the build-time this (ClassType(AC), see the this-semantic guards in
40
+ * ArkTSLocalInference.infer / IRInference.inferBase) and their def-side resolution
41
+ * must NOT be skipped — skipping it left build-time probe stubs permanently uncorrected.
36
42
  * @param {Value} stmtDef - The value to check (typically a field reference)
37
43
  * @param {ArkMethod} arkMethod - The method containing the value
38
- * @returns {boolean} True if the value is an anonymous class 'this' field reference
44
+ * @returns {boolean} True if the value is an anonymous class %instInit 'this' field reference
39
45
  */
40
46
  private isAnonClassThisRef;
41
47
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ArkTsInference.d.ts","sourceRoot":"","sources":["../../../../src/core/inference/arkts/ArkTsInference.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAKxG,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAA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KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO;IAOhE;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,kBAAkB;CAS7B;AAED,qBACa,gCAAiC,SAAQ,2BAA2B;IAC7E;;;;;;OAMG;IACI,KAAK,CAAC,KAAK,EAAE,qBAAqB,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS;IAUzE;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;CAS5B;AAED,qBACa,sBAAuB,SAAQ,cAAc,CAAC,aAAa,CAAC;IAC9D,YAAY,IAAI,MAAM;IAItB,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO;IAIvC,KAAK,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS;CAwCpE;AAED,qBACa,mBAAoB,SAAQ,cAAc;IAC5C,YAAY,IAAI,MAAM;IAItB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO;IAU/B,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,KAAK,GAAG,SAAS;IA4CzD,OAAO,CAAC,YAAY;CASvB"}
@@ -52,7 +52,8 @@ class ArkTsClassInference extends ModelInference_1.ClassInference {
52
52
  preInfer(arkClass) {
53
53
  super.preInfer(arkClass);
54
54
  TypeInference_1.TypeInference.inferGenericType(arkClass.getGenericsTypes(), arkClass);
55
- arkClass.getFields()
55
+ arkClass
56
+ .getFields()
56
57
  .filter(p => TypeInference_1.TypeInference.isUnclearType(p.getType()))
57
58
  .forEach(f => {
58
59
  const newType = TypeInference_1.TypeInference.inferUnclearedType(f.getType(), arkClass);
@@ -73,10 +74,13 @@ class ArkTsMethodInference extends ModelInference_1.MethodInference {
73
74
  }
74
75
  }
75
76
  inferMethodSignature(ms, arkMethod) {
76
- ms.getMethodSubSignature().getParameters().forEach(p => TypeInference_1.TypeInference.inferParameterType(p, arkMethod));
77
+ ms.getMethodSubSignature()
78
+ .getParameters()
79
+ .forEach(p => TypeInference_1.TypeInference.inferParameterType(p, arkMethod));
77
80
  TypeInference_1.TypeInference.inferSignatureReturnType(ms, arkMethod);
78
81
  }
79
82
  }
83
+ const IS_GENERIC_OR_ANY = (t) => t instanceof Type_1.GenericType || t instanceof Type_1.AnyType;
80
84
  class ArkTsStmtInference extends ModelInference_1.StmtInference {
81
85
  constructor(valueInferences) {
82
86
  super(valueInferences);
@@ -91,10 +95,20 @@ class ArkTsStmtInference extends ModelInference_1.StmtInference {
91
95
  return super.typeSpread(stmt, method);
92
96
  }
93
97
  transferRight2Left(leftOp, rightType, method) {
94
- const projectName = method.getDeclaringArkFile().getProjectName();
95
- if (!TypeInference_1.TypeInference.isUnclearType(rightType) || rightType instanceof Type_1.GenericType || TypeInference_1.TypeInference.isDummyClassType(rightType)) {
98
+ // An unclear ClassType with fully-resolved real type args still carries information
99
+ // (e.g. IterableIterator<number> stubs) and should propagate to the left operand.
100
+ const realArgs = rightType instanceof Type_1.ClassType ? rightType.getRealGenericTypes() : undefined;
101
+ let isUnclearWithRealArgs = false;
102
+ for (let i = 0; realArgs !== undefined && i < realArgs.length; i++) {
103
+ if (!(realArgs[i] instanceof Type_1.GenericType)) {
104
+ isUnclearWithRealArgs = true;
105
+ break;
106
+ }
107
+ }
108
+ const isPlaceholderRight = rightType instanceof Type_1.NullType || rightType instanceof Type_1.UndefinedType;
109
+ if ((!TypeInference_1.TypeInference.isUnclearType(rightType) && !isPlaceholderRight) || rightType instanceof Type_1.GenericType || isUnclearWithRealArgs) {
96
110
  let leftType = leftOp.getType();
97
- if (TypeInference_1.TypeInference.isTypeCanBeOverride(leftType) || TypeInference_1.TypeInference.isAnonType(leftType, projectName)) {
111
+ if (TypeInference_1.TypeInference.isTypeCanBeOverride(leftType) || TypeInference_1.TypeInference.isAnonType(leftType, method.getDeclaringArkFile().getProjectName())) {
98
112
  leftType = rightType;
99
113
  }
100
114
  if (leftOp.getType() !== leftType) {
@@ -179,17 +193,23 @@ let ArkTSFieldRefInference = class ArkTSFieldRefInference extends ValueInference
179
193
  }
180
194
  /**
181
195
  * Checks if a value represents an anonymous class 'this' field reference
182
- * Identifies field references that access fields directly on 'this' in anonymous class constructors
196
+ * Identifies field references that access fields directly on 'this' in the AC's
197
+ * %instInit — the carrier of field-initializer expressions, where `this` lexically
198
+ * means the ENCLOSING this (rebound to the host class by inferThisLocal), so def-side
199
+ * member resolution against the AC would only degrade. The AC's own constructors keep
200
+ * the build-time this (ClassType(AC), see the this-semantic guards in
201
+ * ArkTSLocalInference.infer / IRInference.inferBase) and their def-side resolution
202
+ * must NOT be skipped — skipping it left build-time probe stubs permanently uncorrected.
183
203
  * @param {Value} stmtDef - The value to check (typically a field reference)
184
204
  * @param {ArkMethod} arkMethod - The method containing the value
185
- * @returns {boolean} True if the value is an anonymous class 'this' field reference
205
+ * @returns {boolean} True if the value is an anonymous class %instInit 'this' field reference
186
206
  */
187
207
  isAnonClassThisRef(stmtDef, arkMethod) {
188
- return (arkMethod.getName() === Const_1.INSTANCE_INIT_METHOD_NAME || arkMethod.getName() === TSConst_1.CONSTRUCTOR_NAME) &&
208
+ return (arkMethod.getName() === Const_1.INSTANCE_INIT_METHOD_NAME &&
189
209
  stmtDef instanceof Ref_1.ArkInstanceFieldRef &&
190
210
  stmtDef.getBase().getName() === TSConst_1.THIS_NAME &&
191
211
  arkMethod.getDeclaringArkClass().isAnonymousClass() &&
192
- stmtDef.getFieldName().indexOf('.') === -1;
212
+ stmtDef.getFieldName().indexOf('.') === -1);
193
213
  }
194
214
  };
195
215
  ArkTSFieldRefInference = __decorate([
@@ -272,7 +292,7 @@ let AliasTypeExprInference = class AliasTypeExprInference extends ValueInference
272
292
  }
273
293
  if (type) {
274
294
  const realGenericTypes = value.getRealGenericTypes();
275
- if (TypeInference_1.TypeInference.checkType(type, t => t instanceof Type_1.GenericType || t instanceof Type_1.AnyType) && realGenericTypes && realGenericTypes.length > 0) {
295
+ if (TypeInference_1.TypeInference.checkType(type, IS_GENERIC_OR_ANY) && realGenericTypes && realGenericTypes.length > 0) {
276
296
  TypeInference_1.TypeInference.inferRealGenericTypes(realGenericTypes, arkMethod.getDeclaringArkClass());
277
297
  type = TypeInference_1.TypeInference.replaceTypeWithReal(type, realGenericTypes);
278
298
  }
@@ -294,8 +314,7 @@ let ArkTSLocalInference = class ArkTSLocalInference extends ValueInference_1.Loc
294
314
  }
295
315
  preInfer(value) {
296
316
  const type = value.getType();
297
- if (value.getName() === TSConst_1.THIS_NAME && type instanceof Type_1.ClassType &&
298
- type.getClassSignature().getClassName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX)) {
317
+ if (value.getName() === TSConst_1.THIS_NAME && type instanceof Type_1.ClassType && type.getClassSignature().getClassName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX)) {
299
318
  return true;
300
319
  }
301
320
  else if (type instanceof Type_1.FunctionType) {
@@ -310,15 +329,34 @@ let ArkTSLocalInference = class ArkTSLocalInference extends ValueInference_1.Loc
310
329
  const arkMethod = stmt.getCfg().getDeclaringMethod();
311
330
  let newType;
312
331
  if (name === TSConst_1.THIS_NAME) {
313
- newType = (_a = IRInference_1.IRInference.inferThisLocal(arkMethod)) === null || _a === void 0 ? void 0 : _a.getType();
314
- if (newType) {
315
- value.setType(newType);
332
+ // this-semantic guard: only the AC's %instInit (the carrier of field-initializer
333
+ // expressions, where `this` lexically means the ENCLOSING this at the object
334
+ // literal / class expression site — the host class) gets rebound via
335
+ // inferThisLocal. The AC's own methods (constructor, named method properties)
336
+ // keep the build-time this (ClassType(AC)) — the instance itself. Rebinding
337
+ // them to the host class breaks every `this.<memberOfAC>` resolution downstream.
338
+ const hostMethod = stmt.getCfg().getDeclaringMethod();
339
+ if (hostMethod.getName() === Const_1.INSTANCE_INIT_METHOD_NAME && hostMethod.getDeclaringArkClass().isAnonymousClass()) {
340
+ newType = (_a = IRInference_1.IRInference.inferThisLocal(hostMethod)) === null || _a === void 0 ? void 0 : _a.getType();
341
+ if (newType) {
342
+ value.setType(newType);
343
+ }
344
+ }
345
+ return undefined;
346
+ }
347
+ else if (name === TSConst_1.SUPER_NAME) {
348
+ const superType = TypeInference_1.TypeInference.inferBaseType(TSConst_1.SUPER_NAME, arkMethod.getDeclaringArkClass());
349
+ if (superType) {
350
+ value.setType(superType);
316
351
  }
317
352
  return undefined;
318
353
  }
319
354
  else if (type instanceof Type_1.FunctionType) {
320
355
  const methodSignature = type.getMethodSignature();
321
- methodSignature.getMethodSubSignature().getParameters().forEach(p => TypeInference_1.TypeInference.inferParameterType(p, arkMethod));
356
+ const parameters = methodSignature.getMethodSubSignature().getParameters();
357
+ for (let i = 0; i < parameters.length; i++) {
358
+ TypeInference_1.TypeInference.inferParameterType(parameters[i], arkMethod);
359
+ }
322
360
  TypeInference_1.TypeInference.inferSignatureReturnType(methodSignature, arkMethod);
323
361
  return undefined;
324
362
  }