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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2026 Huawei Device Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2026 Huawei Device Co., Ltd.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
6
6
|
* You may obtain a copy of the License at
|
|
@@ -19,8 +19,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
19
19
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
20
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
21
|
};
|
|
22
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
|
+
};
|
|
25
|
+
var AbcInstanceInvokeExprInference_1, AbcExceptionRefInference_1;
|
|
22
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.AbcFieldRefInference = exports.AbcInferenceBuilder = exports.AbcMethodInference = void 0;
|
|
27
|
+
exports.AbcExceptionRefInference = exports.AbcInstanceInvokeExprInference = exports.AbcFieldRefInference = exports.AbcInferenceBuilder = exports.AbcMethodInference = void 0;
|
|
24
28
|
const ModelInference_1 = require("../ModelInference");
|
|
25
29
|
const ModelUtils_1 = require("../../common/ModelUtils");
|
|
26
30
|
const ArkMethod_1 = require("../../model/ArkMethod");
|
|
@@ -32,6 +36,12 @@ const TypeInference_1 = require("../../common/TypeInference");
|
|
|
32
36
|
const Type_1 = require("../../base/Type");
|
|
33
37
|
const Local_1 = require("../../base/Local");
|
|
34
38
|
const Ref_1 = require("../../base/Ref");
|
|
39
|
+
const Const_1 = require("../../common/Const");
|
|
40
|
+
const path_1 = __importDefault(require("path"));
|
|
41
|
+
const ArkField_1 = require("../../model/ArkField");
|
|
42
|
+
const IRInference_1 = require("../../common/IRInference");
|
|
43
|
+
const ArkClass_1 = require("../../model/ArkClass");
|
|
44
|
+
const EtsConst_1 = require("../../common/EtsConst");
|
|
35
45
|
class AbcImportInference extends ModelInference_1.ImportInfoInference {
|
|
36
46
|
/**
|
|
37
47
|
* get arkFile and assign to from file
|
|
@@ -43,7 +53,7 @@ class AbcImportInference extends ModelInference_1.ImportInfoInference {
|
|
|
43
53
|
return;
|
|
44
54
|
}
|
|
45
55
|
let file;
|
|
46
|
-
if (
|
|
56
|
+
if (path_1.default.isAbsolute(from)) {
|
|
47
57
|
const scene = fromInfo.getDeclaringArkFile().getScene();
|
|
48
58
|
file = scene.getFile(new ArkSignature_1.FileSignature(fromInfo.getDeclaringArkFile().getProjectName(), from));
|
|
49
59
|
}
|
|
@@ -158,7 +168,8 @@ class AbcStmtInference extends ModelInference_1.StmtInference {
|
|
|
158
168
|
target.setType(srcType);
|
|
159
169
|
return target.getUsedStmts();
|
|
160
170
|
}
|
|
161
|
-
else if (target instanceof Ref_1.AbstractFieldRef)
|
|
171
|
+
else if (target instanceof Ref_1.AbstractFieldRef && projectName === target.getFieldSignature().getDeclaringSignature()
|
|
172
|
+
.getDeclaringFileSignature().getProjectName()) {
|
|
162
173
|
target.getFieldSignature().setType(srcType);
|
|
163
174
|
}
|
|
164
175
|
else if (target instanceof Ref_1.ArkParameterRef) {
|
|
@@ -195,10 +206,100 @@ let AbcFieldRefInference = class AbcFieldRefInference extends ValueInference_1.F
|
|
|
195
206
|
return true;
|
|
196
207
|
}
|
|
197
208
|
}
|
|
209
|
+
const signature = value.getFieldSignature().getDeclaringSignature();
|
|
210
|
+
if (signature instanceof ArkSignature_1.ClassSignature && signature.getClassName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX)) {
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
198
213
|
return super.preInfer(value, stmt);
|
|
199
214
|
}
|
|
215
|
+
infer(value, stmt) {
|
|
216
|
+
const result = super.infer(value, stmt);
|
|
217
|
+
if (!result && value.getType() instanceof Type_1.UnknownType) {
|
|
218
|
+
const signature = value.getFieldSignature().getDeclaringSignature();
|
|
219
|
+
const scene = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getScene();
|
|
220
|
+
if (signature instanceof ArkSignature_1.ClassSignature && signature.getDeclaringFileSignature().getProjectName() === scene.getProjectName()) {
|
|
221
|
+
const cls = scene.getClass(signature);
|
|
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());
|
|
226
|
+
field.setSignature(fieldSignature);
|
|
227
|
+
cls.addField(field);
|
|
228
|
+
value.setFieldSignature(fieldSignature);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
}
|
|
200
234
|
};
|
|
201
235
|
AbcFieldRefInference = __decorate([
|
|
202
236
|
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
|
|
203
237
|
], AbcFieldRefInference);
|
|
204
238
|
exports.AbcFieldRefInference = AbcFieldRefInference;
|
|
239
|
+
let AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference_1 = class AbcInstanceInvokeExprInference extends ValueInference_1.InstanceInvokeExprInference {
|
|
240
|
+
/**
|
|
241
|
+
* Performs inference on an instance invocation expression within the context of a statement
|
|
242
|
+
* Enhances the base implementation with real generic type inference and extension function support
|
|
243
|
+
* @param {ArkInstanceInvokeExpr} value - The invocation expression to infer
|
|
244
|
+
* @param {Stmt} stmt - The statement containing the invocation
|
|
245
|
+
* @returns {Value | undefined} Returns a new expression if transformed, undefined otherwise
|
|
246
|
+
*/
|
|
247
|
+
infer(value, stmt) {
|
|
248
|
+
var _a;
|
|
249
|
+
const arkMethod = stmt.getCfg().getDeclaringMethod();
|
|
250
|
+
const result = (_a = IRInference_1.IRInference.inferInstanceMember(value.getBase().getType(), value, arkMethod, ValueInference_1.InstanceInvokeExprInference.inferInvokeExpr)) !== null && _a !== void 0 ? _a : this.processExtendFunc(value, arkMethod);
|
|
251
|
+
return !result || result === value ? undefined : result;
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* process Context function
|
|
255
|
+
* @param value
|
|
256
|
+
* @param arkMethod
|
|
257
|
+
*/
|
|
258
|
+
processExtendFunc(value, arkMethod) {
|
|
259
|
+
var _a, _b;
|
|
260
|
+
if (value.getBase().getName() === AbcInstanceInvokeExprInference_1.CONTEXT) {
|
|
261
|
+
const scene = arkMethod.getDeclaringArkFile().getScene();
|
|
262
|
+
const signature = (_a = scene.getSdkGlobal(AbcInstanceInvokeExprInference_1.CONTEXT)) === null || _a === void 0 ? void 0 : _a.getSignature();
|
|
263
|
+
if (signature instanceof ArkSignature_1.AliasTypeSignature) {
|
|
264
|
+
const cls = (_b = scene.getMethod(signature.getDeclaringMethodSignature())) === null || _b === void 0 ? void 0 : _b.getDeclaringArkClass();
|
|
265
|
+
if (cls) {
|
|
266
|
+
return IRInference_1.IRInference.inferInstanceMember(new Type_1.ClassType(cls.getSignature(), cls.getGenericsTypes()), value, arkMethod, ValueInference_1.InstanceInvokeExprInference.inferInvokeExpr);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return null;
|
|
271
|
+
}
|
|
272
|
+
};
|
|
273
|
+
AbcInstanceInvokeExprInference.CONTEXT = 'Context';
|
|
274
|
+
AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference_1 = __decorate([
|
|
275
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
|
|
276
|
+
], AbcInstanceInvokeExprInference);
|
|
277
|
+
exports.AbcInstanceInvokeExprInference = AbcInstanceInvokeExprInference;
|
|
278
|
+
let AbcExceptionRefInference = AbcExceptionRefInference_1 = class AbcExceptionRefInference extends ValueInference_1.ValueInference {
|
|
279
|
+
getValueName() {
|
|
280
|
+
return 'ArkCaughtExceptionRef';
|
|
281
|
+
}
|
|
282
|
+
preInfer(value, stmt) {
|
|
283
|
+
return TypeInference_1.TypeInference.isUnclearType(value.getType());
|
|
284
|
+
}
|
|
285
|
+
infer(value, stmt) {
|
|
286
|
+
var _a;
|
|
287
|
+
if (!AbcExceptionRefInference_1.ERROR_TYPE) {
|
|
288
|
+
const scene = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getScene();
|
|
289
|
+
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);
|
|
290
|
+
if (err instanceof ArkClass_1.ArkClass) {
|
|
291
|
+
AbcExceptionRefInference_1.ERROR_TYPE = new Type_1.ClassType(err.getSignature(), err.getGenericsTypes());
|
|
292
|
+
value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
value.setType(AbcExceptionRefInference_1.ERROR_TYPE);
|
|
297
|
+
}
|
|
298
|
+
return undefined;
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
AbcExceptionRefInference.ERROR_TYPE = null;
|
|
302
|
+
AbcExceptionRefInference = AbcExceptionRefInference_1 = __decorate([
|
|
303
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
|
|
304
|
+
], AbcExceptionRefInference);
|
|
305
|
+
exports.AbcExceptionRefInference = AbcExceptionRefInference;
|
|
@@ -19,10 +19,22 @@ export declare enum ModifierType {
|
|
|
19
19
|
OVERRIDE = 8192,
|
|
20
20
|
DECLARE = 16384,
|
|
21
21
|
TYPE = 32768,
|
|
22
|
-
LAZY = 65536
|
|
22
|
+
LAZY = 65536,
|
|
23
|
+
AUTO = 1048576,
|
|
24
|
+
EXTERN = 2097152,
|
|
25
|
+
FRIEND = 4194304,
|
|
26
|
+
VIRTUAL = 8388608,
|
|
27
|
+
PURE_VIRTUAL = 16777216,
|
|
28
|
+
INLINE = 33554432,
|
|
29
|
+
MUTABLE = 67108864,
|
|
30
|
+
EXPLICIT = 134217728,
|
|
31
|
+
CONSTEXPR = 268435456,
|
|
32
|
+
VOLATILE = 536870912,
|
|
33
|
+
NOEXCEPT = 1073741824
|
|
23
34
|
}
|
|
24
35
|
export declare const MODIFIER_TYPE_MASK = 65535;
|
|
25
36
|
export declare function modifierKind2Enum(kind: ts.SyntaxKind): ModifierType;
|
|
37
|
+
export declare function modifierKind2CxxEnum(kind: string): ModifierType;
|
|
26
38
|
export declare function modifiers2stringArray(modifiers: number): string[];
|
|
27
39
|
export declare abstract class ArkBaseModel {
|
|
28
40
|
protected modifiers?: number;
|
|
@@ -42,6 +54,7 @@ export declare abstract class ArkBaseModel {
|
|
|
42
54
|
isAbstract(): boolean;
|
|
43
55
|
isExport(): boolean;
|
|
44
56
|
isDefault(): boolean;
|
|
57
|
+
isPureVirtual(): boolean;
|
|
45
58
|
/** @deprecated Use {@link isExport} instead. */
|
|
46
59
|
isExported(): boolean;
|
|
47
60
|
isDeclare(): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkBaseModel.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkBaseModel.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAgB,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAqB9E,oBAAY,YAAY;IACpB,OAAO,IAAI;IACX,SAAS,IAAS;IAClB,MAAM,IAAS;IACf,MAAM,IAAS;IACf,MAAM,KAAS;IACf,QAAQ,KAAS;IACjB,KAAK,KAAS;IACd,KAAK,MAAS;IACd,QAAQ,MAAS;IACjB,OAAO,MAAS;IAChB,EAAE,OAAU;IACZ,QAAQ,OAAU;IAClB,GAAG,OAAU;IACb,QAAQ,OAAU;IAClB,OAAO,QAAU;IACjB,IAAI,QAAU;IACd,IAAI,QAAU;
|
|
1
|
+
{"version":3,"file":"ArkBaseModel.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkBaseModel.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,QAAQ,EAAgB,MAAM,oBAAoB,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAqB9E,oBAAY,YAAY;IACpB,OAAO,IAAI;IACX,SAAS,IAAS;IAClB,MAAM,IAAS;IACf,MAAM,IAAS;IACf,MAAM,KAAS;IACf,QAAQ,KAAS;IACjB,KAAK,KAAS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AQ,IAAI,OAAO;IAInB,UAAU,IAAI,OAAO;IAIrB,UAAU,IAAI,OAAO;IAIrB,QAAQ,IAAI,OAAO;IAInB,SAAS,IAAI,OAAO;IAKpB,aAAa,IAAI,OAAO;IAI/B,gDAAgD;IACzC,UAAU,IAAI,OAAO;IAIrB,SAAS,IAAI,OAAO;IAIpB,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO;IAQrD,aAAa,IAAI,SAAS,EAAE;IAO5B,aAAa,CAAC,UAAU,EAAE,GAAG,CAAC,SAAS,CAAC,GAAG,IAAI;IAM/C,YAAY,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAOxC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAQnC,mBAAmB,IAAI,OAAO;IAI9B,kBAAkB,IAAI,SAAS,EAAE;IASjC,wBAAwB,IAAI,OAAO;IAInC,iBAAiB,IAAI,OAAO;IAI5B,qBAAqB,IAAI,OAAO;IAIhC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,OAAO;IAYxD,SAAS,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ;aAkBpC,QAAQ,IAAI,QAAQ;CACvC"}
|
|
@@ -40,7 +40,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
40
40
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
41
|
};
|
|
42
42
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
-
exports.ArkBaseModel = exports.modifiers2stringArray = exports.modifierKind2Enum = exports.MODIFIER_TYPE_MASK = exports.ModifierType = void 0;
|
|
43
|
+
exports.ArkBaseModel = exports.modifiers2stringArray = exports.modifierKind2CxxEnum = exports.modifierKind2Enum = exports.MODIFIER_TYPE_MASK = exports.ModifierType = void 0;
|
|
44
44
|
const ohos_typescript_1 = __importDefault(require("ohos-typescript"));
|
|
45
45
|
const EtsConst_1 = require("../common/EtsConst");
|
|
46
46
|
const ArkError_1 = require("../common/ArkError");
|
|
@@ -83,6 +83,18 @@ var ModifierType;
|
|
|
83
83
|
ModifierType[ModifierType["DECLARE"] = 16384] = "DECLARE";
|
|
84
84
|
ModifierType[ModifierType["TYPE"] = 32768] = "TYPE";
|
|
85
85
|
ModifierType[ModifierType["LAZY"] = 65536] = "LAZY";
|
|
86
|
+
// The following are CXX specific modifiers.
|
|
87
|
+
ModifierType[ModifierType["AUTO"] = 1048576] = "AUTO";
|
|
88
|
+
ModifierType[ModifierType["EXTERN"] = 2097152] = "EXTERN";
|
|
89
|
+
ModifierType[ModifierType["FRIEND"] = 4194304] = "FRIEND";
|
|
90
|
+
ModifierType[ModifierType["VIRTUAL"] = 8388608] = "VIRTUAL";
|
|
91
|
+
ModifierType[ModifierType["PURE_VIRTUAL"] = 16777216] = "PURE_VIRTUAL";
|
|
92
|
+
ModifierType[ModifierType["INLINE"] = 33554432] = "INLINE";
|
|
93
|
+
ModifierType[ModifierType["MUTABLE"] = 67108864] = "MUTABLE";
|
|
94
|
+
ModifierType[ModifierType["EXPLICIT"] = 134217728] = "EXPLICIT";
|
|
95
|
+
ModifierType[ModifierType["CONSTEXPR"] = 268435456] = "CONSTEXPR";
|
|
96
|
+
ModifierType[ModifierType["VOLATILE"] = 536870912] = "VOLATILE";
|
|
97
|
+
ModifierType[ModifierType["NOEXCEPT"] = 1073741824] = "NOEXCEPT";
|
|
86
98
|
})(ModifierType = exports.ModifierType || (exports.ModifierType = {}));
|
|
87
99
|
exports.MODIFIER_TYPE_MASK = 0xffff;
|
|
88
100
|
const MODIFIER_TYPE_STRINGS = [
|
|
@@ -102,6 +114,45 @@ const MODIFIER_TYPE_STRINGS = [
|
|
|
102
114
|
'override',
|
|
103
115
|
'declare',
|
|
104
116
|
];
|
|
117
|
+
/**
|
|
118
|
+
*Map the C++modifier keyword to the corresponding modifier type enumeration value
|
|
119
|
+
*
|
|
120
|
+
*This constant defines a Map object, which is used to map the modifier keyword string in C++language to
|
|
121
|
+
*The corresponding ModifierType enumeration value is convenient for type identification and processing during code analysis and conversion.
|
|
122
|
+
*
|
|
123
|
+
*Included modifier mapping relationship:
|
|
124
|
+
*- virtual ->ModifierType.VIRTUAL: virtual function modifier
|
|
125
|
+
*- const ->ModifierType.CONST: constant modifier
|
|
126
|
+
*- private ->ModifierType.PRIVATE: private access modifier
|
|
127
|
+
*- protected ->ModifierType.PROTECTED: protect access modifier
|
|
128
|
+
*- public ->ModifierType.PUBLIC: public access modifier
|
|
129
|
+
*- extern ->ModifierType.EXTERN: external link modifier
|
|
130
|
+
*- friend ->ModifierType.FRIEND: Friend modifier
|
|
131
|
+
*- override ->ModifierType.OVERRIDE: override modifier
|
|
132
|
+
*- static ->ModifierType.STATIC: static modifier
|
|
133
|
+
*- pure virtual ->ModifierType.PURE_VIRTUAL: pure virtual function modifier
|
|
134
|
+
*- abstract ->ModifierType.ABSTRACT: abstract class modifier (implemented through pure virtual function in C++)
|
|
135
|
+
*/
|
|
136
|
+
const MODIFIER_KIND_2_ENUM_CXX = new Map([
|
|
137
|
+
['virtual', ModifierType.VIRTUAL],
|
|
138
|
+
['const', ModifierType.CONST],
|
|
139
|
+
['private', ModifierType.PRIVATE],
|
|
140
|
+
['protected', ModifierType.PROTECTED],
|
|
141
|
+
['public', ModifierType.PUBLIC],
|
|
142
|
+
['extern', ModifierType.EXTERN],
|
|
143
|
+
['friend', ModifierType.FRIEND],
|
|
144
|
+
['override', ModifierType.OVERRIDE],
|
|
145
|
+
['static', ModifierType.STATIC],
|
|
146
|
+
['pure virtual', ModifierType.PURE_VIRTUAL],
|
|
147
|
+
// In C++, a class with pure virtual functions is an abstract class. This sets a modifier to correspond to the abstract class in TypeScript.
|
|
148
|
+
['abstract', ModifierType.ABSTRACT],
|
|
149
|
+
['inline', ModifierType.INLINE],
|
|
150
|
+
['mutable', ModifierType.MUTABLE],
|
|
151
|
+
['explicit', ModifierType.EXPLICIT],
|
|
152
|
+
['constexpr', ModifierType.CONSTEXPR],
|
|
153
|
+
['volatile', ModifierType.VOLATILE],
|
|
154
|
+
['noexcept', ModifierType.NOEXCEPT],
|
|
155
|
+
]);
|
|
105
156
|
const MODIFIER_KIND_2_ENUM = new Map([
|
|
106
157
|
[ohos_typescript_1.default.SyntaxKind.AbstractKeyword, ModifierType.ABSTRACT],
|
|
107
158
|
[ohos_typescript_1.default.SyntaxKind.AccessorKeyword, ModifierType.ACCESSOR],
|
|
@@ -125,6 +176,10 @@ function modifierKind2Enum(kind) {
|
|
|
125
176
|
return MODIFIER_KIND_2_ENUM.get(kind);
|
|
126
177
|
}
|
|
127
178
|
exports.modifierKind2Enum = modifierKind2Enum;
|
|
179
|
+
function modifierKind2CxxEnum(kind) {
|
|
180
|
+
return MODIFIER_KIND_2_ENUM_CXX.get(kind);
|
|
181
|
+
}
|
|
182
|
+
exports.modifierKind2CxxEnum = modifierKind2CxxEnum;
|
|
128
183
|
function modifiers2stringArray(modifiers) {
|
|
129
184
|
let strs = [];
|
|
130
185
|
for (let idx = 0; idx < MODIFIER_TYPE_STRINGS.length; idx++) {
|
|
@@ -192,6 +247,10 @@ class ArkBaseModel {
|
|
|
192
247
|
isDefault() {
|
|
193
248
|
return this.containsModifier(ModifierType.DEFAULT);
|
|
194
249
|
}
|
|
250
|
+
/* Determine whether a method is a pure virtual method in C++. */
|
|
251
|
+
isPureVirtual() {
|
|
252
|
+
return this.containsModifier(ModifierType.PURE_VIRTUAL);
|
|
253
|
+
}
|
|
195
254
|
/** @deprecated Use {@link isExport} instead. */
|
|
196
255
|
isExported() {
|
|
197
256
|
return this.isExport();
|
|
@@ -273,7 +332,7 @@ class ArkBaseModel {
|
|
|
273
332
|
}
|
|
274
333
|
logger.error(`class fields: ${errs.join(',')} is undefined.`);
|
|
275
334
|
return {
|
|
276
|
-
errCode: ArkError_1.ArkErrorCode.
|
|
335
|
+
errCode: ArkError_1.ArkErrorCode.CLASS_INSTANCE_FIELD_UNDEFINED,
|
|
277
336
|
errMsg: `${errs.join(',')} is undefined.`,
|
|
278
337
|
};
|
|
279
338
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkBody.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkBody.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAGtD,qBAAa,OAAO;IAChB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,WAAW,CAAC,CAAqB;IACzC,OAAO,CAAC,GAAG,CAAM;IACjB,OAAO,CAAC,YAAY,CAAC,CAAmD;IACxE,OAAO,CAAC,KAAK,CAAC,CAAS;gBAEX,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,EAAE;IAQlH,SAAS,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC;IAI/B,SAAS,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"ArkBody.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkBody.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAA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TERFACE = 2,
|
|
16
16
|
ENUM = 3,
|
|
17
17
|
TYPE_LITERAL = 4,
|
|
18
|
-
OBJECT = 5
|
|
18
|
+
OBJECT = 5,
|
|
19
|
+
UNION = 6
|
|
20
|
+
}
|
|
21
|
+
export interface heritageClassWithInfo {
|
|
22
|
+
baseClass: ArkClass | undefined | null;
|
|
23
|
+
isVirtual: boolean;
|
|
24
|
+
access: string;
|
|
19
25
|
}
|
|
20
26
|
/**
|
|
21
27
|
* @category core/model
|
|
@@ -46,6 +52,8 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
|
|
|
46
52
|
private anonymousMethodNumber;
|
|
47
53
|
private indexSignatureNumber;
|
|
48
54
|
private viewTree?;
|
|
55
|
+
private ts2cxxFuncMap;
|
|
56
|
+
private classDeclareSignature?;
|
|
49
57
|
constructor();
|
|
50
58
|
/**
|
|
51
59
|
* Returns the program language of the file where this class defined.
|
|
@@ -96,6 +104,7 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
|
|
|
96
104
|
setDeclaringArkNamespace(declaringArkNamespace: ArkNamespace | undefined): void;
|
|
97
105
|
isDefaultArkClass(): boolean;
|
|
98
106
|
isAnonymousClass(): boolean;
|
|
107
|
+
isLibraryClass(): boolean;
|
|
99
108
|
/**
|
|
100
109
|
* Returns the signature of current class (i.e., {@link ClassSignature}).
|
|
101
110
|
* The {@link ClassSignature} can uniquely identify a class, according to which we can find the class from the scene.
|
|
@@ -105,12 +114,15 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
|
|
|
105
114
|
setSignature(classSig: ClassSignature): void;
|
|
106
115
|
getSuperClassName(): string;
|
|
107
116
|
addHeritageClassName(className: string): void;
|
|
117
|
+
addHeritageClassNameWithInfo(className: string, classInfo: heritageClassWithInfo): void;
|
|
108
118
|
/**
|
|
109
119
|
* Returns the superclass of this class.
|
|
120
|
+
* If the superclass is defined in this project, then its category must not be INTERFACE.
|
|
121
|
+
* If the superclass is from the 3rd party library, then its category could be INTERFACE.
|
|
110
122
|
* @returns The superclass of this class.
|
|
111
123
|
*/
|
|
112
124
|
getSuperClass(): ArkClass | null;
|
|
113
|
-
|
|
125
|
+
getHeritageClass(heritageClassName: string): ArkClass | null;
|
|
114
126
|
getAllHeritageClasses(): ArkClass[];
|
|
115
127
|
getExtendedClasses(): Map<string, ArkClass>;
|
|
116
128
|
addExtendedClass(extendedClass: ArkClass): void;
|
|
@@ -154,6 +166,13 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
|
|
|
154
166
|
*/
|
|
155
167
|
getMethods(generated?: boolean): ArkMethod[];
|
|
156
168
|
getMethod(methodSignature: MethodSignature): ArkMethod | null;
|
|
169
|
+
/**
|
|
170
|
+
* Find a method that matches the specified signature
|
|
171
|
+
* @ param mtd - Ark method object to check
|
|
172
|
+
* @ param methodSignature - the method signature to match
|
|
173
|
+
* @ returns If a matching method is found, the method object will be returned; otherwise, null will be returned
|
|
174
|
+
*/
|
|
175
|
+
private findMatchingMethod;
|
|
157
176
|
getMethodWithName(methodName: string): ArkMethod | null;
|
|
158
177
|
getStaticMethodWithName(methodName: string): ArkMethod | null;
|
|
159
178
|
/**
|
|
@@ -240,5 +259,9 @@ export declare class ArkClass extends ArkBaseModel implements ArkExport {
|
|
|
240
259
|
removeField(field: ArkField): boolean;
|
|
241
260
|
removeMethod(method: ArkMethod): boolean;
|
|
242
261
|
validate(): ArkError;
|
|
262
|
+
addTs2cxxFuncMapElement(funcName: string, methods: ArkMethod[]): void;
|
|
263
|
+
getTs2cxxFuncMap(): Map<string, ArkMethod[]>;
|
|
264
|
+
getDeclareSignature(): ClassSignature | undefined;
|
|
265
|
+
setDeclareSignature(classSig: ClassSignature): void;
|
|
243
266
|
}
|
|
244
267
|
//# sourceMappingURL=ArkClass.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkClass.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkClass.ts"],"names":[],"mappings":"AAeA,OAAO,EAAa,WAAW,EA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mB,IAAI,cAAc,GAAG,SAAS;IAIjD,mBAAmB,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;CAG7D"}
|
|
@@ -56,6 +56,8 @@ var ClassCategory;
|
|
|
56
56
|
ClassCategory[ClassCategory["ENUM"] = 3] = "ENUM";
|
|
57
57
|
ClassCategory[ClassCategory["TYPE_LITERAL"] = 4] = "TYPE_LITERAL";
|
|
58
58
|
ClassCategory[ClassCategory["OBJECT"] = 5] = "OBJECT";
|
|
59
|
+
// The following are CXX specific categories.
|
|
60
|
+
ClassCategory[ClassCategory["UNION"] = 6] = "UNION";
|
|
59
61
|
})(ClassCategory = exports.ClassCategory || (exports.ClassCategory = {}));
|
|
60
62
|
/**
|
|
61
63
|
* @category core/model
|
|
@@ -81,6 +83,8 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
|
|
|
81
83
|
this.staticInitMethod = new ArkMethod_1.ArkMethod();
|
|
82
84
|
this.anonymousMethodNumber = 0;
|
|
83
85
|
this.indexSignatureNumber = 0;
|
|
86
|
+
// In order to record the mapping between arkTS and CPP functions
|
|
87
|
+
this.ts2cxxFuncMap = new Map();
|
|
84
88
|
}
|
|
85
89
|
/**
|
|
86
90
|
* Returns the program language of the file where this class defined.
|
|
@@ -164,6 +168,10 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
|
|
|
164
168
|
isAnonymousClass() {
|
|
165
169
|
return this.getName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX);
|
|
166
170
|
}
|
|
171
|
+
isLibraryClass() {
|
|
172
|
+
const file = this.getDeclaringArkFile();
|
|
173
|
+
return file.getProjectName() !== file.getScene().getProjectName();
|
|
174
|
+
}
|
|
167
175
|
/**
|
|
168
176
|
* Returns the signature of current class (i.e., {@link ClassSignature}).
|
|
169
177
|
* The {@link ClassSignature} can uniquely identify a class, according to which we can find the class from the scene.
|
|
@@ -181,23 +189,34 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
|
|
|
181
189
|
addHeritageClassName(className) {
|
|
182
190
|
this.heritageClasses.set(className, undefined);
|
|
183
191
|
}
|
|
192
|
+
addHeritageClassNameWithInfo(className, classInfo) {
|
|
193
|
+
this.heritageClasses.set(className, classInfo);
|
|
194
|
+
}
|
|
184
195
|
/**
|
|
185
196
|
* Returns the superclass of this class.
|
|
197
|
+
* If the superclass is defined in this project, then its category must not be INTERFACE.
|
|
198
|
+
* If the superclass is from the 3rd party library, then its category could be INTERFACE.
|
|
186
199
|
* @returns The superclass of this class.
|
|
187
200
|
*/
|
|
188
201
|
getSuperClass() {
|
|
189
202
|
const heritageClass = this.getHeritageClass(this.getSuperClassName());
|
|
190
|
-
if (heritageClass
|
|
191
|
-
|
|
203
|
+
if (heritageClass) {
|
|
204
|
+
if (heritageClass.getCategory() !== ClassCategory.INTERFACE) {
|
|
205
|
+
return heritageClass;
|
|
206
|
+
}
|
|
207
|
+
if (heritageClass.isLibraryClass()) {
|
|
208
|
+
return heritageClass;
|
|
209
|
+
}
|
|
192
210
|
}
|
|
193
211
|
return null;
|
|
194
212
|
}
|
|
195
213
|
getHeritageClass(heritageClassName) {
|
|
196
|
-
var _a;
|
|
214
|
+
var _a, _b, _c;
|
|
197
215
|
if (!heritageClassName) {
|
|
198
216
|
return null;
|
|
199
217
|
}
|
|
200
|
-
let
|
|
218
|
+
let superClassWithInfo = this.heritageClasses.get(heritageClassName);
|
|
219
|
+
let superClass = superClassWithInfo === null || superClassWithInfo === void 0 ? void 0 : superClassWithInfo.baseClass;
|
|
201
220
|
if (superClass === undefined) {
|
|
202
221
|
let type = (_a = TypeInference_1.TypeInference.inferUnclearRefName(heritageClassName, this)) !== null && _a !== void 0 ? _a : TypeInference_1.TypeInference.inferUnclearRefName(heritageClassName, this.getDeclaringArkFile().getDefaultClass());
|
|
203
222
|
if (type) {
|
|
@@ -210,16 +229,28 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
|
|
|
210
229
|
this.realTypes = realGenericTypes;
|
|
211
230
|
}
|
|
212
231
|
}
|
|
213
|
-
|
|
232
|
+
superClassWithInfo = {
|
|
233
|
+
baseClass: superClass,
|
|
234
|
+
isVirtual: (_b = superClassWithInfo === null || superClassWithInfo === void 0 ? void 0 : superClassWithInfo.isVirtual) !== null && _b !== void 0 ? _b : false,
|
|
235
|
+
access: (_c = superClassWithInfo === null || superClassWithInfo === void 0 ? void 0 : superClassWithInfo.access) !== null && _c !== void 0 ? _c : 'private',
|
|
236
|
+
};
|
|
237
|
+
this.heritageClasses.set(heritageClassName, superClassWithInfo);
|
|
214
238
|
}
|
|
215
|
-
return
|
|
239
|
+
return (superClassWithInfo === null || superClassWithInfo === void 0 ? void 0 : superClassWithInfo.baseClass) || null;
|
|
216
240
|
}
|
|
217
241
|
getAllHeritageClasses() {
|
|
218
242
|
const result = [];
|
|
219
243
|
this.heritageClasses.forEach((v, k) => {
|
|
220
244
|
const heritage = v !== null && v !== void 0 ? v : this.getHeritageClass(k);
|
|
221
245
|
if (heritage) {
|
|
222
|
-
|
|
246
|
+
// C++ feature: inheritance may carry extra metadata (e.g., virtual inheritance/access),
|
|
247
|
+
// so we may get `heritageClassWithInfo` and must extract `baseClass`.
|
|
248
|
+
if ('baseClass' in heritage && heritage.baseClass) {
|
|
249
|
+
result.push(heritage.baseClass);
|
|
250
|
+
}
|
|
251
|
+
else if (heritage instanceof ArkClass) {
|
|
252
|
+
result.push(heritage);
|
|
253
|
+
}
|
|
223
254
|
}
|
|
224
255
|
});
|
|
225
256
|
return result;
|
|
@@ -323,21 +354,35 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
|
|
|
323
354
|
return [...new Set(allMethods)];
|
|
324
355
|
}
|
|
325
356
|
getMethod(methodSignature) {
|
|
326
|
-
var _a;
|
|
327
357
|
const methodName = methodSignature.getMethodSubSignature().getMethodName();
|
|
328
|
-
const
|
|
329
|
-
if (
|
|
358
|
+
const methodsWithSameName = this.getAllMethodsWithName(methodName);
|
|
359
|
+
if (methodsWithSameName.length === 0) {
|
|
330
360
|
return null;
|
|
331
361
|
}
|
|
332
|
-
const
|
|
362
|
+
for (const mtd of methodsWithSameName) {
|
|
363
|
+
let methodMatched = this.findMatchingMethod(mtd, methodSignature);
|
|
364
|
+
if (methodMatched) {
|
|
365
|
+
return methodMatched;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* Find a method that matches the specified signature
|
|
372
|
+
* @ param mtd - Ark method object to check
|
|
373
|
+
* @ param methodSignature - the method signature to match
|
|
374
|
+
* @ returns If a matching method is found, the method object will be returned; otherwise, null will be returned
|
|
375
|
+
*/
|
|
376
|
+
findMatchingMethod(mtd, methodSignature) {
|
|
377
|
+
const implSignature = mtd.getImplementationSignature();
|
|
333
378
|
if (implSignature !== null && implSignature.isMatch(methodSignature)) {
|
|
334
|
-
return
|
|
379
|
+
return mtd;
|
|
335
380
|
}
|
|
336
|
-
const declareSignatures =
|
|
381
|
+
const declareSignatures = mtd.getDeclareSignatures();
|
|
337
382
|
if (declareSignatures !== null) {
|
|
338
383
|
for (let i = 0; i < declareSignatures.length; i++) {
|
|
339
384
|
if (declareSignatures[i].isMatch(methodSignature)) {
|
|
340
|
-
return
|
|
385
|
+
return mtd;
|
|
341
386
|
}
|
|
342
387
|
}
|
|
343
388
|
}
|
|
@@ -485,22 +530,7 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
|
|
|
485
530
|
return this.viewTree !== undefined;
|
|
486
531
|
}
|
|
487
532
|
getStaticFields(classMap) {
|
|
488
|
-
|
|
489
|
-
let classes = [];
|
|
490
|
-
if (this.declaringArkNamespace) {
|
|
491
|
-
classes = classMap.get(this.declaringArkNamespace.getNamespaceSignature());
|
|
492
|
-
}
|
|
493
|
-
else {
|
|
494
|
-
classes = classMap.get(this.declaringArkFile.getFileSignature());
|
|
495
|
-
}
|
|
496
|
-
for (const arkClass of classes) {
|
|
497
|
-
for (const field of arkClass.getFields()) {
|
|
498
|
-
if (field.isStatic()) {
|
|
499
|
-
fields.push(field);
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
return fields;
|
|
533
|
+
return Array.from(this.staticFields.values());
|
|
504
534
|
}
|
|
505
535
|
getGlobalVariable(globalMap) {
|
|
506
536
|
if (this.declaringArkNamespace) {
|
|
@@ -549,5 +579,17 @@ class ArkClass extends ArkBaseModel_1.ArkBaseModel {
|
|
|
549
579
|
validate() {
|
|
550
580
|
return this.validateFields(['declaringArkFile', 'category', 'classSignature']);
|
|
551
581
|
}
|
|
582
|
+
addTs2cxxFuncMapElement(funcName, methods) {
|
|
583
|
+
this.ts2cxxFuncMap.set(funcName, methods);
|
|
584
|
+
}
|
|
585
|
+
getTs2cxxFuncMap() {
|
|
586
|
+
return this.ts2cxxFuncMap;
|
|
587
|
+
}
|
|
588
|
+
getDeclareSignature() {
|
|
589
|
+
return this.classDeclareSignature;
|
|
590
|
+
}
|
|
591
|
+
setDeclareSignature(classSig) {
|
|
592
|
+
this.classDeclareSignature = classSig;
|
|
593
|
+
}
|
|
552
594
|
}
|
|
553
595
|
exports.ArkClass = ArkClass;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkField.d.ts","sourceRoot":"","sources":["../../../src/core/model/ArkField.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,YAAY,EAAgB,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,oBAAY,aAAa;IACrB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AAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI3B,WAAW,IAAI,aAAa;IAI5B,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,IAAI;IAI1C,OAAO,IAAI,MAAM;IAIjB,OAAO,IAAI,IAAI;IAIf,YAAY,IAAI,cAAc;IAI9B,YAAY,CAAC,QAAQ,EAAE,cAAc,GAAG,IAAI;IAInD;;;OAGG;IACI,cAAc,IAAI,IAAI,EAAE;IAIxB,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,GAAG,IAAI;IAIzC,gBAAgB,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI;IAI9C,mBAAmB,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI;IAIpD,gBAAgB,IAAI,OAAO;IAI3B,mBAAmB,IAAI,OAAO;IAI9B,iBAAiB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI;IAIzD;;;OAGG;IACI,iBAAiB,IAAI,eAAe;IAIpC,QAAQ,IAAI,QAAQ;IAKpB,QAAQ,IAAI,OAAO;CAa7B"}
|
|
@@ -122,7 +122,9 @@ class ArkField extends ArkBaseModel_1.ArkBaseModel {
|
|
|
122
122
|
if (!this.containsModifier(ArkBaseModel_1.ModifierType.PUBLIC) &&
|
|
123
123
|
!this.containsModifier(ArkBaseModel_1.ModifierType.PRIVATE) &&
|
|
124
124
|
!this.containsModifier(ArkBaseModel_1.ModifierType.PROTECTED) &&
|
|
125
|
-
this.getDeclaringArkClass().getCategory() === ArkClass_1.ClassCategory.CLASS
|
|
125
|
+
(this.getDeclaringArkClass().getCategory() === ArkClass_1.ClassCategory.CLASS ||
|
|
126
|
+
this.getDeclaringArkClass().getCategory() === ArkClass_1.ClassCategory.INTERFACE ||
|
|
127
|
+
this.getDeclaringArkClass().getCategory() === ArkClass_1.ClassCategory.OBJECT)) {
|
|
126
128
|
return true;
|
|
127
129
|
}
|
|
128
130
|
return this.containsModifier(ArkBaseModel_1.ModifierType.PUBLIC);
|
|
@@ -33,6 +33,7 @@ export declare class ArkFile {
|
|
|
33
33
|
private fileSignature;
|
|
34
34
|
private ohPackageJson5Path;
|
|
35
35
|
private anonymousClassNumber;
|
|
36
|
+
private anonymousNamespaceNumber;
|
|
36
37
|
private ast;
|
|
37
38
|
constructor(language: Language);
|
|
38
39
|
/**
|
|
@@ -87,7 +88,8 @@ export declare class ArkFile {
|
|
|
87
88
|
* @returns A class. If there is no class, the return will be a **null**.
|
|
88
89
|
*/
|
|
89
90
|
getClass(classSignature: ClassSignature): ArkClass | null;
|
|
90
|
-
getClassWithName(
|
|
91
|
+
getClassWithName(className: string): ArkClass | null;
|
|
92
|
+
private findClassInNamespace;
|
|
91
93
|
getClasses(): ArkClass[];
|
|
92
94
|
addNamespace(namespace: ArkNamespace): void;
|
|
93
95
|
/**
|
|
@@ -145,6 +147,7 @@ export declare class ArkFile {
|
|
|
145
147
|
setFileSignature(fileSignature: FileSignature): void;
|
|
146
148
|
getAllNamespacesUnderThisFile(): ArkNamespace[];
|
|
147
149
|
getAnonymousClassNumber(): number;
|
|
150
|
+
getAnonymousNamespaceNumber(): number;
|
|
148
151
|
getAST(): ts.SourceFile | null;
|
|
149
152
|
setAST(value: ts.SourceFile | null): void;
|
|
150
153
|
}
|