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
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2024-2025 Huawei Device Co., Ltd.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.ArkMetadataBuilder = void 0;
|
|
21
|
+
const ohos_typescript_1 = __importDefault(require("ohos-typescript"));
|
|
22
|
+
const Position_1 = require("../../base/Position");
|
|
23
|
+
const ArkMetadata_1 = require("../ArkMetadata");
|
|
24
|
+
class ArkMetadataBuilder {
|
|
25
|
+
static setComments(metadata, node, sourceFile, options) {
|
|
26
|
+
const leadingCommentsMetadata = this.getCommentsMetadata(node, sourceFile, options, true);
|
|
27
|
+
if (leadingCommentsMetadata.getComments().length > 0) {
|
|
28
|
+
metadata.setMetadata(ArkMetadata_1.ArkMetadataKind.LEADING_COMMENTS, leadingCommentsMetadata);
|
|
29
|
+
}
|
|
30
|
+
const trailingCommentsMetadata = this.getCommentsMetadata(node, sourceFile, options, false);
|
|
31
|
+
if (trailingCommentsMetadata.getComments().length > 0) {
|
|
32
|
+
metadata.setMetadata(ArkMetadata_1.ArkMetadataKind.TRAILING_COMMENTS, trailingCommentsMetadata);
|
|
33
|
+
}
|
|
34
|
+
const jsDocMetadatas = this.getJSDocMetadata(node, sourceFile, options);
|
|
35
|
+
if (jsDocMetadatas.length > 0) {
|
|
36
|
+
metadata.setMetadata(ArkMetadata_1.ArkMetadataKind.JSDOC, jsDocMetadatas);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
static getCommentsMetadata(node, sourceFile, options, isLeading) {
|
|
40
|
+
const comments = [];
|
|
41
|
+
if ((isLeading && !options.enableLeadingComments) || (!isLeading && !options.enableTrailingComments)) {
|
|
42
|
+
return new ArkMetadata_1.CommentsMetadata(comments);
|
|
43
|
+
}
|
|
44
|
+
const commentRanges = (isLeading ? ohos_typescript_1.default.getLeadingCommentRanges(sourceFile.text, node.pos) : ohos_typescript_1.default.getTrailingCommentRanges(sourceFile.text, node.end)) || [];
|
|
45
|
+
const getPosition = (pos, end) => {
|
|
46
|
+
const start = ohos_typescript_1.default.getLineAndCharacterOfPosition(sourceFile, pos);
|
|
47
|
+
const endPos = ohos_typescript_1.default.getLineAndCharacterOfPosition(sourceFile, end);
|
|
48
|
+
return new Position_1.FullPosition(start.line + 1, start.character + 1, endPos.line + 1, endPos.character + 1);
|
|
49
|
+
};
|
|
50
|
+
for (const range of commentRanges) {
|
|
51
|
+
comments.push({
|
|
52
|
+
content: sourceFile.text.substring(range.pos, range.end).replace(/\r\n/g, '\n'),
|
|
53
|
+
position: getPosition(range.pos, range.end),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
return new ArkMetadata_1.CommentsMetadata(comments);
|
|
57
|
+
}
|
|
58
|
+
static getJSDocMetadata(node, sourceFile, options) {
|
|
59
|
+
if (!options.enableJSDoc) {
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
const commentRanges = ohos_typescript_1.default.getLeadingCommentRanges(sourceFile.text, node.pos) || [];
|
|
63
|
+
const jsDocContents = commentRanges
|
|
64
|
+
.map(range => sourceFile.text.substring(range.pos, range.end).replace(/\r\n/g, '\n'))
|
|
65
|
+
.filter(content => content.startsWith('/**'));
|
|
66
|
+
if (jsDocContents.length === 0) {
|
|
67
|
+
return [];
|
|
68
|
+
}
|
|
69
|
+
const jsDocMetadatas = [];
|
|
70
|
+
for (const jsDocContent of jsDocContents) {
|
|
71
|
+
jsDocMetadatas.push(this.parseJSDocContent(jsDocContent));
|
|
72
|
+
}
|
|
73
|
+
return jsDocMetadatas;
|
|
74
|
+
}
|
|
75
|
+
static parseJSDocContent(content) {
|
|
76
|
+
const normalizedLines = content
|
|
77
|
+
.split('\n')
|
|
78
|
+
.map(line => line.replace(/^\s*\/\*\*?/, '').replace(/\*\/\s*$/, '').replace(/^\s*\*\s?/, '').trim());
|
|
79
|
+
const descriptionLines = [];
|
|
80
|
+
const params = [];
|
|
81
|
+
const tags = [];
|
|
82
|
+
const returns = [];
|
|
83
|
+
const throws = [];
|
|
84
|
+
for (const line of normalizedLines) {
|
|
85
|
+
this.parseJSDocLine(line, descriptionLines, params, returns, throws, tags);
|
|
86
|
+
}
|
|
87
|
+
const description = descriptionLines.join('\n').trim();
|
|
88
|
+
return new ArkMetadata_1.JSDocMetadata(description, params, tags, returns, throws);
|
|
89
|
+
}
|
|
90
|
+
static parseJSDocLine(line, descriptionLines, params, returns, throws, tags) {
|
|
91
|
+
if (!line) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (!line.startsWith('@')) {
|
|
95
|
+
descriptionLines.push(line);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (this.tryParseParam(line, params)) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (this.tryParseReturns(line, returns)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (this.tryParseThrows(line, throws)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
this.tryParseGenericTag(line, tags);
|
|
108
|
+
}
|
|
109
|
+
static tryParseParam(line, params) {
|
|
110
|
+
const match = line.match(ArkMetadataBuilder.PARAM_TAG_REGEX);
|
|
111
|
+
if (!match) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
params.push({
|
|
115
|
+
name: match[2],
|
|
116
|
+
type: match[1].trim(),
|
|
117
|
+
description: match[3].trim(),
|
|
118
|
+
});
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
static tryParseReturns(line, returns) {
|
|
122
|
+
var _a;
|
|
123
|
+
const match = line.match(ArkMetadataBuilder.RETURNS_TAG_REGEX);
|
|
124
|
+
if (!match) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
returns.push({
|
|
128
|
+
type: (_a = match[1]) === null || _a === void 0 ? void 0 : _a.trim(),
|
|
129
|
+
description: match[2].trim(),
|
|
130
|
+
});
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
static tryParseThrows(line, throws) {
|
|
134
|
+
var _a;
|
|
135
|
+
const match = line.match(ArkMetadataBuilder.THROWS_TAG_REGEX);
|
|
136
|
+
if (!match) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
throws.push({
|
|
140
|
+
type: (_a = match[1]) === null || _a === void 0 ? void 0 : _a.trim(),
|
|
141
|
+
description: match[2].trim(),
|
|
142
|
+
});
|
|
143
|
+
return true;
|
|
144
|
+
}
|
|
145
|
+
static tryParseGenericTag(line, tags) {
|
|
146
|
+
const match = line.match(ArkMetadataBuilder.GENERIC_TAG_REGEX);
|
|
147
|
+
if (!match) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
tags.push({
|
|
151
|
+
name: match[1],
|
|
152
|
+
description: match[2].trim(),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.ArkMetadataBuilder = ArkMetadataBuilder;
|
|
157
|
+
ArkMetadataBuilder.PARAM_TAG_REGEX = /^@param\s+\{\s*([^}]+?)\s*\}\s+([^\s-]+)\s*(?:-\s*)?(.*)$/;
|
|
158
|
+
ArkMetadataBuilder.RETURNS_TAG_REGEX = /^@returns?\s*(?:\{\s*([^}]+?)\s*\})?\s*(.*)$/;
|
|
159
|
+
ArkMetadataBuilder.THROWS_TAG_REGEX = /^@throws\s*(?:\{\s*([^}]+?)\s*\})?\s*(.*)$/;
|
|
160
|
+
ArkMetadataBuilder.GENERIC_TAG_REGEX = /^@([^\s]+)\s*(.*)$/;
|
|
@@ -8,6 +8,7 @@ import { Value } from '../../base/Value';
|
|
|
8
8
|
export type MethodLikeNode = ts.FunctionDeclaration | ts.MethodDeclaration | ts.ConstructorDeclaration | ts.ArrowFunction | ts.AccessorDeclaration | ts.FunctionExpression | ts.MethodSignature | ts.ConstructSignatureDeclaration | ts.CallSignatureDeclaration | ts.FunctionTypeNode;
|
|
9
9
|
export declare function buildDefaultArkMethodFromArkClass(declaringClass: ArkClass, mtd: ArkMethod, sourceFile: ts.SourceFile, node?: ts.ModuleDeclaration): void;
|
|
10
10
|
export declare function buildArkMethodFromArkClass(methodNode: MethodLikeNode, declaringClass: ArkClass, mtd: ArkMethod, sourceFile: ts.SourceFile, declaringMethod?: ArkMethod): void;
|
|
11
|
+
export declare function buildNestedMethodName(originName: string, declaringMethodName: string): string;
|
|
11
12
|
export declare class ObjectBindingPatternParameter {
|
|
12
13
|
private propertyName;
|
|
13
14
|
private name;
|
|
@@ -56,10 +57,12 @@ export declare class MethodParameter implements Value {
|
|
|
56
57
|
setArrayElements(arrayElements: ArrayBindingPatternParameter[]): void;
|
|
57
58
|
getUses(): Value[];
|
|
58
59
|
}
|
|
59
|
-
export declare function
|
|
60
|
+
export declare function needDefaultConstructorInClass(arkClass: ArkClass): boolean;
|
|
61
|
+
export declare function buildDefaultConstructor(arkClass: ArkClass, visited?: Set<ArkClass>): boolean;
|
|
60
62
|
export declare function buildInitMethod(initMethod: ArkMethod, fieldInitializerStmts: Stmt[], thisLocal: Local): void;
|
|
61
63
|
export declare function addInitInConstructor(constructor: ArkMethod): void;
|
|
62
64
|
export declare function isMethodImplementation(node: MethodLikeNode): boolean;
|
|
63
65
|
export declare function checkAndUpdateMethod(method: ArkMethod, cls: ArkClass): void;
|
|
66
|
+
export declare function updateMethodSignaturesAndLineCols(method: ArkMethod, presentMethod: ArkMethod): void;
|
|
64
67
|
export declare function replaceSuper2Constructor(constructor: ArkMethod): void;
|
|
65
68
|
//# sourceMappingURL=ArkMethodBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkMethodBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkMethodBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAa,IAAI,EAAe,MAAM,iBAAiB,CAAC;AAG/D,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAgBjC,OAAO,EAAkE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvG,OAAO,EAAE,KAAK,EA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E,qBAAqB,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,CAuB5G;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,CA+BjE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAepE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAW3E;AAED,wBAAgB,iCAAiC,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,GAAG,IAAI,CA4BnG;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,CA8CrE"}
|
|
@@ -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.replaceSuper2Constructor = exports.checkAndUpdateMethod = exports.isMethodImplementation = exports.addInitInConstructor = exports.buildInitMethod = exports.buildDefaultConstructor = exports.MethodParameter = exports.ArrayBindingPatternParameter = exports.ObjectBindingPatternParameter = exports.buildArkMethodFromArkClass = exports.buildDefaultArkMethodFromArkClass = void 0;
|
|
43
|
+
exports.replaceSuper2Constructor = exports.updateMethodSignaturesAndLineCols = exports.checkAndUpdateMethod = exports.isMethodImplementation = exports.addInitInConstructor = exports.buildInitMethod = exports.buildDefaultConstructor = exports.needDefaultConstructorInClass = exports.MethodParameter = exports.ArrayBindingPatternParameter = exports.ObjectBindingPatternParameter = exports.buildNestedMethodName = exports.buildArkMethodFromArkClass = exports.buildDefaultArkMethodFromArkClass = void 0;
|
|
44
44
|
const Type_1 = require("../../base/Type");
|
|
45
45
|
const BodyBuilder_1 = require("./BodyBuilder");
|
|
46
46
|
const ViewTreeBuilder_1 = require("../../graph/builder/ViewTreeBuilder");
|
|
@@ -161,7 +161,7 @@ function buildMethodName(node, declaringClass, sourceFile, declaringMethod) {
|
|
|
161
161
|
name = TSConst_1.CONSTRUCTOR_NAME;
|
|
162
162
|
}
|
|
163
163
|
else if (ohos_typescript_1.default.isConstructSignatureDeclaration(node)) {
|
|
164
|
-
name =
|
|
164
|
+
name = Const_1.CONSTRUCT_SIGNATURE_NAME;
|
|
165
165
|
}
|
|
166
166
|
else if (ohos_typescript_1.default.isCallSignatureDeclaration(node)) {
|
|
167
167
|
name = Const_1.CALL_SIGNATURE_NAME;
|
|
@@ -189,6 +189,7 @@ function buildNestedMethodName(originName, declaringMethodName) {
|
|
|
189
189
|
}
|
|
190
190
|
return `${Const_1.NAME_PREFIX}${originName}${Const_1.NAME_DELIMITER}${declaringMethodName}`;
|
|
191
191
|
}
|
|
192
|
+
exports.buildNestedMethodName = buildNestedMethodName;
|
|
192
193
|
class ObjectBindingPatternParameter {
|
|
193
194
|
constructor() {
|
|
194
195
|
this.propertyName = '';
|
|
@@ -300,24 +301,33 @@ function needDefaultConstructorInClass(arkClass) {
|
|
|
300
301
|
const originClassType = arkClass.getCategory();
|
|
301
302
|
return (arkClass.getMethodWithName(TSConst_1.CONSTRUCTOR_NAME) === null &&
|
|
302
303
|
(originClassType === ArkClass_1.ClassCategory.CLASS || originClassType === ArkClass_1.ClassCategory.OBJECT) &&
|
|
303
|
-
arkClass.
|
|
304
|
+
!arkClass.isDefaultArkClass() &&
|
|
305
|
+
!arkClass.isLibraryClass() &&
|
|
304
306
|
!arkClass.isDeclare());
|
|
305
307
|
}
|
|
306
|
-
|
|
308
|
+
exports.needDefaultConstructorInClass = needDefaultConstructorInClass;
|
|
309
|
+
function recursivelyCheckAndBuildSuperConstructor(arkClass, visited = new Set()) {
|
|
310
|
+
if (visited.has(arkClass)) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
visited.add(arkClass);
|
|
307
314
|
let superClass = arkClass.getSuperClass();
|
|
308
315
|
while (superClass !== null) {
|
|
316
|
+
if (visited.has(superClass)) {
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
309
319
|
if (superClass.getMethodWithName(TSConst_1.CONSTRUCTOR_NAME) === null) {
|
|
310
|
-
buildDefaultConstructor(superClass);
|
|
320
|
+
buildDefaultConstructor(superClass, visited);
|
|
311
321
|
}
|
|
312
322
|
superClass = superClass.getSuperClass();
|
|
313
323
|
}
|
|
314
324
|
}
|
|
315
|
-
function buildDefaultConstructor(arkClass) {
|
|
325
|
+
function buildDefaultConstructor(arkClass, visited = new Set()) {
|
|
316
326
|
var _a;
|
|
327
|
+
recursivelyCheckAndBuildSuperConstructor(arkClass, visited);
|
|
317
328
|
if (!needDefaultConstructorInClass(arkClass)) {
|
|
318
329
|
return false;
|
|
319
330
|
}
|
|
320
|
-
recursivelyCheckAndBuildSuperConstructor(arkClass);
|
|
321
331
|
const defaultConstructor = new ArkMethod_1.ArkMethod();
|
|
322
332
|
defaultConstructor.setDeclaringArkClass(arkClass);
|
|
323
333
|
defaultConstructor.setCode('');
|
|
@@ -444,6 +454,10 @@ function checkAndUpdateMethod(method, cls) {
|
|
|
444
454
|
if (presentMethod === null) {
|
|
445
455
|
return;
|
|
446
456
|
}
|
|
457
|
+
updateMethodSignaturesAndLineCols(method, presentMethod);
|
|
458
|
+
}
|
|
459
|
+
exports.checkAndUpdateMethod = checkAndUpdateMethod;
|
|
460
|
+
function updateMethodSignaturesAndLineCols(method, presentMethod) {
|
|
447
461
|
if (method.validate().errCode !== ArkError_1.ArkErrorCode.OK || presentMethod.validate().errCode !== ArkError_1.ArkErrorCode.OK) {
|
|
448
462
|
return;
|
|
449
463
|
}
|
|
@@ -472,43 +486,50 @@ function checkAndUpdateMethod(method, cls) {
|
|
|
472
486
|
return;
|
|
473
487
|
}
|
|
474
488
|
}
|
|
475
|
-
exports.
|
|
489
|
+
exports.updateMethodSignaturesAndLineCols = updateMethodSignaturesAndLineCols;
|
|
476
490
|
function replaceSuper2Constructor(constructor) {
|
|
477
|
-
var _a, _b;
|
|
491
|
+
var _a, _b, _c;
|
|
478
492
|
if (constructor.getName() !== TSConst_1.CONSTRUCTOR_NAME) {
|
|
479
493
|
return;
|
|
480
494
|
}
|
|
495
|
+
const startingBlock = (_a = constructor.getBody()) === null || _a === void 0 ? void 0 : _a.getCfg().getStartingBlock();
|
|
496
|
+
if (startingBlock === undefined) {
|
|
497
|
+
return;
|
|
498
|
+
}
|
|
499
|
+
let superInvokeStmt = null;
|
|
500
|
+
for (const stmt of startingBlock.getStmts()) {
|
|
501
|
+
if (stmt instanceof Stmt_1.ArkInvokeStmt) {
|
|
502
|
+
let invokeExpr = stmt.getInvokeExpr();
|
|
503
|
+
const methodSignature = invokeExpr.getMethodSignature();
|
|
504
|
+
if (methodSignature.getMethodSubSignature().getMethodName() === TSConst_1.SUPER_NAME) {
|
|
505
|
+
superInvokeStmt = stmt;
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
if (!superInvokeStmt) {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
// If there are superInvokeStmt, then there must have constructor of its super class.
|
|
481
514
|
const superClass = constructor.getDeclaringArkClass().getSuperClass();
|
|
482
515
|
if (superClass === null) {
|
|
516
|
+
logger.error(`Can not find super class for class ${constructor.getDeclaringArkClass().getSignature().toString()}`);
|
|
483
517
|
return;
|
|
484
518
|
}
|
|
485
|
-
const superConstructor = superClass.getMethodWithName(TSConst_1.CONSTRUCTOR_NAME);
|
|
519
|
+
const superConstructor = (_b = superClass.getMethodWithName(TSConst_1.CONSTRUCTOR_NAME)) !== null && _b !== void 0 ? _b : superClass.getMethodWithName(Const_1.CONSTRUCT_SIGNATURE_NAME);
|
|
486
520
|
if (superConstructor === null) {
|
|
487
521
|
if (needDefaultConstructorInClass(superClass)) {
|
|
488
522
|
logger.error(`Can not find constructor method for class ${superClass.getSignature().toString()}`);
|
|
489
523
|
}
|
|
490
524
|
return;
|
|
491
525
|
}
|
|
492
|
-
|
|
493
|
-
if (
|
|
526
|
+
let base = (_c = constructor.getBody()) === null || _c === void 0 ? void 0 : _c.getLocals().get(TSConst_1.THIS_NAME);
|
|
527
|
+
if (base === undefined) {
|
|
528
|
+
logger.error(`Can not find local this in constructor method ${constructor.getSignature().toString()}`);
|
|
494
529
|
return;
|
|
495
530
|
}
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
const methodSignature = invokeExpr.getMethodSignature();
|
|
500
|
-
if (methodSignature.getMethodSubSignature().getMethodName() !== TSConst_1.SUPER_NAME) {
|
|
501
|
-
continue;
|
|
502
|
-
}
|
|
503
|
-
let base = (_b = constructor.getBody()) === null || _b === void 0 ? void 0 : _b.getLocals().get(TSConst_1.THIS_NAME);
|
|
504
|
-
if (base === undefined) {
|
|
505
|
-
logger.error(`Can not find local this in constructor method ${constructor.getSignature().toString()}`);
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
const newInvokeExpr = new Expr_1.ArkInstanceInvokeExpr(base, superConstructor.getSignature(), invokeExpr.getArgs());
|
|
509
|
-
stmt.replaceInvokeExpr(newInvokeExpr);
|
|
510
|
-
return;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
531
|
+
const newInvokeExpr = new Expr_1.ArkInstanceInvokeExpr(base, superConstructor.getSignature(), superInvokeStmt.getInvokeExpr().getArgs());
|
|
532
|
+
superInvokeStmt.replaceInvokeExpr(newInvokeExpr);
|
|
533
|
+
return;
|
|
513
534
|
}
|
|
514
535
|
exports.replaceSuper2Constructor = replaceSuper2Constructor;
|
|
@@ -2,5 +2,6 @@ import { ArkFile } from '../ArkFile';
|
|
|
2
2
|
import ts from 'ohos-typescript';
|
|
3
3
|
import { ArkNamespace } from '../ArkNamespace';
|
|
4
4
|
export declare function buildArkNamespace(node: ts.ModuleDeclaration, declaringInstance: ArkFile | ArkNamespace, ns: ArkNamespace, sourceFile: ts.SourceFile): void;
|
|
5
|
+
export declare function genDefaultArkClass(ns: ArkNamespace, node: ts.ModuleDeclaration, sourceFile: ts.SourceFile): void;
|
|
5
6
|
export declare function mergeNameSpaces(arkNamespaces: ArkNamespace[]): ArkNamespace[];
|
|
6
7
|
//# sourceMappingURL=ArkNamespaceBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkNamespaceBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkNamespaceBuilder.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAW/C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,GAAG,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,IAAI,CAqD1J;
|
|
1
|
+
{"version":3,"file":"ArkNamespaceBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkNamespaceBuilder.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAW/C,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,OAAO,GAAG,YAAY,EAAE,EAAE,EAAE,YAAY,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,IAAI,CAqD1J;AA+DD,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,IAAI,CAMhH;AAED,wBAAgB,eAAe,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CA4B7E"}
|
|
@@ -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.mergeNameSpaces = exports.buildArkNamespace = void 0;
|
|
43
|
+
exports.mergeNameSpaces = exports.genDefaultArkClass = exports.buildArkNamespace = void 0;
|
|
44
44
|
const Position_1 = require("../../base/Position");
|
|
45
45
|
const ArkClassBuilder_1 = require("./ArkClassBuilder");
|
|
46
46
|
const ArkFile_1 = require("../ArkFile");
|
|
@@ -170,6 +170,7 @@ function genDefaultArkClass(ns, node, sourceFile) {
|
|
|
170
170
|
ns.setDefaultClass(defaultClass);
|
|
171
171
|
ns.addArkClass(defaultClass);
|
|
172
172
|
}
|
|
173
|
+
exports.genDefaultArkClass = genDefaultArkClass;
|
|
173
174
|
function mergeNameSpaces(arkNamespaces) {
|
|
174
175
|
const namespaceMap = new Map();
|
|
175
176
|
for (let i = 0; i < arkNamespaces.length; i++) {
|
|
@@ -5,6 +5,10 @@ import { CfgBuilder } from '../../graph/builder/CfgBuilder';
|
|
|
5
5
|
import * as ts from 'ohos-typescript';
|
|
6
6
|
import { GlobalRef } from '../../base/Ref';
|
|
7
7
|
import { FullPosition } from '../../base/Position';
|
|
8
|
+
export type NestedMethodChain = {
|
|
9
|
+
parent: ArkMethod;
|
|
10
|
+
children: NestedMethodChain[] | null;
|
|
11
|
+
};
|
|
8
12
|
export declare class BodyBuilder {
|
|
9
13
|
private cfgBuilder;
|
|
10
14
|
private globals?;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BodyBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/BodyBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OA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G,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI;IAIjD,kBAAkB,IAAI,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC;IAI/C,kBAAkB,CAAC,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,IAAI;IAI1E;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAiChC;;;;;OAKG;IACH,OAAO,CAAC,eAAe;IA2BvB;;;;;OAKG;IACI,sBAAsB,IAAI,IAAI;IAwDrC,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,6BAA6B;IASrC,OAAO,CAAC,sCAAsC;IA4B9C,OAAO,CAAC,0BAA0B;IAiBlC,OAAO,CAAC,uBAAuB;IAgB/B,OAAO,CAAC,8BAA8B;IAmBtC,OAAO,CAAC,wBAAwB;IAuBhC,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,6BAA6B;IAyCrC,OAAO,CAAC,8BAA8B;IAkBtC,OAAO,CAAC,6BAA6B;IA2BrC,OAAO,CAAC,2BAA2B;IAUnC,OAAO,CAAC,4BAA4B;IAqBpC,OAAO,CAAC,2BAA2B;IAwBnC,OAAO,CAAC,oCAAoC;IA+B5C,OAAO,CAAC,8BAA8B;IAWtC,OAAO,CAAC,qCAAqC;IA8B7C,OAAO,CAAC,2BAA2B;CA8CtC"}
|
|
@@ -9,6 +9,7 @@ import { FullPosition } from '../../base/Position';
|
|
|
9
9
|
export declare function handleQualifiedName(node: ts.QualifiedName): string;
|
|
10
10
|
export declare function handlePropertyAccessExpression(node: ts.PropertyAccessExpression): string;
|
|
11
11
|
export declare function buildDecorators(node: ts.Node, sourceFile: ts.SourceFile): Set<Decorator>;
|
|
12
|
+
export declare function parseDecorator(node: ts.Decorator): Decorator | undefined;
|
|
12
13
|
export declare function buildModifiers(node: ts.Node): number;
|
|
13
14
|
export declare function buildHeritageClauses(heritageClauses?: ts.NodeArray<HeritageClause>): Map<string, string>;
|
|
14
15
|
export declare function buildTypeParameters(typeParameters: ts.NodeArray<TypeParameterDeclaration>, sourceFile: ts.SourceFile, arkInstance: ArkMethod | ArkClass): GenericType[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builderUtils.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/builderUtils.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC/G,OAAO,EACH,SAAS,EAIT,WAAW,EAGX,IAAI,EAIP,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,
|
|
1
|
+
{"version":3,"file":"builderUtils.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/builderUtils.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,oBAAoB,EAAE,QAAQ,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC/G,OAAO,EACH,SAAS,EAIT,WAAW,EAGX,IAAI,EAIP,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAA4D,eAAe,EAAiC,MAAM,oBAAoB,CAAC;AAsB9I,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAInD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,G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GAAG,EAAE,CAAC,wBAAwB,EACnD,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,WAAW,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAC7C,IAAI,CA8FN;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAiDxD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2024-
|
|
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
|
|
@@ -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.buildTypeFromPreStr = exports.tsNode2Type = exports.buildReturnType = exports.buildGenericType = exports.buildParameters = exports.buildTypeParameters = exports.buildHeritageClauses = exports.buildModifiers = exports.buildDecorators = exports.handlePropertyAccessExpression = exports.handleQualifiedName = void 0;
|
|
43
|
+
exports.buildTypeFromPreStr = exports.tsNode2Type = exports.buildReturnType = exports.buildGenericType = exports.buildParameters = exports.buildTypeParameters = exports.buildHeritageClauses = exports.buildModifiers = exports.parseDecorator = exports.buildDecorators = exports.handlePropertyAccessExpression = exports.handleQualifiedName = void 0;
|
|
44
44
|
const ohos_typescript_1 = __importDefault(require("ohos-typescript"));
|
|
45
45
|
const Type_1 = require("../../base/Type");
|
|
46
46
|
const TypeInference_1 = require("../../common/TypeInference");
|
|
@@ -122,6 +122,7 @@ function parseDecorator(node) {
|
|
|
122
122
|
}
|
|
123
123
|
return decorator;
|
|
124
124
|
}
|
|
125
|
+
exports.parseDecorator = parseDecorator;
|
|
125
126
|
function buildModifiers(node) {
|
|
126
127
|
var _a;
|
|
127
128
|
let modifiers = 0;
|
|
@@ -362,7 +363,10 @@ function buildGenericType(type, arkInstance) {
|
|
|
362
363
|
}
|
|
363
364
|
exports.buildGenericType = buildGenericType;
|
|
364
365
|
function buildReturnType(node, sourceFile, method) {
|
|
365
|
-
if (node) {
|
|
366
|
+
if (node.kind === ohos_typescript_1.default.SyntaxKind.ThisType) {
|
|
367
|
+
return new Type_1.ClassType(method.getDeclaringArkClass().getSignature(), method.getDeclaringArkClass().getGenericsTypes());
|
|
368
|
+
}
|
|
369
|
+
else if (node) {
|
|
366
370
|
return tsNode2Type(node, sourceFile, method);
|
|
367
371
|
}
|
|
368
372
|
else {
|