arkanalyzer 1.0.86 → 1.0.88
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.
- package/README.en.md +69 -65
- package/README.md +56 -70
- package/config/arkanalyzer.json +7 -2
- package/docs/cppFrontend/ArkAnalyzer-cpp_usage_guide.md +245 -0
- package/docs/cppFrontend/cpp_frontend_build_guide.md +126 -0
- package/docs/cppFrontend/cpp_frontend_user_guide.md +175 -0
- package/docs/cppFrontend/img.png +0 -0
- package/docs/cppFrontend/img_1.png +0 -0
- package/docs/cppFrontend/img_10.png +0 -0
- package/docs/cppFrontend/img_11.png +0 -0
- package/docs/cppFrontend/img_12.png +0 -0
- package/docs/cppFrontend/img_13.png +0 -0
- package/docs/cppFrontend/img_14.png +0 -0
- package/docs/cppFrontend/img_15.png +0 -0
- package/docs/cppFrontend/img_16.png +0 -0
- package/docs/cppFrontend/img_17.png +0 -0
- package/docs/cppFrontend/img_18.png +0 -0
- package/docs/cppFrontend/img_19.png +0 -0
- package/docs/cppFrontend/img_2.png +0 -0
- package/docs/cppFrontend/img_20.png +0 -0
- package/docs/cppFrontend/img_21.png +0 -0
- package/docs/cppFrontend/img_22.png +0 -0
- package/docs/cppFrontend/img_23.png +0 -0
- package/docs/cppFrontend/img_3.png +0 -0
- package/docs/cppFrontend/img_4.png +0 -0
- package/docs/cppFrontend/img_5.png +0 -0
- package/docs/cppFrontend/img_6.png +0 -0
- package/docs/cppFrontend/img_7.png +0 -0
- package/docs/cppFrontend/img_8.png +0 -0
- package/docs/cppFrontend/img_9.png +0 -0
- package/docs/sig_programanalysis.en.md +66 -0
- package/docs/sig_programanalysis.md +73 -0
- package/lib/Config.d.ts +35 -1
- package/lib/Config.d.ts.map +1 -1
- package/lib/Config.js +91 -2
- package/lib/Scene.d.ts +25 -2
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +151 -44
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +4 -3
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/AbstractAnalysis.js +17 -17
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts +6 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +117 -14
- package/lib/callgraph/common/Statistics.d.ts +4 -2
- package/lib/callgraph/common/Statistics.d.ts.map +1 -1
- package/lib/callgraph/common/Statistics.js +14 -2
- package/lib/callgraph/model/CallGraph.d.ts +12 -8
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
- package/lib/callgraph/model/CallGraph.js +53 -29
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts +1 -0
- package/lib/callgraph/model/builder/CallGraphBuilder.d.ts.map +1 -1
- package/lib/callgraph/model/builder/CallGraphBuilder.js +5 -1
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/Pag.js +3 -0
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +4 -2
- package/lib/cli/cli.d.ts +3 -0
- package/lib/cli/cli.d.ts.map +1 -0
- package/lib/cli/cli.js +82 -0
- package/lib/cli/commands/cg.d.ts +53 -0
- package/lib/cli/commands/cg.d.ts.map +1 -0
- package/lib/cli/commands/cg.js +404 -0
- package/lib/cli/commands/index.d.ts +6 -0
- package/lib/cli/commands/index.d.ts.map +1 -0
- package/lib/cli/commands/index.js +64 -0
- package/lib/cli/commands/ir.d.ts +26 -0
- package/lib/cli/commands/ir.d.ts.map +1 -0
- package/lib/cli/commands/ir.js +94 -0
- package/lib/core/base/Constant.d.ts +1 -1
- package/lib/core/base/Constant.d.ts.map +1 -1
- package/lib/core/base/Constant.js +1 -1
- package/lib/core/base/Expr.d.ts +29 -5
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +145 -23
- package/lib/core/base/Position.d.ts +14 -0
- package/lib/core/base/Position.d.ts.map +1 -1
- package/lib/core/base/Position.js +27 -0
- package/lib/core/base/Ref.d.ts +1 -0
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +4 -1
- package/lib/core/base/Type.d.ts +64 -24
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +144 -49
- package/lib/core/common/ArkError.d.ts +26 -2
- package/lib/core/common/ArkError.d.ts.map +1 -1
- package/lib/core/common/ArkError.js +56 -2
- package/lib/core/common/ArkIRTransformer.d.ts +11 -10
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +1 -1
- package/lib/core/common/ArkValueTransformer.d.ts +14 -12
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +1 -5
- package/lib/core/common/Const.d.ts +4 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +5 -1
- package/lib/core/common/DummyMainCreater.d.ts +23 -13
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +66 -43
- package/lib/core/common/EtsConst.d.ts +11 -0
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +12 -1
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +6 -2
- package/lib/core/common/IRUtils.d.ts.map +1 -1
- package/lib/core/common/IRUtils.js +3 -33
- package/lib/core/common/ModelUtils.d.ts +4 -7
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +77 -110
- package/lib/core/common/SdkUtils.d.ts +1 -1
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +14 -5
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +9 -3
- package/lib/core/graph/BaseExplicitGraph.d.ts +4 -4
- package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseExplicitGraph.js +15 -8
- package/lib/core/graph/BasicBlock.d.ts.map +1 -1
- package/lib/core/graph/Scc.d.ts.map +1 -1
- package/lib/core/graph/Scc.js +7 -2
- package/lib/core/graph/builder/CfgBuilder.d.ts +10 -7
- package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/CfgBuilder.js +12 -5
- package/lib/core/inference/Inference.d.ts.map +1 -1
- package/lib/core/inference/Inference.js +7 -0
- package/lib/core/inference/ModelInference.d.ts +1 -1
- package/lib/core/inference/ModelInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.d.ts +3 -2
- package/lib/core/inference/ValueInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.js +64 -12
- package/lib/core/inference/abc/AbcInference.d.ts +28 -2
- package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
- package/lib/core/inference/abc/AbcInference.js +105 -4
- package/lib/core/model/ArkBaseModel.d.ts +14 -1
- package/lib/core/model/ArkBaseModel.d.ts.map +1 -1
- package/lib/core/model/ArkBaseModel.js +61 -2
- package/lib/core/model/ArkBody.d.ts.map +1 -1
- package/lib/core/model/ArkBody.js +1 -3
- package/lib/core/model/ArkClass.d.ts +25 -2
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +72 -30
- package/lib/core/model/ArkField.d.ts.map +1 -1
- package/lib/core/model/ArkField.js +3 -1
- package/lib/core/model/ArkFile.d.ts +4 -1
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +44 -3
- package/lib/core/model/ArkImport.d.ts.map +1 -1
- package/lib/core/model/ArkImport.js +9 -1
- package/lib/core/model/ArkMetadata.d.ts +32 -1
- package/lib/core/model/ArkMetadata.d.ts.map +1 -1
- package/lib/core/model/ArkMetadata.js +28 -2
- package/lib/core/model/ArkMethod.d.ts +5 -0
- package/lib/core/model/ArkMethod.d.ts.map +1 -1
- package/lib/core/model/ArkMethod.js +33 -1
- package/lib/core/model/ArkNamespace.d.ts +2 -0
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +11 -0
- package/lib/core/model/ArkSignature.d.ts +3 -3
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +14 -9
- package/lib/core/model/builder/ArkClassBuilder.d.ts +2 -0
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +3 -3
- package/lib/core/model/builder/ArkMetadataBuilder.d.ts +21 -0
- package/lib/core/model/builder/ArkMetadataBuilder.d.ts.map +1 -0
- package/lib/core/model/builder/ArkMetadataBuilder.js +160 -0
- package/lib/core/model/builder/ArkMethodBuilder.d.ts +4 -1
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +50 -29
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts +1 -0
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkNamespaceBuilder.js +2 -1
- package/lib/core/model/builder/BodyBuilder.d.ts +4 -0
- package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.d.ts +1 -0
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +7 -3
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts +296 -0
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/ArkCxxAstNode.js +145 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.d.ts +8 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiApi.js +90 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.d.ts +8 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astJsonNapi/napiRunner.js +183 -0
- package/lib/frontend/cppFrontend/ast/astParser.d.ts +25 -0
- package/lib/frontend/cppFrontend/ast/astParser.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astParser.js +280 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts +18 -0
- package/lib/frontend/cppFrontend/ast/astUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/astUtils.js +158 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts +17 -0
- package/lib/frontend/cppFrontend/ast/const.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/const.js +58 -0
- package/lib/frontend/cppFrontend/ast/index.d.ts +5 -0
- package/lib/frontend/cppFrontend/ast/index.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/ast/index.js +31 -0
- package/lib/frontend/cppFrontend/base/Constant.d.ts +9 -0
- package/lib/frontend/cppFrontend/base/Constant.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Constant.js +33 -0
- package/lib/frontend/cppFrontend/base/Expr.d.ts +174 -0
- package/lib/frontend/cppFrontend/base/Expr.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Expr.js +530 -0
- package/lib/frontend/cppFrontend/base/Ref.d.ts +25 -0
- package/lib/frontend/cppFrontend/base/Ref.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Ref.js +53 -0
- package/lib/frontend/cppFrontend/base/Trap.d.ts +8 -0
- package/lib/frontend/cppFrontend/base/Trap.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Trap.js +28 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts +264 -0
- package/lib/frontend/cppFrontend/base/Type.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/base/Type.js +600 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts +109 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ArkIRTransformer.js +925 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts +477 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ArkValueTransformer.js +2746 -0
- package/lib/frontend/cppFrontend/common/Builtin.d.ts +57 -0
- package/lib/frontend/cppFrontend/common/Builtin.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/Builtin.js +106 -0
- package/lib/frontend/cppFrontend/common/IRInference.d.ts +94 -0
- package/lib/frontend/cppFrontend/common/IRInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/IRInference.js +1087 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts +23 -0
- package/lib/frontend/cppFrontend/common/IRUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/IRUtils.js +168 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts +44 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ModelUtils.js +567 -0
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts +278 -0
- package/lib/frontend/cppFrontend/common/TypeInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/TypeInference.js +1354 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.d.ts +16 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/common/ValueUtil.js +61 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts +182 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/CfgBuilder.js +1435 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts +21 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/ConditionBuilder.js +303 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts +15 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/IfBuilder.js +161 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts +21 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/LoopBuilder.js +261 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts +12 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/SwitchBuilder.js +155 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts +29 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/graph/builder/TrapBuilder.js +302 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.d.ts +10 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxInference.js +41 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts +28 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxModelInference.js +98 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts +20 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/inference/CxxValueInference.js +128 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts +11 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkClassBuilder.js +413 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts +5 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFieldBuilder.js +61 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts +17 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkFileBuilder.js +284 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts +6 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkImportBuilder.js +57 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts +14 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkMethodBuilder.js +422 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts +8 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/ArkNamespaceBuilder.js +194 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts +59 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/BodyBuilder.js +605 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts +46 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/model/builder/builderUtils.js +499 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts +44 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.d.ts.map +1 -0
- package/lib/frontend/cppFrontend/utils/cmakeUtils.js +240 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +8 -1
- package/lib/node_modules/ohos-typescript/.ohos-typescript-version +1 -0
- package/{node_modules → lib/node_modules}/ohos-typescript/package.json +2 -1
- package/lib/save/CGJsonPrinter.d.ts +8 -0
- package/lib/save/CGJsonPrinter.d.ts.map +1 -0
- package/lib/save/CGJsonPrinter.js +41 -0
- package/lib/save/GraphPrinter.js +2 -2
- package/lib/save/json/JsonDto.d.ts +86 -2
- package/lib/save/json/JsonDto.d.ts.map +1 -1
- package/lib/save/json/JsonSerialization.d.ts +1 -1
- package/lib/save/json/JsonSerialization.d.ts.map +1 -1
- package/lib/save/json/JsonSerialization.js +235 -145
- package/lib/save/source/SourceStmt.d.ts.map +1 -1
- package/lib/save/source/SourceStmt.js +3 -1
- package/lib/save/source/SourceTransformer.d.ts.map +1 -1
- package/lib/save/source/SourceTransformer.js +0 -3
- package/lib/utils/CxxSceneUtils.d.ts +11 -0
- package/lib/utils/CxxSceneUtils.d.ts.map +1 -0
- package/lib/utils/CxxSceneUtils.js +178 -0
- package/lib/utils/FileUtils.d.ts +8 -8
- package/lib/utils/FileUtils.d.ts.map +1 -1
- package/lib/utils/FileUtils.js +35 -45
- package/lib/utils/LRUCacheDecorator.d.ts +20 -0
- package/lib/utils/LRUCacheDecorator.d.ts.map +1 -0
- package/lib/utils/LRUCacheDecorator.js +89 -0
- package/lib/utils/ModuleUtils.d.ts +39 -0
- package/lib/utils/ModuleUtils.d.ts.map +1 -0
- package/lib/utils/ModuleUtils.js +261 -0
- package/package.json +13 -7
- /package/{node_modules → lib/node_modules}/ohos-typescript/LICENSE +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/README.OpenSource +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/README.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/SECURITY.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/ThirdPartyNoticeText.txt +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsc +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/bin/tsserver +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/README.md +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cancellationToken.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/cs/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/de/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/es/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/fr/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/it/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ja/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ko/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.dom.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.collection.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.core.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.generator.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.proxy.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.reflect.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.array.include.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2016.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2017.typedarrays.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.asynciterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2018.regexp.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.array.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2019.symbol.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.bigint.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.date.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.number.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.promise.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2021.weakref.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.array.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.error.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.object.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.sharedmemory.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es2022.string.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es5.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.es6.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.full.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.esnext.intl.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.scripthost.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.importscripts.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/lib.webworker.iterable.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pl/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/pt-br/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/ru/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tr/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsc.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserver.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/tsserverlibrary.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typesMap.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.d.ts +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typescript.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/typingsInstaller.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/watchGuard.js +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -0
- /package/{node_modules → lib/node_modules}/ohos-typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -0
package/lib/core/base/Type.js
CHANGED
|
@@ -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.
|
|
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
|
-
*
|
|
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
|
-
|
|
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.
|
|
272
|
+
typesString.push(`(${t.toStringWithVisited(visited)})`);
|
|
222
273
|
}
|
|
223
274
|
else {
|
|
224
|
-
typesString.push(t.
|
|
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
|
-
|
|
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.
|
|
314
|
+
typesString.push(`(${t.toStringWithVisited(visited)})`);
|
|
261
315
|
}
|
|
262
316
|
else {
|
|
263
|
-
typesString.push(t.
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
364
|
-
|
|
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
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
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 [' +
|
|
536
|
+
return 'readonly [' + typesStr + ']';
|
|
457
537
|
}
|
|
458
|
-
return '[' +
|
|
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
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
if (
|
|
502
|
-
res += `<${
|
|
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.
|
|
680
|
+
str += ' extends ' + this.constraint.toStringWithVisited(visited);
|
|
586
681
|
}
|
|
587
682
|
if (this.defaultType) {
|
|
588
|
-
str += ' = ' + this.defaultType.
|
|
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
|
-
|
|
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
|
|
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["
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
40
|
-
|
|
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
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"ArkIRTransformer.d.ts","sourceRoot":"","sources":["../../../src/core/common/ArkIRTransformer.ts"],"names":[],"mappings":"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"}
|
|
@@ -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
|
|
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]);
|