arkanalyzer 1.0.32 → 1.0.34
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/config/arkanalyzer.json +1 -0
- package/lib/Config.d.ts +1 -0
- package/lib/Config.d.ts.map +1 -1
- package/lib/Config.js +26 -18
- package/lib/Scene.d.ts +5 -5
- package/lib/Scene.d.ts.map +1 -1
- package/lib/Scene.js +21 -19
- package/lib/VFG/DVFG.d.ts.map +1 -1
- package/lib/VFG/builder/DVFGBuilder.d.ts +2 -2
- package/lib/VFG/builder/DVFGBuilder.d.ts.map +1 -1
- package/lib/VFG/builder/DVFGBuilder.js +15 -7
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts +1 -0
- package/lib/callgraph/algorithm/AbstractAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/AbstractAnalysis.js +24 -8
- package/lib/callgraph/algorithm/ClassHierarchyAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/ClassHierarchyAnalysis.js +3 -2
- package/lib/callgraph/algorithm/RapidTypeAnalysis.d.ts.map +1 -1
- package/lib/callgraph/algorithm/RapidTypeAnalysis.js +4 -3
- package/lib/callgraph/common/Statistics.d.ts +9 -7
- package/lib/callgraph/common/Statistics.d.ts.map +1 -1
- package/lib/callgraph/common/Statistics.js +18 -6
- package/lib/callgraph/model/CallGraph.d.ts +2 -0
- package/lib/callgraph/model/CallGraph.d.ts.map +1 -1
- package/lib/callgraph/model/CallGraph.js +14 -8
- 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 +9 -4
- package/lib/callgraph/pointerAnalysis/Context.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/Context.js +2 -2
- package/lib/callgraph/pointerAnalysis/DummyCallCreator.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/DummyCallCreator.js +4 -2
- package/lib/callgraph/pointerAnalysis/PTAUtils.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PTAUtils.js +2 -3
- package/lib/callgraph/pointerAnalysis/Pag.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/Pag.js +27 -35
- package/lib/callgraph/pointerAnalysis/PagBuilder.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PagBuilder.js +63 -46
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PointerAnalysis.js +12 -12
- package/lib/callgraph/pointerAnalysis/PointerAnalysisConfig.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PtsDS.d.ts +1 -1
- package/lib/callgraph/pointerAnalysis/PtsDS.d.ts.map +1 -1
- package/lib/callgraph/pointerAnalysis/PtsDS.js +10 -6
- package/lib/core/base/Constant.js +2 -2
- package/lib/core/base/DefUseChain.d.ts.map +1 -1
- package/lib/core/base/DefUseChain.js +1 -1
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +3 -5
- package/lib/core/base/Local.d.ts.map +1 -1
- package/lib/core/base/Local.js +7 -2
- package/lib/core/base/Position.d.ts.map +1 -1
- package/lib/core/base/Position.js +1 -1
- package/lib/core/base/Ref.d.ts.map +1 -1
- package/lib/core/base/Ref.js +3 -1
- package/lib/core/base/Stmt.d.ts.map +1 -1
- package/lib/core/base/Stmt.js +1 -4
- package/lib/core/base/Trap.js +1 -1
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +2 -2
- package/lib/core/base/Value.d.ts +1 -1
- package/lib/core/base/Value.d.ts.map +1 -1
- package/lib/core/base/Value.js +1 -1
- package/lib/core/common/ArkError.js +1 -1
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +46 -36
- package/lib/core/common/ArkValueTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkValueTransformer.js +295 -109
- package/lib/core/common/Builtin.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +10 -4
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +3 -12
- package/lib/core/common/ExprUseReplacer.js +1 -1
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +40 -20
- package/lib/core/common/IRUtils.d.ts.map +1 -1
- package/lib/core/common/IRUtils.js +5 -4
- package/lib/core/common/ModelUtils.d.ts +1 -1
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +40 -29
- package/lib/core/common/RefUseReplacer.js +1 -1
- package/lib/core/common/SdkUtils.d.ts +3 -0
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +29 -10
- package/lib/core/common/StmtDefReplacer.d.ts.map +1 -1
- package/lib/core/common/StmtDefReplacer.js +1 -1
- package/lib/core/common/StmtUseReplacer.d.ts.map +1 -1
- package/lib/core/common/StmtUseReplacer.js +1 -1
- package/lib/core/common/TSConst.d.ts.map +1 -1
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +25 -17
- package/lib/core/common/ValueUtil.d.ts.map +1 -1
- package/lib/core/common/ValueUtil.js +1 -1
- package/lib/core/common/VisibleValue.d.ts.map +1 -1
- package/lib/core/common/VisibleValue.js +5 -5
- package/lib/core/dataflow/DataflowProblem.d.ts.map +1 -1
- package/lib/core/dataflow/DataflowProblem.js +1 -1
- package/lib/core/dataflow/DataflowResult.js +1 -1
- package/lib/core/dataflow/DataflowSolver.d.ts.map +1 -1
- package/lib/core/dataflow/DataflowSolver.js +5 -3
- package/lib/core/dataflow/Edge.d.ts.map +1 -1
- package/lib/core/dataflow/Edge.js +1 -1
- package/lib/core/dataflow/Fact.js +1 -1
- package/lib/core/dataflow/GenericDataFlow.js +5 -5
- package/lib/core/dataflow/ReachingDef.js +4 -4
- package/lib/core/dataflow/UndefinedVariable.d.ts.map +1 -1
- package/lib/core/dataflow/UndefinedVariable.js +17 -13
- package/lib/core/dataflow/Util.d.ts +4 -4
- package/lib/core/dataflow/Util.d.ts.map +1 -1
- package/lib/core/dataflow/Util.js +3 -5
- package/lib/core/graph/BaseExplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BaseExplicitGraph.js +1 -1
- package/lib/core/graph/BaseImplicitGraph.d.ts.map +1 -1
- package/lib/core/graph/BasicBlock.d.ts.map +1 -1
- package/lib/core/graph/BasicBlock.js +11 -7
- package/lib/core/graph/Cfg.d.ts.map +1 -1
- package/lib/core/graph/Cfg.js +10 -4
- package/lib/core/graph/DependsGraph.d.ts.map +1 -1
- package/lib/core/graph/DependsGraph.js +1 -1
- package/lib/core/graph/DominanceFinder.d.ts.map +1 -1
- package/lib/core/graph/DominanceFinder.js +4 -4
- package/lib/core/graph/DominanceTree.js +1 -1
- package/lib/core/graph/GraphTraits.js +1 -1
- package/lib/core/graph/Scc.js +2 -2
- package/lib/core/graph/ViewTree.js +1 -1
- package/lib/core/graph/builder/CfgBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/CfgBuilder.js +22 -13
- package/lib/core/graph/builder/ConditionBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/ConditionBuilder.js +21 -22
- package/lib/core/graph/builder/LoopBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/LoopBuilder.js +13 -10
- package/lib/core/graph/builder/SwitchBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/SwitchBuilder.js +7 -4
- package/lib/core/graph/builder/TrapBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/TrapBuilder.js +4 -3
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/ViewTreeBuilder.js +18 -19
- package/lib/core/model/ArkBaseModel.d.ts.map +1 -1
- package/lib/core/model/ArkBaseModel.js +8 -5
- package/lib/core/model/ArkBody.d.ts +1 -0
- package/lib/core/model/ArkBody.d.ts.map +1 -1
- package/lib/core/model/ArkBody.js +11 -1
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +3 -5
- package/lib/core/model/ArkExport.d.ts +4 -0
- package/lib/core/model/ArkExport.d.ts.map +1 -1
- package/lib/core/model/ArkExport.js +8 -1
- package/lib/core/model/ArkField.d.ts.map +1 -1
- package/lib/core/model/ArkField.js +2 -2
- package/lib/core/model/ArkFile.d.ts +1 -0
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +21 -6
- package/lib/core/model/ArkImport.d.ts.map +1 -1
- package/lib/core/model/ArkImport.js +1 -1
- package/lib/core/model/ArkMetadata.d.ts.map +1 -1
- package/lib/core/model/ArkMetadata.js +1 -1
- package/lib/core/model/ArkMethod.d.ts +6 -5
- package/lib/core/model/ArkMethod.d.ts.map +1 -1
- package/lib/core/model/ArkMethod.js +27 -13
- package/lib/core/model/ArkNamespace.d.ts +1 -1
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +5 -6
- package/lib/core/model/ArkSignature.d.ts +4 -2
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +17 -17
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +15 -16
- package/lib/core/model/builder/ArkExportBuilder.d.ts +2 -1
- package/lib/core/model/builder/ArkExportBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkExportBuilder.js +17 -11
- package/lib/core/model/builder/ArkFieldBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkFieldBuilder.js +6 -7
- package/lib/core/model/builder/ArkFileBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkFileBuilder.js +22 -11
- package/lib/core/model/builder/ArkImportBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkImportBuilder.js +13 -8
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +3 -3
- package/lib/core/model/builder/ArkNamespaceBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkNamespaceBuilder.js +7 -9
- package/lib/core/model/builder/ArkSignatureBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkSignatureBuilder.js +1 -1
- package/lib/core/model/builder/BodyBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/BodyBuilder.js +8 -5
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +15 -13
- package/lib/index.d.ts.map +1 -1
- package/lib/save/ArkStream.d.ts.map +1 -1
- package/lib/save/ArkStream.js +1 -1
- package/lib/save/DotPrinter.d.ts.map +1 -1
- package/lib/save/DotPrinter.js +2 -4
- package/lib/save/GraphPrinter.d.ts.map +1 -1
- package/lib/save/GraphPrinter.js +2 -3
- package/lib/save/JsonPrinter.d.ts.map +1 -1
- package/lib/save/JsonPrinter.js +29 -29
- package/lib/save/Printer.js +1 -1
- package/lib/save/PrinterBuilder.d.ts.map +1 -1
- package/lib/save/PrinterBuilder.js +1 -1
- package/lib/save/ViewTreePrinter.d.ts.map +1 -1
- package/lib/save/ViewTreePrinter.js +3 -3
- package/lib/save/arkir/ArkIRClassPrinter.js +1 -1
- package/lib/save/arkir/ArkIRMethodPrinter.js +5 -5
- package/lib/save/arkir/ArkIRNamespacePrinter.d.ts.map +1 -1
- package/lib/save/arkir/ArkIRNamespacePrinter.js +2 -3
- package/lib/save/base/BasePrinter.js +2 -2
- package/lib/save/base/ExportPrinter.d.ts.map +1 -1
- package/lib/save/base/ExportPrinter.js +3 -6
- package/lib/save/base/ImportPrinter.d.ts.map +1 -1
- package/lib/save/base/ImportPrinter.js +2 -6
- package/lib/save/base/PrinterUtils.d.ts.map +1 -1
- package/lib/save/base/PrinterUtils.js +2 -4
- package/lib/save/serializeArkIR.d.ts.map +1 -1
- package/lib/save/serializeArkIR.js +2 -2
- package/lib/save/source/SourceBase.d.ts.map +1 -1
- package/lib/save/source/SourceBase.js +1 -3
- package/lib/save/source/SourceBody.d.ts.map +1 -1
- package/lib/save/source/SourceBody.js +1 -5
- package/lib/save/source/SourceClass.d.ts.map +1 -1
- package/lib/save/source/SourceClass.js +2 -3
- package/lib/save/source/SourceField.js +2 -2
- package/lib/save/source/SourceFilePrinter.d.ts.map +1 -1
- package/lib/save/source/SourceMethod.d.ts.map +1 -1
- package/lib/save/source/SourceMethod.js +5 -6
- package/lib/save/source/SourceNamespace.d.ts.map +1 -1
- package/lib/save/source/SourceNamespace.js +2 -3
- package/lib/save/source/SourceStmt.d.ts.map +1 -1
- package/lib/save/source/SourceStmt.js +9 -14
- package/lib/save/source/SourceTransformer.d.ts.map +1 -1
- package/lib/save/source/SourceTransformer.js +6 -10
- package/lib/transformer/FunctionTransformer.d.ts.map +1 -1
- package/lib/transformer/FunctionTransformer.js +1 -1
- package/lib/transformer/SceneTransformer.d.ts.map +1 -1
- package/lib/transformer/SceneTransformer.js +1 -1
- package/lib/transformer/StaticSingleAssignmentFormer.d.ts.map +1 -1
- package/lib/transformer/StaticSingleAssignmentFormer.js +1 -1
- package/lib/transformer/Transformer.d.ts.map +1 -1
- package/lib/transformer/Transformer.js +2 -3
- package/lib/utils/AstTreeUtils.d.ts.map +1 -1
- package/lib/utils/AstTreeUtils.js +1 -1
- package/lib/utils/CfgStructualAnalysis.d.ts.map +1 -1
- package/lib/utils/CfgStructualAnalysis.js +6 -18
- package/lib/utils/FileUtils.d.ts.map +1 -1
- package/lib/utils/FileUtils.js +7 -7
- package/lib/utils/SparseBitVector.d.ts.map +1 -1
- package/lib/utils/SparseBitVector.js +6 -5
- package/lib/utils/callGraphUtils.d.ts.map +1 -1
- package/lib/utils/callGraphUtils.js +9 -7
- package/lib/utils/crypto_utils.d.ts.map +1 -1
- package/lib/utils/crypto_utils.js +2 -2
- package/lib/utils/entryMethodUtils.d.ts.map +1 -1
- package/lib/utils/entryMethodUtils.js +18 -18
- package/lib/utils/getAllFiles.d.ts.map +1 -1
- package/lib/utils/json5parser.d.ts.map +1 -1
- package/lib/utils/json5parser.js +1 -1
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/pathTransfer.d.ts +0 -1
- package/lib/utils/pathTransfer.d.ts.map +1 -1
- package/lib/utils/pathTransfer.js +2 -11
- package/package.json +2 -2
|
@@ -59,9 +59,24 @@ const EtsConst_1 = require("../../common/EtsConst");
|
|
|
59
59
|
const ArkSignature_1 = require("../ArkSignature");
|
|
60
60
|
const Const_1 = require("../../common/Const");
|
|
61
61
|
const logger = logger_1.default.getLogger(logger_1.LOG_MODULE_TYPE.ARKANALYZER, 'ArkFileBuilder');
|
|
62
|
-
exports.notStmtOrExprKind = [
|
|
63
|
-
'
|
|
64
|
-
'
|
|
62
|
+
exports.notStmtOrExprKind = [
|
|
63
|
+
'ModuleDeclaration',
|
|
64
|
+
'ClassDeclaration',
|
|
65
|
+
'InterfaceDeclaration',
|
|
66
|
+
'EnumDeclaration',
|
|
67
|
+
'ExportDeclaration',
|
|
68
|
+
'ExportAssignment',
|
|
69
|
+
'MethodDeclaration',
|
|
70
|
+
'Constructor',
|
|
71
|
+
'FunctionDeclaration',
|
|
72
|
+
'GetAccessor',
|
|
73
|
+
'SetAccessor',
|
|
74
|
+
'ArrowFunction',
|
|
75
|
+
'FunctionExpression',
|
|
76
|
+
'MethodSignature',
|
|
77
|
+
'ConstructSignature',
|
|
78
|
+
'CallSignature',
|
|
79
|
+
];
|
|
65
80
|
/**
|
|
66
81
|
* Entry of building ArkFile instance
|
|
67
82
|
*
|
|
@@ -89,7 +104,7 @@ exports.buildArkFileFromFile = buildArkFileFromFile;
|
|
|
89
104
|
function buildArkFile(arkFile, astRoot) {
|
|
90
105
|
const statements = astRoot.statements;
|
|
91
106
|
const namespaces = [];
|
|
92
|
-
statements.forEach(
|
|
107
|
+
statements.forEach(child => {
|
|
93
108
|
if (ohos_typescript_1.default.isModuleDeclaration(child)) {
|
|
94
109
|
let ns = new ArkNamespace_1.ArkNamespace();
|
|
95
110
|
ns.setDeclaringArkFile(arkFile);
|
|
@@ -99,10 +114,7 @@ function buildArkFile(arkFile, astRoot) {
|
|
|
99
114
|
arkFile.addExportInfo((0, ArkExportBuilder_1.buildExportInfo)(ns, arkFile, Position_1.LineColPosition.buildFromNode(child, astRoot)));
|
|
100
115
|
}
|
|
101
116
|
}
|
|
102
|
-
else if (ohos_typescript_1.default.isClassDeclaration(child) ||
|
|
103
|
-
ohos_typescript_1.default.isInterfaceDeclaration(child) ||
|
|
104
|
-
ohos_typescript_1.default.isEnumDeclaration(child) ||
|
|
105
|
-
ohos_typescript_1.default.isStructDeclaration(child)) {
|
|
117
|
+
else if (ohos_typescript_1.default.isClassDeclaration(child) || ohos_typescript_1.default.isInterfaceDeclaration(child) || ohos_typescript_1.default.isEnumDeclaration(child) || ohos_typescript_1.default.isStructDeclaration(child)) {
|
|
106
118
|
let cls = new ArkClass_1.ArkClass();
|
|
107
119
|
(0, ArkClassBuilder_1.buildNormalArkClassFromArkFile)(child, arkFile, cls, astRoot);
|
|
108
120
|
arkFile.addArkClass(cls);
|
|
@@ -126,10 +138,9 @@ function buildArkFile(arkFile, astRoot) {
|
|
|
126
138
|
arkFile.addExportInfo((0, ArkExportBuilder_1.buildExportInfo)(mthd, arkFile, Position_1.LineColPosition.buildFromNode(child, astRoot)));
|
|
127
139
|
}
|
|
128
140
|
}
|
|
129
|
-
else if (ohos_typescript_1.default.isImportEqualsDeclaration(child) ||
|
|
130
|
-
ohos_typescript_1.default.isImportDeclaration(child)) {
|
|
141
|
+
else if (ohos_typescript_1.default.isImportEqualsDeclaration(child) || ohos_typescript_1.default.isImportDeclaration(child)) {
|
|
131
142
|
let importInfos = (0, ArkImportBuilder_1.buildImportInfo)(child, astRoot, arkFile);
|
|
132
|
-
importInfos === null || importInfos === void 0 ? void 0 : importInfos.forEach(
|
|
143
|
+
importInfos === null || importInfos === void 0 ? void 0 : importInfos.forEach(element => {
|
|
133
144
|
element.setDeclaringArkFile(arkFile);
|
|
134
145
|
arkFile.addImportInfo(element);
|
|
135
146
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkImportBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkImportBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ArkImportBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkImportBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,wBAAgB,eAAe,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,GAAG,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,GAAG,UAAU,EAAE,CAOlJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 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
|
|
@@ -58,9 +58,10 @@ function buildImportDeclarationNode(node, sourceFile, arkFile) {
|
|
|
58
58
|
//just like: import fs from 'fs'
|
|
59
59
|
if (node.importClause && node.importClause.name && ohos_typescript_1.default.isIdentifier(node.importClause.name)) {
|
|
60
60
|
let importClauseName = node.importClause.name.text;
|
|
61
|
+
const pos = Position_1.LineColPosition.buildFromNode(node.importClause.name, sourceFile);
|
|
61
62
|
let importType = 'Identifier';
|
|
62
63
|
let importInfo = new ArkImport_1.ImportInfo();
|
|
63
|
-
importInfo.build(importClauseName, importType, importFrom,
|
|
64
|
+
importInfo.build(importClauseName, importType, importFrom, pos, modifiers);
|
|
64
65
|
importInfo.setTsSourceCode(tsSourceCode);
|
|
65
66
|
IRUtils_1.IRUtils.setComments(importInfo, node, sourceFile, arkFile.getScene().getOptions());
|
|
66
67
|
importInfos.push(importInfo);
|
|
@@ -69,19 +70,20 @@ function buildImportDeclarationNode(node, sourceFile, arkFile) {
|
|
|
69
70
|
if (node.importClause && node.importClause.namedBindings && ohos_typescript_1.default.isNamedImports(node.importClause.namedBindings)) {
|
|
70
71
|
let importType = 'NamedImports';
|
|
71
72
|
if (node.importClause.namedBindings.elements) {
|
|
72
|
-
node.importClause.namedBindings.elements.forEach(
|
|
73
|
+
node.importClause.namedBindings.elements.forEach(element => {
|
|
73
74
|
if (element.name && ohos_typescript_1.default.isIdentifier(element.name)) {
|
|
74
75
|
let importClauseName = element.name.text;
|
|
76
|
+
const pos = Position_1.LineColPosition.buildFromNode(element, sourceFile);
|
|
75
77
|
if (element.propertyName && ohos_typescript_1.default.isIdentifier(element.propertyName)) {
|
|
76
78
|
let importInfo = new ArkImport_1.ImportInfo();
|
|
77
|
-
importInfo.build(importClauseName, importType, importFrom,
|
|
79
|
+
importInfo.build(importClauseName, importType, importFrom, pos, modifiers, element.propertyName.text);
|
|
78
80
|
importInfo.setTsSourceCode(tsSourceCode);
|
|
79
81
|
IRUtils_1.IRUtils.setComments(importInfo, node, sourceFile, arkFile.getScene().getOptions());
|
|
80
82
|
importInfos.push(importInfo);
|
|
81
83
|
}
|
|
82
84
|
else {
|
|
83
85
|
let importInfo = new ArkImport_1.ImportInfo();
|
|
84
|
-
importInfo.build(importClauseName, importType, importFrom,
|
|
86
|
+
importInfo.build(importClauseName, importType, importFrom, pos, modifiers);
|
|
85
87
|
importInfo.setTsSourceCode(tsSourceCode);
|
|
86
88
|
IRUtils_1.IRUtils.setComments(importInfo, node, sourceFile, arkFile.getScene().getOptions());
|
|
87
89
|
importInfos.push(importInfo);
|
|
@@ -97,7 +99,8 @@ function buildImportDeclarationNode(node, sourceFile, arkFile) {
|
|
|
97
99
|
let importClauseName = node.importClause.namedBindings.name.text;
|
|
98
100
|
let importInfo = new ArkImport_1.ImportInfo();
|
|
99
101
|
let nameBeforeAs = '*';
|
|
100
|
-
|
|
102
|
+
const pos = Position_1.LineColPosition.buildFromNode(node.importClause.namedBindings.name, sourceFile);
|
|
103
|
+
importInfo.build(importClauseName, importType, importFrom, pos, modifiers, nameBeforeAs);
|
|
101
104
|
importInfo.setTsSourceCode(tsSourceCode);
|
|
102
105
|
IRUtils_1.IRUtils.setComments(importInfo, node, sourceFile, arkFile.getScene().getOptions());
|
|
103
106
|
importInfos.push(importInfo);
|
|
@@ -114,8 +117,10 @@ function buildImportEqualsDeclarationNode(node, sourceFile, arkFile) {
|
|
|
114
117
|
if (node.modifiers) {
|
|
115
118
|
modifiers = (0, builderUtils_1.buildModifiers)(node);
|
|
116
119
|
}
|
|
117
|
-
if (node.moduleReference &&
|
|
118
|
-
|
|
120
|
+
if (node.moduleReference &&
|
|
121
|
+
ohos_typescript_1.default.isExternalModuleReference(node.moduleReference) &&
|
|
122
|
+
node.moduleReference.expression &&
|
|
123
|
+
ohos_typescript_1.default.isStringLiteral(node.moduleReference.expression)) {
|
|
119
124
|
let importFrom = node.moduleReference.expression.text;
|
|
120
125
|
let importClauseName = node.name.text;
|
|
121
126
|
let importInfo = new ArkImport_1.ImportInfo();
|
|
@@ -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,EAA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,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;IAIpC,iBAAiB,IAAI,OAAO;IAI5B,iBAAiB,CAAC,cAAc,EAAE,OAAO,GAAG,IAAI;IAIhD,aAAa,CAAC,OAAO,EAAE,6BAA6B,GAAG,IAAI;IAI3D,cAAc,IAAI,6BAA6B,EAAE;IAIjD,cAAc,CAAC,WAAW,EAAE,6BAA6B,EAAE,GAAG,IAAI;IAIlE,eAAe,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI;IAI5D,gBAAgB,IAAI,4BAA4B,EAAE;IAIlD,gBAAgB,CAAC,aAAa,EAAE,4BAA4B,EAAE,GAAG,IAAI;IAIrE,OAAO,IAAI,KAAK,EAAE;CAG5B;AAsBD,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CA0DnE;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,SAAS,EAAE,qBAAqB,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,KAAK,GAAG,IAAI,CAuB5G;AAED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,CA8BjE;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAepE;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI,CAsC3E"}
|
|
@@ -89,7 +89,7 @@ function buildArkMethodFromArkClass(methodNode, declaringClass, mtd, sourceFile,
|
|
|
89
89
|
// build methodDeclareSignatures and methodSignature as well as corresponding positions
|
|
90
90
|
const methodName = buildMethodName(methodNode, declaringClass, sourceFile, declaringMethod);
|
|
91
91
|
const methodParameters = [];
|
|
92
|
-
(0, builderUtils_1.buildParameters)(methodNode.parameters, mtd, sourceFile).forEach(
|
|
92
|
+
(0, builderUtils_1.buildParameters)(methodNode.parameters, mtd, sourceFile).forEach(parameter => {
|
|
93
93
|
(0, builderUtils_1.buildGenericType)(parameter.getType(), mtd);
|
|
94
94
|
methodParameters.push(parameter);
|
|
95
95
|
});
|
|
@@ -292,10 +292,10 @@ class MethodParameter {
|
|
|
292
292
|
exports.MethodParameter = MethodParameter;
|
|
293
293
|
function needDefaultConstructorInClass(arkClass) {
|
|
294
294
|
const originClassType = arkClass.getCategory();
|
|
295
|
-
return arkClass.getMethodWithName(TSConst_1.CONSTRUCTOR_NAME) === null &&
|
|
295
|
+
return (arkClass.getMethodWithName(TSConst_1.CONSTRUCTOR_NAME) === null &&
|
|
296
296
|
(originClassType === ArkClass_1.ClassCategory.CLASS || originClassType === ArkClass_1.ClassCategory.OBJECT) &&
|
|
297
297
|
arkClass.getName() !== Const_1.DEFAULT_ARK_CLASS_NAME &&
|
|
298
|
-
!arkClass.isDeclare();
|
|
298
|
+
!arkClass.isDeclare());
|
|
299
299
|
}
|
|
300
300
|
function recursivelyCheckAndBuildSuperConstructor(arkClass) {
|
|
301
301
|
let superClass = arkClass.getSuperClass();
|
|
@@ -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,
|
|
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;AAwED,wBAAgB,eAAe,CAAC,aAAa,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CA4B7E"}
|
|
@@ -110,7 +110,7 @@ exports.buildArkNamespace = buildArkNamespace;
|
|
|
110
110
|
function buildNamespaceMembers(node, namespace, sourceFile) {
|
|
111
111
|
const statements = node.statements;
|
|
112
112
|
const nestedNamespaces = [];
|
|
113
|
-
statements.forEach(
|
|
113
|
+
statements.forEach(child => {
|
|
114
114
|
if (ohos_typescript_1.default.isModuleDeclaration(child)) {
|
|
115
115
|
let childNs = new ArkNamespace_1.ArkNamespace();
|
|
116
116
|
childNs.setDeclaringArkNamespace(namespace);
|
|
@@ -118,10 +118,7 @@ function buildNamespaceMembers(node, namespace, sourceFile) {
|
|
|
118
118
|
buildArkNamespace(child, namespace, childNs, sourceFile);
|
|
119
119
|
nestedNamespaces.push(childNs);
|
|
120
120
|
}
|
|
121
|
-
else if (ohos_typescript_1.default.isClassDeclaration(child) ||
|
|
122
|
-
ohos_typescript_1.default.isInterfaceDeclaration(child) ||
|
|
123
|
-
ohos_typescript_1.default.isEnumDeclaration(child) ||
|
|
124
|
-
ohos_typescript_1.default.isStructDeclaration(child)) {
|
|
121
|
+
else if (ohos_typescript_1.default.isClassDeclaration(child) || ohos_typescript_1.default.isInterfaceDeclaration(child) || ohos_typescript_1.default.isEnumDeclaration(child) || ohos_typescript_1.default.isStructDeclaration(child)) {
|
|
125
122
|
let cls = new ArkClass_1.ArkClass();
|
|
126
123
|
(0, ArkClassBuilder_1.buildNormalArkClassFromArkNamespace)(child, namespace, cls, sourceFile);
|
|
127
124
|
namespace.addArkClass(cls);
|
|
@@ -146,12 +143,13 @@ function buildNamespaceMembers(node, namespace, sourceFile) {
|
|
|
146
143
|
}
|
|
147
144
|
}
|
|
148
145
|
else if (ohos_typescript_1.default.isExportDeclaration(child)) {
|
|
149
|
-
(0, ArkExportBuilder_1.buildExportDeclaration)(child, sourceFile, namespace.getDeclaringArkFile())
|
|
150
|
-
.forEach(item => namespace.addExportInfo(item));
|
|
146
|
+
(0, ArkExportBuilder_1.buildExportDeclaration)(child, sourceFile, namespace.getDeclaringArkFile()).forEach(item => namespace.addExportInfo(item));
|
|
151
147
|
}
|
|
152
148
|
else if (ohos_typescript_1.default.isExportAssignment(child)) {
|
|
153
|
-
(0, ArkExportBuilder_1.buildExportAssignment)(child, sourceFile, namespace.getDeclaringArkFile())
|
|
154
|
-
|
|
149
|
+
(0, ArkExportBuilder_1.buildExportAssignment)(child, sourceFile, namespace.getDeclaringArkFile()).forEach(item => namespace.addExportInfo(item));
|
|
150
|
+
}
|
|
151
|
+
else if (ohos_typescript_1.default.isVariableStatement(child) && (0, ArkExportBuilder_1.isExported)(child.modifiers)) {
|
|
152
|
+
(0, ArkExportBuilder_1.buildExportVariableStatement)(child, sourceFile, namespace.getDeclaringArkFile(), namespace).forEach(item => namespace.addExportInfo(item));
|
|
155
153
|
}
|
|
156
154
|
else {
|
|
157
155
|
logger.info('Child joined default method of arkFile: ', ohos_typescript_1.default.SyntaxKind[child.kind]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkSignatureBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkSignatureBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAiB,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrH,qBAAa,mBAAmB;WACd,8CAA8C,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"ArkSignatureBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkSignatureBuilder.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAiB,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrH,qBAAa,mBAAmB;WACd,8CAA8C,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,eAAe;WAMnI,kCAAkC,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,eAAe;WAKpG,qCAAqC,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,kBAAkB;WAI1G,gCAAgC,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc;WAInE,gCAAgC,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,GAAE,OAAe,GAAG,cAAc;CAGjH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 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
|
|
@@ -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,OAAO,EAAkB,eAAe,EAA8C,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAItC,OAAO,EAAuD,SAAS,EAAE,MAAM,gBA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,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;CA4CtC"}
|
|
@@ -97,7 +97,7 @@ class BodyBuilder {
|
|
|
97
97
|
*/
|
|
98
98
|
buildLexicalEnv(childrenChain, baseLocals, index) {
|
|
99
99
|
var _a;
|
|
100
|
-
let usedClosures = this.findClosuresUsedInNested(childrenChain, baseLocals, new Map);
|
|
100
|
+
let usedClosures = this.findClosuresUsedInNested(childrenChain, baseLocals, new Map());
|
|
101
101
|
const nestedMethod = childrenChain.parent;
|
|
102
102
|
const nestedSignature = nestedMethod.getImplementationSignature();
|
|
103
103
|
if (nestedSignature !== null && usedClosures !== null && usedClosures.length > 0) {
|
|
@@ -226,7 +226,10 @@ class BodyBuilder {
|
|
|
226
226
|
}
|
|
227
227
|
generateNestedMethodChains(outerMethod) {
|
|
228
228
|
let candidateMethods = [];
|
|
229
|
-
outerMethod
|
|
229
|
+
outerMethod
|
|
230
|
+
.getDeclaringArkClass()
|
|
231
|
+
.getMethods()
|
|
232
|
+
.forEach(method => {
|
|
230
233
|
if (method.getName().startsWith(Const_1.NAME_PREFIX) && method.getName().endsWith(`${Const_1.NAME_DELIMITER}${outerMethod.getName()}`)) {
|
|
231
234
|
candidateMethods.push(method);
|
|
232
235
|
}
|
|
@@ -331,7 +334,7 @@ class BodyBuilder {
|
|
|
331
334
|
const callGlobal = (_d = outerGlobals === null || outerGlobals === void 0 ? void 0 : outerGlobals.get(nestedMethodName)) !== null && _d !== void 0 ? _d : outerGlobals === null || outerGlobals === void 0 ? void 0 : outerGlobals.get(originalMethodName);
|
|
332
335
|
if (callGlobal !== undefined && callGlobal instanceof Ref_1.GlobalRef && callGlobal.getRef() === null) {
|
|
333
336
|
const fieldSignature = new ArkSignature_1.FieldSignature(nestedMethodName, nestedMethod.getDeclaringArkClass().getSignature(), new Type_1.FunctionType(nestedMethod.getSignature()));
|
|
334
|
-
callGlobal.setRef(new Ref_1.ArkStaticFieldRef(
|
|
337
|
+
callGlobal.setRef(new Ref_1.ArkStaticFieldRef(fieldSignature));
|
|
335
338
|
}
|
|
336
339
|
const childrenChains = nestedChain.children;
|
|
337
340
|
if (childrenChains === null) {
|
|
@@ -405,7 +408,7 @@ class BodyBuilder {
|
|
|
405
408
|
return;
|
|
406
409
|
}
|
|
407
410
|
const fieldSignature = new ArkSignature_1.FieldSignature(methodSignature.getMethodSubSignature().getMethodName(), methodSignature.getDeclaringClassSignature(), new Type_1.ClosureType(lexicalEnv, methodSignature));
|
|
408
|
-
globalRef.setRef(new Ref_1.ArkStaticFieldRef(
|
|
411
|
+
globalRef.setRef(new Ref_1.ArkStaticFieldRef(fieldSignature));
|
|
409
412
|
this.updateAbstractInvokeExprWithClosures(globalRef, outerMethod.getSignature(), nestedMethod.getSignature(), closuresLocal);
|
|
410
413
|
}
|
|
411
414
|
updateLocalInfoWithClosures(local, outerMethod, nestedMethod, closuresLocal) {
|
|
@@ -517,7 +520,7 @@ class BodyBuilder {
|
|
|
517
520
|
let assignStmt = new Stmt_1.ArkAssignStmt(closuresLocal, parameterRef);
|
|
518
521
|
stmts.splice(index, 0, assignStmt);
|
|
519
522
|
closuresLocal.setDeclaringStmt(assignStmt);
|
|
520
|
-
oldParamRefs === null || oldParamRefs === void 0 ? void 0 : oldParamRefs.forEach(
|
|
523
|
+
oldParamRefs === null || oldParamRefs === void 0 ? void 0 : oldParamRefs.forEach(paramRef => {
|
|
521
524
|
index++;
|
|
522
525
|
paramRef.setIndex(index);
|
|
523
526
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builderUtils.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/builderUtils.ts"],"names":[],"mappings":"AAeA,OAAO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AE,EAAE,CAAC,IAAI,GAAG,MAAM,CAUpD;AAED,wBAAgB,oBAAoB,CAAC,eAAe,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,cAAc,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAkBxG;AAED,wBAAgB,mBAAmB,CAC/B,cAAc,EAAE,EAAE,CAAC,SAAS,CAAC,wBAAwB,CAAC,EACtD,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,WAAW,EAAE,SAAS,GAAG,QAAQ,GAClC,WAAW,EAAE,CAyBf;AA4ED,wBAAgB,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,WAAW,EAAE,SAAS,GAAG,QAAQ,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,GAAG,eAAe,EAAE,CA8C3J;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,IAAI,CAsDhG;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAMlG;AAED,wBAAgB,WAAW,CACvB,QAAQ,EAAE,EAAE,CAAC,QAAQ,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"}
|
|
@@ -91,7 +91,7 @@ function handlePropertyAccessExpression(node) {
|
|
|
91
91
|
exports.handlePropertyAccessExpression = handlePropertyAccessExpression;
|
|
92
92
|
function buildDecorators(node, sourceFile) {
|
|
93
93
|
let decorators = new Set();
|
|
94
|
-
ohos_typescript_1.default.getAllDecorators(node).forEach(
|
|
94
|
+
ohos_typescript_1.default.getAllDecorators(node).forEach(decoratorNode => {
|
|
95
95
|
let decorator = parseDecorator(decoratorNode);
|
|
96
96
|
if (decorator) {
|
|
97
97
|
decorator.setContent(decoratorNode.expression.getText(sourceFile));
|
|
@@ -125,7 +125,7 @@ function buildModifiers(node) {
|
|
|
125
125
|
var _a;
|
|
126
126
|
let modifiers = 0;
|
|
127
127
|
if (ohos_typescript_1.default.canHaveModifiers(node)) {
|
|
128
|
-
(_a = ohos_typescript_1.default.getModifiers(node)) === null || _a === void 0 ? void 0 : _a.forEach(
|
|
128
|
+
(_a = ohos_typescript_1.default.getModifiers(node)) === null || _a === void 0 ? void 0 : _a.forEach(modifier => {
|
|
129
129
|
modifiers |= (0, ArkBaseModel_1.modifierKind2Enum)(modifier.kind);
|
|
130
130
|
});
|
|
131
131
|
}
|
|
@@ -134,8 +134,8 @@ function buildModifiers(node) {
|
|
|
134
134
|
exports.buildModifiers = buildModifiers;
|
|
135
135
|
function buildHeritageClauses(heritageClauses) {
|
|
136
136
|
let heritageClausesMap = new Map();
|
|
137
|
-
heritageClauses === null || heritageClauses === void 0 ? void 0 : heritageClauses.forEach(
|
|
138
|
-
heritageClause.types.forEach(
|
|
137
|
+
heritageClauses === null || heritageClauses === void 0 ? void 0 : heritageClauses.forEach(heritageClause => {
|
|
138
|
+
heritageClause.types.forEach(type => {
|
|
139
139
|
let heritageClauseName = '';
|
|
140
140
|
if (type.typeArguments) {
|
|
141
141
|
heritageClauseName = type.getText();
|
|
@@ -165,7 +165,7 @@ function buildTypeParameters(typeParameters, sourceFile, arkInstance) {
|
|
|
165
165
|
index = len;
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
typeParameters.forEach(
|
|
168
|
+
typeParameters.forEach(typeParameter => {
|
|
169
169
|
const genericType = tsNode2Type(typeParameter, sourceFile, arkInstance);
|
|
170
170
|
if (genericType instanceof Type_1.GenericType) {
|
|
171
171
|
genericType.setIndex(index++);
|
|
@@ -184,7 +184,7 @@ exports.buildTypeParameters = buildTypeParameters;
|
|
|
184
184
|
function buildObjectBindingPatternParam(methodParameter, paramNameNode) {
|
|
185
185
|
methodParameter.setName('ObjectBindingPattern');
|
|
186
186
|
let elements = [];
|
|
187
|
-
paramNameNode.elements.forEach(
|
|
187
|
+
paramNameNode.elements.forEach(element => {
|
|
188
188
|
let paraElement = new ArkMethodBuilder_1.ObjectBindingPatternParameter();
|
|
189
189
|
if (element.propertyName) {
|
|
190
190
|
if (ohos_typescript_1.default.isIdentifier(element.propertyName)) {
|
|
@@ -239,7 +239,7 @@ function buildBindingElementOfBindingPatternParam(element, paraElement) {
|
|
|
239
239
|
function buildArrayBindingPatternParam(methodParameter, paramNameNode) {
|
|
240
240
|
methodParameter.setName('ArrayBindingPattern');
|
|
241
241
|
let elements = [];
|
|
242
|
-
paramNameNode.elements.forEach(
|
|
242
|
+
paramNameNode.elements.forEach(element => {
|
|
243
243
|
let paraElement = new ArkMethodBuilder_1.ArrayBindingPatternParameter();
|
|
244
244
|
if (ohos_typescript_1.default.isBindingElement(element)) {
|
|
245
245
|
buildBindingElementOfBindingPatternParam(element, paraElement);
|
|
@@ -253,7 +253,7 @@ function buildArrayBindingPatternParam(methodParameter, paramNameNode) {
|
|
|
253
253
|
}
|
|
254
254
|
function buildParameters(params, arkInstance, sourceFile) {
|
|
255
255
|
let parameters = [];
|
|
256
|
-
params.forEach(
|
|
256
|
+
params.forEach(parameter => {
|
|
257
257
|
let methodParameter = new ArkMethodBuilder_1.MethodParameter();
|
|
258
258
|
// name
|
|
259
259
|
if (ohos_typescript_1.default.isIdentifier(parameter.name)) {
|
|
@@ -309,7 +309,9 @@ function buildGenericType(type, arkInstance) {
|
|
|
309
309
|
gType = (_b = arkInstance.getGenericTypes()) === null || _b === void 0 ? void 0 : _b.find(f => f.getName() === typeName);
|
|
310
310
|
}
|
|
311
311
|
if (!gType) {
|
|
312
|
-
gType = (_c = arkInstance
|
|
312
|
+
gType = (_c = arkInstance
|
|
313
|
+
.getDeclaringArkClass()
|
|
314
|
+
.getGenericsTypes()) === null || _c === void 0 ? void 0 : _c.find(f => f.getName() === typeName);
|
|
313
315
|
}
|
|
314
316
|
}
|
|
315
317
|
if (gType) {
|
|
@@ -386,7 +388,7 @@ function tsNode2Type(typeNode, sourceFile, arkInstance) {
|
|
|
386
388
|
}
|
|
387
389
|
else if (ohos_typescript_1.default.isUnionTypeNode(typeNode) || ohos_typescript_1.default.isIntersectionTypeNode(typeNode)) {
|
|
388
390
|
let multipleTypePara = [];
|
|
389
|
-
typeNode.types.forEach(
|
|
391
|
+
typeNode.types.forEach(tmpType => {
|
|
390
392
|
multipleTypePara.push(tsNode2Type(tmpType, sourceFile, arkInstance));
|
|
391
393
|
});
|
|
392
394
|
if (ohos_typescript_1.default.isUnionTypeNode(typeNode)) {
|
|
@@ -531,15 +533,15 @@ function buildTypeFromTypeOperator(typeOperatorNode, sourceFile, arkInstance) {
|
|
|
531
533
|
const typeNode = typeOperatorNode.type;
|
|
532
534
|
let type = tsNode2Type(typeNode, sourceFile, arkInstance);
|
|
533
535
|
switch (typeOperatorNode.operator) {
|
|
534
|
-
case
|
|
536
|
+
case ohos_typescript_1.default.SyntaxKind.ReadonlyKeyword: {
|
|
535
537
|
if (type instanceof Type_1.ArrayType || type instanceof Type_1.TupleType) {
|
|
536
538
|
type.setReadonlyFlag(true);
|
|
537
539
|
}
|
|
538
540
|
return type;
|
|
539
541
|
}
|
|
540
|
-
case
|
|
542
|
+
case ohos_typescript_1.default.SyntaxKind.KeyOfKeyword:
|
|
541
543
|
return new TypeExpr_1.KeyofTypeExpr(type);
|
|
542
|
-
case
|
|
544
|
+
case ohos_typescript_1.default.SyntaxKind.UniqueKeyword:
|
|
543
545
|
return Type_1.UnknownType.getInstance();
|
|
544
546
|
default:
|
|
545
547
|
return Type_1.UnknownType.getInstance();
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src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EAAE,MAAM,GAAG,IAAI;IAS3B,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAKnC,WAAW,IAAI,IAAI;IAKnB,SAAS,IAAI,IAAI;IAKjB,SAAS,IAAI,IAAI;IAOjB,SAAS,IAAI,MAAM;IAInB,QAAQ,IAAI,MAAM;IAIlB,KAAK;
|
|
1
|
+
{"version":3,"file":"ArkStream.d.ts","sourceRoot":"","sources":["../../src/save/ArkStream.ts"],"names":[],"mappings":";AAeA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,qBAAa,aAAa;IACtB,MAAM,EAAE,MAAM,EAAE,CAAM;IACtB,MAAM,EAAE,MAAM,CAAM;gBAER,MAAM,GAAE,MAAW;IAIxB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAKtB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAM1B,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAS3B,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAKnC,WAAW,IAAI,IAAI;IAKnB,SAAS,IAAI,IAAI;IAKjB,SAAS,IAAI,IAAI;IAOjB,SAAS,IAAI,MAAM;IAInB,QAAQ,IAAI,MAAM;IAIlB,KAAK,IAAI,IAAI;CAGvB;AAED,qBAAa,SAAU,SAAQ,aAAa;IACxC,SAAS,EAAE,EAAE,CAAC,WAAW,CAAC;gBAEd,SAAS,EAAE,EAAE,CAAC,WAAW;IAK9B,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAKtB,KAAK,IAAI,IAAI;CAGvB"}
|
package/lib/save/ArkStream.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DotPrinter.d.ts","sourceRoot":"","sources":["../../src/save/DotPrinter.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,OAAO;IACzC,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;gBAEL,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,OAAe;IAMhD,IAAI,IAAI,MAAM;IAoBrB,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAQ9C,OAAO,CAAC,WAAW;
|
|
1
|
+
{"version":3,"file":"DotPrinter.d.ts","sourceRoot":"","sources":["../../src/save/DotPrinter.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,OAAO;IACzC,MAAM,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;gBAEL,MAAM,EAAE,SAAS,EAAE,OAAO,GAAE,OAAe;IAMhD,IAAI,IAAI,MAAM;IAoBrB,SAAS,CAAC,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAQ9C,OAAO,CAAC,WAAW;IA6BnB,OAAO,CAAC,eAAe;CAO1B;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,OAAO;IACxC,GAAG,EAAE,QAAQ,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;gBAEL,GAAG,EAAE,QAAQ,EAAE,OAAO,GAAE,OAAe;IAM5C,IAAI,IAAI,MAAM;CAmBxB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO;IAC5C,EAAE,EAAE,YAAY,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;gBAEL,EAAE,EAAE,YAAY,EAAE,OAAO,GAAE,OAAe;IAM/C,IAAI,IAAI,MAAM;CAmBxB;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,OAAO;IACvC,OAAO,EAAE,OAAO,CAAC;gBAEL,OAAO,EAAE,OAAO;IAKrB,IAAI,IAAI,MAAM;CAqBxB"}
|
package/lib/save/DotPrinter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 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
|
|
@@ -60,9 +60,7 @@ class DotMethodPrinter extends Printer_1.Printer {
|
|
|
60
60
|
let name = prefix + index++;
|
|
61
61
|
blockToNode.set(block, name);
|
|
62
62
|
/** Node0 [label="entry"]; */
|
|
63
|
-
this.printer
|
|
64
|
-
.writeIndent()
|
|
65
|
-
.writeLine(`${name} [label="${this.getBlockContent(block, this.printer.getIndent())}"];`);
|
|
63
|
+
this.printer.writeIndent().writeLine(`${name} [label="${this.getBlockContent(block, this.printer.getIndent())}"];`);
|
|
66
64
|
}
|
|
67
65
|
for (let block of blocks) {
|
|
68
66
|
for (let nextBlock of block.getSuccessors()) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphPrinter.d.ts","sourceRoot":"","sources":["../../src/save/GraphPrinter.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"GraphPrinter.d.ts","sourceRoot":"","sources":["../../src/save/GraphPrinter.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8CpC,qBAAa,YAAY,CAAC,SAAS,SAAS,WAAW,CAAC,QAAQ,CAAC,CAAE,SAAQ,OAAO;IAC9E,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAG,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,SAAS,CAAa;gBAE5B,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM;IAQ7B,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAI3B,IAAI,IAAI,MAAM;IAMd,UAAU,IAAI,IAAI;IAMlB,UAAU,IAAI,IAAI;IAiClB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI;IAQ/B,WAAW,IAAI,IAAI;IAYnB,WAAW,IAAI,IAAI;CAG7B"}
|
package/lib/save/GraphPrinter.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
3
|
+
* Copyright (c) 2024-2025 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
|
|
@@ -55,7 +55,6 @@ function escapeStr(input) {
|
|
|
55
55
|
++i;
|
|
56
56
|
break;
|
|
57
57
|
default:
|
|
58
|
-
;
|
|
59
58
|
}
|
|
60
59
|
}
|
|
61
60
|
return str;
|
|
@@ -128,7 +127,7 @@ class GraphPrinter extends Printer_1.Printer {
|
|
|
128
127
|
// TODO: need graph attr?
|
|
129
128
|
}
|
|
130
129
|
writeFooter() {
|
|
131
|
-
this.printer.writeLine(
|
|
130
|
+
this.printer.writeLine('}\n');
|
|
132
131
|
}
|
|
133
132
|
}
|
|
134
133
|
exports.GraphPrinter = GraphPrinter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonPrinter.d.ts","sourceRoot":"","sources":["../../src/save/JsonPrinter.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"JsonPrinter.d.ts","sourceRoot":"","sources":["../../src/save/JsonPrinter.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAmEhD,qBAAa,WAAY,SAAQ,OAAO;IACxB,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,OAAO;IAI7B,IAAI,IAAI,MAAM;IAKrB,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,kBAAkB;IAQ1B,OAAO,CAAC,cAAc;IAatB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,eAAe;IAWvB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,mBAAmB;IAY3B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,wBAAwB;IAOhC,OAAO,CAAC,aAAa;IAwHrB,OAAO,CAAC,sBAAsB;IAO9B,OAAO,CAAC,2BAA2B;IASnC,OAAO,CAAC,uBAAuB;IAS/B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,2BAA2B;IAOnC,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,mBAAmB;IAa3B,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,cAAc;IAyJtB,OAAO,CAAC,aAAa;CAmCxB"}
|