arkanalyzer 1.0.14 → 1.0.16
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.md +10 -10
- package/config/arkanalyzer.json +5 -0
- package/lib/Config.d.ts +1 -0
- package/lib/Config.d.ts.map +1 -1
- package/lib/core/base/Expr.d.ts +3 -0
- package/lib/core/base/Expr.d.ts.map +1 -1
- package/lib/core/base/Expr.js +22 -5
- 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 +5 -2
- package/lib/core/base/Stmt.js +1 -1
- package/lib/core/base/Type.d.ts +25 -1
- package/lib/core/base/Type.d.ts.map +1 -1
- package/lib/core/base/Type.js +39 -2
- package/lib/core/common/ArkIRTransformer.d.ts.map +1 -1
- package/lib/core/common/ArkIRTransformer.js +32 -1
- package/lib/core/common/ArkValueTransformer.js +2 -2
- package/lib/core/common/CfgBuilder.d.ts.map +1 -1
- package/lib/core/common/CfgBuilder.js +3 -2
- package/lib/core/common/Const.d.ts +1 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +3 -2
- package/lib/core/common/DummyMainCreater.d.ts +0 -6
- package/lib/core/common/DummyMainCreater.d.ts.map +1 -1
- package/lib/core/common/DummyMainCreater.js +12 -160
- package/lib/core/common/EtsConst.d.ts +0 -3
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +1 -8
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +8 -2
- package/lib/core/common/ModelUtils.d.ts +1 -0
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +14 -23
- package/lib/core/common/SdkUtils.d.ts.map +1 -1
- package/lib/core/common/SdkUtils.js +12 -5
- package/lib/core/common/TypeInference.d.ts.map +1 -1
- package/lib/core/common/TypeInference.js +21 -8
- package/lib/core/dataflow/DataflowProblem.d.ts +0 -1
- package/lib/core/dataflow/DataflowProblem.d.ts.map +1 -1
- package/lib/core/dataflow/DataflowProblem.js +0 -13
- package/lib/core/dataflow/Edge.d.ts +0 -4
- package/lib/core/dataflow/Edge.d.ts.map +1 -1
- package/lib/core/dataflow/Edge.js +1 -10
- package/lib/core/dataflow/UndefinedVariable.d.ts.map +1 -1
- package/lib/core/dataflow/UndefinedVariable.js +28 -21
- package/lib/core/dataflow/Util.d.ts +0 -2
- package/lib/core/dataflow/Util.d.ts.map +1 -1
- package/lib/core/dataflow/Util.js +1 -95
- package/lib/core/graph/builder/ViewTreeBuilder.d.ts.map +1 -1
- package/lib/core/graph/builder/ViewTreeBuilder.js +2 -2
- package/lib/core/model/ArkClass.d.ts +5 -0
- package/lib/core/model/ArkClass.d.ts.map +1 -1
- package/lib/core/model/ArkClass.js +10 -2
- package/lib/core/model/ArkFile.d.ts +4 -4
- package/lib/core/model/ArkFile.d.ts.map +1 -1
- package/lib/core/model/ArkFile.js +7 -6
- package/lib/core/model/ArkNamespace.d.ts +8 -3
- package/lib/core/model/ArkNamespace.d.ts.map +1 -1
- package/lib/core/model/ArkNamespace.js +42 -11
- package/lib/core/model/ArkSignature.d.ts +10 -0
- package/lib/core/model/ArkSignature.d.ts.map +1 -1
- package/lib/core/model/ArkSignature.js +13 -1
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +43 -9
- package/lib/core/model/builder/ArkFileBuilder.js +14 -11
- package/lib/core/model/builder/ArkMethodBuilder.js +2 -2
- 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 +49 -14
- package/lib/core/model/builder/builderUtils.d.ts +2 -2
- package/lib/core/model/builder/builderUtils.d.ts.map +1 -1
- package/lib/core/model/builder/builderUtils.js +19 -5
- package/lib/index.d.ts +1 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -6
- package/lib/save/source/SourceStmt.d.ts +1 -0
- package/lib/save/source/SourceStmt.d.ts.map +1 -1
- package/lib/save/source/SourceStmt.js +32 -7
- package/lib/utils/entryMethodUtils.d.ts +0 -2
- package/lib/utils/entryMethodUtils.d.ts.map +1 -1
- package/lib/utils/entryMethodUtils.js +1 -31
- package/package.json +3 -3
- package/lib/core/dataflow/TiantAnalysis.d.ts +0 -38
- package/lib/core/dataflow/TiantAnalysis.d.ts.map +0 -1
- package/lib/core/dataflow/TiantAnalysis.js +0 -340
|
@@ -13,36 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
-
if (k2 === undefined) k2 = k;
|
|
18
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
-
}
|
|
22
|
-
Object.defineProperty(o, k2, desc);
|
|
23
|
-
}) : (function(o, m, k, k2) {
|
|
24
|
-
if (k2 === undefined) k2 = k;
|
|
25
|
-
o[k2] = m[k];
|
|
26
|
-
}));
|
|
27
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
-
}) : function(o, v) {
|
|
30
|
-
o["default"] = v;
|
|
31
|
-
});
|
|
32
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
33
|
-
if (mod && mod.__esModule) return mod;
|
|
34
|
-
var result = {};
|
|
35
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
36
|
-
__setModuleDefault(result, mod);
|
|
37
|
-
return result;
|
|
38
|
-
};
|
|
39
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
40
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
41
|
-
};
|
|
42
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
17
|
exports.DummyMainCreater = void 0;
|
|
44
|
-
const fs_1 = __importDefault(require("fs"));
|
|
45
|
-
const path_1 = __importDefault(require("path"));
|
|
46
18
|
const entryMethodUtils_1 = require("../../utils/entryMethodUtils");
|
|
47
19
|
const Constant_1 = require("../base/Constant");
|
|
48
20
|
const Expr_1 = require("../base/Expr");
|
|
@@ -55,15 +27,11 @@ const ArkBody_1 = require("../model/ArkBody");
|
|
|
55
27
|
const ArkClass_1 = require("../model/ArkClass");
|
|
56
28
|
const ArkFile_1 = require("../model/ArkFile");
|
|
57
29
|
const ArkMethod_1 = require("../model/ArkMethod");
|
|
58
|
-
const ArkNamespace_1 = require("../model/ArkNamespace");
|
|
59
30
|
const ArkSignature_1 = require("../model/ArkSignature");
|
|
60
31
|
const ArkSignatureBuilder_1 = require("../model/builder/ArkSignatureBuilder");
|
|
61
32
|
const TSConst_1 = require("./TSConst");
|
|
62
|
-
const json5parser_1 = require("../../utils/json5parser");
|
|
63
|
-
const logger_1 = __importStar(require("../../utils/logger"));
|
|
64
33
|
const ArkMethodBuilder_1 = require("../model/builder/ArkMethodBuilder");
|
|
65
34
|
const ValueUtil_1 = require("./ValueUtil");
|
|
66
|
-
const logger = logger_1.default.getLogger(logger_1.LOG_MODULE_TYPE.ARKANALYZER, 'Scene');
|
|
67
35
|
/**
|
|
68
36
|
收集所有的onCreate,onStart等函数,构造一个虚拟函数,具体为:
|
|
69
37
|
%statInit()
|
|
@@ -93,22 +61,12 @@ class DummyMainCreater {
|
|
|
93
61
|
this.classLocalMap = new Map();
|
|
94
62
|
this.dummyMain = new ArkMethod_1.ArkMethod();
|
|
95
63
|
this.tempLocalIndex = 0;
|
|
96
|
-
this.builtInClass = new Map;
|
|
97
64
|
this.scene = scene;
|
|
98
65
|
// Currently get entries from module.json5 can't visit all of abilities
|
|
99
66
|
// Todo: handle ablity/component jump, then get entries from module.json5
|
|
100
67
|
this.entryMethods = this.getMethodsFromAllAbilities();
|
|
101
68
|
this.entryMethods.push(...this.getEntryMethodsFromComponents());
|
|
102
69
|
this.entryMethods.push(...this.getCallbackMethods());
|
|
103
|
-
this.buildBuiltInClass();
|
|
104
|
-
}
|
|
105
|
-
buildBuiltInClass() {
|
|
106
|
-
for (const sdkFile of this.scene.getSdkArkFiles()) {
|
|
107
|
-
if (sdkFile.getName() === 'api\\@ohos.app.ability.Want.d.ts') {
|
|
108
|
-
const arkClass = sdkFile.getClassWithName('Want');
|
|
109
|
-
this.builtInClass.set('Want', arkClass);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
70
|
}
|
|
113
71
|
setEntryMethods(methods) {
|
|
114
72
|
this.entryMethods = methods;
|
|
@@ -133,9 +91,10 @@ class DummyMainCreater {
|
|
|
133
91
|
this.dummyMain.setLineCol(0);
|
|
134
92
|
(0, ArkMethodBuilder_1.checkAndUpdateMethod)(this.dummyMain, dummyMainClass);
|
|
135
93
|
dummyMainClass.addMethod(this.dummyMain);
|
|
94
|
+
let defaultMethods = [];
|
|
136
95
|
for (const method of this.entryMethods) {
|
|
137
96
|
if (method.getDeclaringArkClass().isDefaultArkClass()) {
|
|
138
|
-
|
|
97
|
+
defaultMethods.push(method);
|
|
139
98
|
}
|
|
140
99
|
else {
|
|
141
100
|
const declaringArkClass = method.getDeclaringArkClass();
|
|
@@ -153,6 +112,9 @@ class DummyMainCreater {
|
|
|
153
112
|
this.classLocalMap.set(method, newLocal);
|
|
154
113
|
}
|
|
155
114
|
}
|
|
115
|
+
for (const defaultMethod of defaultMethods) {
|
|
116
|
+
this.classLocalMap.set(defaultMethod, null);
|
|
117
|
+
}
|
|
156
118
|
const localSet = new Set(Array.from(this.classLocalMap.values()).filter((value) => value !== null));
|
|
157
119
|
const dummyBody = new ArkBody_1.ArkBody(localSet, this.createDummyMainCfg());
|
|
158
120
|
this.dummyMain.setBody(dummyBody);
|
|
@@ -181,9 +143,6 @@ class DummyMainCreater {
|
|
|
181
143
|
}
|
|
182
144
|
let clsType = local.getType();
|
|
183
145
|
let cls = this.scene.getClass(clsType.getClassSignature());
|
|
184
|
-
if (!cls) {
|
|
185
|
-
continue;
|
|
186
|
-
}
|
|
187
146
|
const assStmt = new Stmt_1.ArkAssignStmt(local, new Expr_1.ArkNewExpr(clsType));
|
|
188
147
|
firstBlock.addStmt(assStmt);
|
|
189
148
|
let consMtd = cls.getMethodWithName(TSConst_1.CONSTRUCTOR_NAME);
|
|
@@ -209,7 +168,7 @@ class DummyMainCreater {
|
|
|
209
168
|
whileBlock.addPredecessorBlock(firstBlock);
|
|
210
169
|
let lastBlocks = [whileBlock];
|
|
211
170
|
let count = 0;
|
|
212
|
-
for (
|
|
171
|
+
for (let method of this.entryMethods) {
|
|
213
172
|
count++;
|
|
214
173
|
const condition = new Expr_1.ArkConditionExpr(countLocal, new Constant_1.Constant(count.toString(), Type_1.NumberType.getInstance()), Expr_1.RelationalBinaryOperator.Equality);
|
|
215
174
|
const ifStmt = new Stmt_1.ArkIfStmt(condition);
|
|
@@ -225,7 +184,6 @@ class DummyMainCreater {
|
|
|
225
184
|
let paramIdx = 0;
|
|
226
185
|
for (const param of method.getParameters()) {
|
|
227
186
|
let paramType = param.getType();
|
|
228
|
-
let checkMethod = method;
|
|
229
187
|
// In ArkIR from abc scenario, param type is undefined in some cases
|
|
230
188
|
// Then try to get it from super class(SDK)
|
|
231
189
|
// TODO - need handle method overload to get the correct method
|
|
@@ -234,7 +192,7 @@ class DummyMainCreater {
|
|
|
234
192
|
let methodInSuperCls = superCls === null || superCls === void 0 ? void 0 : superCls.getMethodWithName(method.getName());
|
|
235
193
|
if (methodInSuperCls) {
|
|
236
194
|
paramType = (_a = methodInSuperCls.getParameters().at(paramIdx)) === null || _a === void 0 ? void 0 : _a.getType();
|
|
237
|
-
|
|
195
|
+
method = methodInSuperCls;
|
|
238
196
|
}
|
|
239
197
|
}
|
|
240
198
|
const paramLocal = new Local_1.Local('temp' + this.tempLocalIndex++, paramType);
|
|
@@ -243,25 +201,10 @@ class DummyMainCreater {
|
|
|
243
201
|
const assStmt = new Stmt_1.ArkAssignStmt(paramLocal, new Expr_1.ArkNewExpr(paramType));
|
|
244
202
|
invokeBlock.addStmt(assStmt);
|
|
245
203
|
}
|
|
246
|
-
else if (paramType instanceof Type_1.UnclearReferenceType) {
|
|
247
|
-
const arkClass = this.getArkClassFromParamType(paramType.getName(), checkMethod.getDeclaringArkFile());
|
|
248
|
-
if (arkClass) {
|
|
249
|
-
const classType = new Type_1.ClassType(arkClass.getSignature());
|
|
250
|
-
paramLocal.setType(classType);
|
|
251
|
-
const assStmt = new Stmt_1.ArkAssignStmt(paramLocal, new Expr_1.ArkNewExpr(classType));
|
|
252
|
-
invokeBlock.addStmt(assStmt);
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
204
|
paramIdx++;
|
|
256
205
|
}
|
|
257
206
|
const local = this.classLocalMap.get(method);
|
|
258
|
-
let invokeExpr;
|
|
259
|
-
if (local) {
|
|
260
|
-
invokeExpr = new Expr_1.ArkInstanceInvokeExpr(local, method.getSignature(), paramLocals);
|
|
261
|
-
}
|
|
262
|
-
else {
|
|
263
|
-
invokeExpr = new Expr_1.ArkStaticInvokeExpr(method.getSignature(), paramLocals);
|
|
264
|
-
}
|
|
207
|
+
let invokeExpr = new Expr_1.ArkInstanceInvokeExpr(local, method.getSignature(), paramLocals);
|
|
265
208
|
const invokeStmt = new Stmt_1.ArkInvokeStmt(invokeExpr);
|
|
266
209
|
invokeBlock.addStmt(invokeStmt);
|
|
267
210
|
dummyCfg.addBlock(invokeBlock);
|
|
@@ -281,29 +224,6 @@ class DummyMainCreater {
|
|
|
281
224
|
returnBlock.addPredecessorBlock(whileBlock);
|
|
282
225
|
return dummyCfg;
|
|
283
226
|
}
|
|
284
|
-
getArkClassFromParamType(name, file) {
|
|
285
|
-
var _a, _b;
|
|
286
|
-
if (name.includes('.')) {
|
|
287
|
-
const nsName = name.split('.')[0];
|
|
288
|
-
const clsName = name.split('.')[1];
|
|
289
|
-
const importInfo = file.getImportInfoBy(nsName);
|
|
290
|
-
const arkExport = (_a = importInfo === null || importInfo === void 0 ? void 0 : importInfo.getLazyExportInfo()) === null || _a === void 0 ? void 0 : _a.getArkExport();
|
|
291
|
-
if (arkExport instanceof ArkNamespace_1.ArkNamespace) {
|
|
292
|
-
const arkClass = arkExport.getClassWithName(clsName);
|
|
293
|
-
if (arkClass) {
|
|
294
|
-
return arkClass;
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
else {
|
|
299
|
-
const importInfo = file.getImportInfoBy(name);
|
|
300
|
-
const arkExport = (_b = importInfo === null || importInfo === void 0 ? void 0 : importInfo.getLazyExportInfo()) === null || _b === void 0 ? void 0 : _b.getArkExport();
|
|
301
|
-
if (arkExport instanceof ArkClass_1.ArkClass) {
|
|
302
|
-
return arkExport;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
return null;
|
|
306
|
-
}
|
|
307
227
|
addCfg2Stmt() {
|
|
308
228
|
const cfg = this.dummyMain.getCfg();
|
|
309
229
|
if (!cfg) {
|
|
@@ -338,9 +258,12 @@ class DummyMainCreater {
|
|
|
338
258
|
}
|
|
339
259
|
classInheritsAbility(arkClass) {
|
|
340
260
|
const ABILITY_BASE_CLASSES = ['UIExtensionAbility', 'Ability', 'FormExtensionAbility', 'UIAbility', 'BackupExtensionAbility'];
|
|
261
|
+
if (ABILITY_BASE_CLASSES.includes(arkClass.getSuperClassName())) {
|
|
262
|
+
return true;
|
|
263
|
+
}
|
|
341
264
|
let superClass = arkClass.getSuperClass();
|
|
342
265
|
while (superClass) {
|
|
343
|
-
if (ABILITY_BASE_CLASSES.includes(superClass.
|
|
266
|
+
if (ABILITY_BASE_CLASSES.includes(superClass.getSuperClassName())) {
|
|
344
267
|
return true;
|
|
345
268
|
}
|
|
346
269
|
superClass = superClass.getSuperClass();
|
|
@@ -356,77 +279,6 @@ class DummyMainCreater {
|
|
|
356
279
|
});
|
|
357
280
|
return methods;
|
|
358
281
|
}
|
|
359
|
-
getEntryMethodsFromModuleJson5() {
|
|
360
|
-
const projectDir = this.scene.getRealProjectDir();
|
|
361
|
-
const buildProfile = path_1.default.join(projectDir, 'build-profile.json5');
|
|
362
|
-
if (!fs_1.default.existsSync(buildProfile)) {
|
|
363
|
-
logger.error(`${buildProfile} is not exists.`);
|
|
364
|
-
return [];
|
|
365
|
-
}
|
|
366
|
-
const abilities = [];
|
|
367
|
-
const buildProfileConfig = (0, json5parser_1.fetchDependenciesFromFile)(buildProfile);
|
|
368
|
-
let modules;
|
|
369
|
-
if (buildProfileConfig instanceof Object) {
|
|
370
|
-
Object.entries(buildProfileConfig).forEach(([k, v]) => {
|
|
371
|
-
if (k === 'modules' && Array.isArray(v)) {
|
|
372
|
-
modules = v;
|
|
373
|
-
return;
|
|
374
|
-
}
|
|
375
|
-
});
|
|
376
|
-
}
|
|
377
|
-
if (Array.isArray(modules)) {
|
|
378
|
-
for (const module of modules) {
|
|
379
|
-
const modulePath = path_1.default.join(projectDir, module.srcPath);
|
|
380
|
-
let moduleAbilities = this.getAbilitiesByParseModuleJson(modulePath);
|
|
381
|
-
abilities.push(...moduleAbilities);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
const entryMethods = [];
|
|
385
|
-
for (const ability of abilities) {
|
|
386
|
-
const abilityEntryMethods = [];
|
|
387
|
-
let cls = ability;
|
|
388
|
-
for (const method of cls.getMethods()) {
|
|
389
|
-
if (method.isPrivate()) {
|
|
390
|
-
continue;
|
|
391
|
-
}
|
|
392
|
-
for (const mtd of abilityEntryMethods) {
|
|
393
|
-
if (mtd.getName() === method.getName()) {
|
|
394
|
-
continue;
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
if (entryMethodUtils_1.LIFECYCLE_METHOD_NAME.includes(method.getName()) && !entryMethods.includes(method)) {
|
|
398
|
-
abilityEntryMethods.push(method);
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
entryMethods.push(...abilityEntryMethods);
|
|
402
|
-
}
|
|
403
|
-
return entryMethods;
|
|
404
|
-
}
|
|
405
|
-
getAbilitiesByParseModuleJson(modulePath) {
|
|
406
|
-
const jsonPath = path_1.default.join(modulePath, '/src/main/module.json5');
|
|
407
|
-
let abilities = [];
|
|
408
|
-
const ABILITY_NAMES = ['abilities', 'extensionAbilities'];
|
|
409
|
-
try {
|
|
410
|
-
const config = (0, json5parser_1.fetchDependenciesFromFile)(jsonPath);
|
|
411
|
-
const configModule = config.module;
|
|
412
|
-
if (configModule instanceof Object) {
|
|
413
|
-
Object.entries(configModule).forEach(([k, v]) => {
|
|
414
|
-
if (ABILITY_NAMES.includes(k)) {
|
|
415
|
-
const moduleAbilities = (0, entryMethodUtils_1.getAbilities)(v, modulePath, this.scene);
|
|
416
|
-
for (const ability of moduleAbilities) {
|
|
417
|
-
if (!abilities.includes(ability)) {
|
|
418
|
-
abilities.push(ability);
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
});
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
catch (err) {
|
|
426
|
-
logger.error(err);
|
|
427
|
-
}
|
|
428
|
-
return abilities;
|
|
429
|
-
}
|
|
430
282
|
getCallbackMethods() {
|
|
431
283
|
const callbackMethods = [];
|
|
432
284
|
this.scene.getMethods().forEach(method => {
|
|
@@ -64,11 +64,8 @@ export declare const COMPONENT_IF_BRANCH: string;
|
|
|
64
64
|
export declare const COMPONENT_BRANCH_FUNCTION: string;
|
|
65
65
|
export declare const COMPONENT_BUILD_FUNCTION: string;
|
|
66
66
|
export declare const SPECIAL_CONTAINER_COMPONENT: Set<string>;
|
|
67
|
-
export declare const COMPONENT_PATH: string;
|
|
68
67
|
export declare const COMPONENT_COMMON: string;
|
|
69
68
|
export declare const COMPONENT_INSTANCE: string;
|
|
70
|
-
export declare const API_INTERNAL: string;
|
|
71
|
-
export declare const API_COMMON: string;
|
|
72
69
|
export declare const COMPONENT_ATTRIBUTE: string;
|
|
73
70
|
export declare const CALL_BACK: string;
|
|
74
71
|
export declare const ON_OFF: Set<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EtsConst.d.ts","sourceRoot":"","sources":["../../../src/core/common/EtsConst.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"EtsConst.d.ts","sourceRoot":"","sources":["../../../src/core/common/EtsConst.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAy4BhC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAkB,CAAC;AACpD,eAAO,MAAM,uBAAuB,EAAE,MAAsB,CAAC;AAE7D,eAAO,MAAM,wBAAwB,EAAE,GAAG,CAAC,MAAM,CAI/C,CAAC;AAEH,eAAO,MAAM,wBAAwB,EAAE,GAAG,CAAC,MAAM,CAqD/C,CAAC;AAEH,eAAO,MAAM,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAqE,CAAC;AAClH,eAAO,MAAM,eAAe,EAAE,MAAgB,CAAC;AAC/C,eAAO,MAAM,iBAAiB,EAAE,MAAkB,CAAC;AACnD,eAAO,MAAM,uBAAuB,EAAE,MAAuB,CAAC;AAE9D,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE1D;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED,eAAO,MAAM,yBAAyB,EAAE,MAAiB,CAAC;AAC1D,eAAO,MAAM,sBAAsB,EAAE,MAAc,CAAC;AACpD,eAAO,MAAM,oBAAoB,EAAE,MAAe,CAAC;AACnD,eAAO,MAAM,gBAAgB,EAAE,MAAiB,CAAC;AAEjD,eAAO,MAAM,YAAY,EAAE,MAAa,CAAC;AACzC,eAAO,MAAM,mBAAmB,EAAE,MAAmB,CAAC;AACtD,eAAO,MAAM,yBAAyB,EAAE,MAAiB,CAAC;AAC1D,eAAO,MAAM,wBAAwB,EAAE,MAAgB,CAAC;AAExD,eAAO,MAAM,2BAA2B,EAAE,GAAG,CAAC,MAAM,CAKlD,CAAC;AAGH,eAAO,MAAM,gBAAgB,EAAE,MAAiB,CAAC;AACjD,eAAO,MAAM,kBAAkB,EAAE,MAAmB,CAAC;AAErD,eAAO,MAAM,mBAAmB,EAAE,MAAoB,CAAC;AACvD,eAAO,MAAM,SAAS,EAAE,MAAmB,CAAC;AAC5C,eAAO,MAAM,MAAM,EAAE,GAAG,CAAC,MAAM,CAA0B,CAAC;AAE1D,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AACnD,eAAO,MAAM,mBAAmB,wBAAwB,CAAC"}
|
|
@@ -13,12 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.BUILD_PROFILE_JSON5 = exports.OH_PACKAGE_JSON5 = exports.ON_OFF = exports.CALL_BACK = exports.COMPONENT_ATTRIBUTE = exports.
|
|
21
|
-
const path_1 = __importDefault(require("path"));
|
|
17
|
+
exports.BUILD_PROFILE_JSON5 = exports.OH_PACKAGE_JSON5 = exports.ON_OFF = exports.CALL_BACK = exports.COMPONENT_ATTRIBUTE = exports.COMPONENT_INSTANCE = exports.COMPONENT_COMMON = exports.SPECIAL_CONTAINER_COMPONENT = exports.COMPONENT_BUILD_FUNCTION = exports.COMPONENT_BRANCH_FUNCTION = exports.COMPONENT_IF_BRANCH = exports.COMPONENT_IF = exports.COMPONENT_REPEAT = exports.COMPONENT_CUSTOMVIEW = exports.COMPONENT_POP_FUNCTION = exports.COMPONENT_CREATE_FUNCTION = exports.isEtsContainerComponent = exports.isEtsSystemComponent = exports.isEtsAtomicComponent = exports.BUILDER_PARAM_DECORATOR = exports.BUILDER_DECORATOR = exports.ENTRY_DECORATOR = exports.COMPONENT_DECORATOR = exports.BUILDIN_ATOMIC_COMPONENT = exports.BUILDIN_SYSTEM_COMPONENT = exports.COMPONENT_LAZY_FOR_EACH = exports.COMPONENT_FOR_EACH = exports.ETS_COMPILER_OPTIONS = void 0;
|
|
22
18
|
exports.ETS_COMPILER_OPTIONS = {
|
|
23
19
|
ets: {
|
|
24
20
|
emitDecorators: [
|
|
@@ -1016,11 +1012,8 @@ exports.SPECIAL_CONTAINER_COMPONENT = new Set([
|
|
|
1016
1012
|
exports.COMPONENT_CUSTOMVIEW,
|
|
1017
1013
|
exports.COMPONENT_REPEAT,
|
|
1018
1014
|
]);
|
|
1019
|
-
exports.COMPONENT_PATH = path_1.default.sep + 'component' + path_1.default.sep;
|
|
1020
1015
|
exports.COMPONENT_COMMON = 'Common';
|
|
1021
1016
|
exports.COMPONENT_INSTANCE = 'Instance';
|
|
1022
|
-
exports.API_INTERNAL = path_1.default.sep + '@internal' + path_1.default.sep;
|
|
1023
|
-
exports.API_COMMON = path_1.default.sep + 'common' + path_1.default.sep;
|
|
1024
1017
|
exports.COMPONENT_ATTRIBUTE = 'Attribute';
|
|
1025
1018
|
exports.CALL_BACK = 'Callback';
|
|
1026
1019
|
exports.ON_OFF = new Set(['on', 'off']);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRInference.d.ts","sourceRoot":"","sources":["../../../src/core/common/IRInference.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAKH,SAAS,EAIT,IAAI,EAIP,MAAM,cAAc,C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BxF,OAAO,CAAC,MAAM,CAAC,SAAS;IAoBxB,OAAO,CAAC,MAAM,CAAC,QAAQ;WAqBT,qBAAqB,CAAC,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;WAehF,mBAAmB,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI;IAgBxF,OAAO,CAAC,MAAM,CAAC,eAAe;IA0C9B,OAAO,CAAC,MAAM,CAAC,gCAAgC;IAgD/C,OAAO,CAAC,MAAM,CAAC,YAAY;WAYb,sBAAsB,CAAC,IAAI,EAAE,eAAe,EAAE,QAAQ,EAAE,eAAe,GAAG,eAAe;IAcvG,OAAO,CAAC,MAAM,CAAC,cAAc;IAmB7B,OAAO,CAAC,MAAM,CAAC,UAAU;IAsBzB,OAAO,CAAC,MAAM,CAAC,yBAAyB;WA4C1B,mBAAmB,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,IAAI;IA+B/H,OAAO,CAAC,MAAM,CAAC,eAAe;WA+BhB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,EAAE,SAAS,GAAG,YAAY;CAuB5F"}
|
|
@@ -25,7 +25,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.IRInference = void 0;
|
|
27
27
|
/*
|
|
28
|
-
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
|
28
|
+
* Copyright (c) 2024-2025 Huawei Device Co., Ltd.
|
|
29
29
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
30
30
|
* you may not use this file except in compliance with the License.
|
|
31
31
|
* You may obtain a copy of the License at
|
|
@@ -423,7 +423,10 @@ class IRInference {
|
|
|
423
423
|
static inferLocal(base, arkMethod) {
|
|
424
424
|
var _a, _b, _c;
|
|
425
425
|
const arkClass = arkMethod.getDeclaringArkClass();
|
|
426
|
-
if (base.getName() === TSConst_1.THIS_NAME
|
|
426
|
+
if (base.getName() === TSConst_1.THIS_NAME) {
|
|
427
|
+
if (!arkClass.isAnonymousClass()) {
|
|
428
|
+
base.setType(new Type_1.ClassType(arkClass.getSignature(), arkClass.getGenericsTypes()));
|
|
429
|
+
}
|
|
427
430
|
return;
|
|
428
431
|
}
|
|
429
432
|
let baseType = base.getType();
|
|
@@ -561,6 +564,9 @@ class IRInference {
|
|
|
561
564
|
else if (type) {
|
|
562
565
|
model = type;
|
|
563
566
|
}
|
|
567
|
+
if (expr.getRealGenericTypes() !== undefined && originalObject instanceof Type_1.UnclearReferenceType) {
|
|
568
|
+
expr.setRealGenericTypes(originalObject.getGenericTypes());
|
|
569
|
+
}
|
|
564
570
|
}
|
|
565
571
|
if (Expr_1.AliasTypeExpr.isAliasTypeOriginalModel(model)) {
|
|
566
572
|
expr.setOriginalObject(model);
|
|
@@ -47,6 +47,7 @@ export declare class ModelUtils {
|
|
|
47
47
|
static findArkModelByRefName(refName: string, arkClass: ArkClass): ArkExport | ArkField | null;
|
|
48
48
|
static findArkModelBySignature(signature: Signature, scene: Scene): ArkExport | ArkField | null;
|
|
49
49
|
}
|
|
50
|
+
export declare const sdkImportMap: Map<string, ArkFile>;
|
|
50
51
|
/**
|
|
51
52
|
* find arkFile by from info
|
|
52
53
|
* export xx from '../xx'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ModelUtils.d.ts","sourceRoot":"","sources":["../../../src/core/common/ModelUtils.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MA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qCtF,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI;WAmB/E,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI;WA4BvF,uBAAuB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,IAAI;CAsBzG;AAMD,eAAO,MAAM,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAA8B,CAAC;AAE7E;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CA6BnE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,UAAU,GAAG,IAAI,CA4BpE;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,IAAI,CA4BlF;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,gBAAgB,EAAE,OAAO,GAAG,SAAS,GAAG,IAAI,CAiB7F;AAiED,wBAAgB,iBAAiB,CAAC,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC,GAAG,IAAI,CAK9F"}
|
|
@@ -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.initModulePathMap = exports.findArkExportInFile = exports.findArkExport = exports.findExportInfo = exports.getArkFile = exports.ModelUtils = void 0;
|
|
43
|
+
exports.initModulePathMap = exports.findArkExportInFile = exports.findArkExport = exports.findExportInfo = exports.getArkFile = exports.sdkImportMap = exports.ModelUtils = void 0;
|
|
44
44
|
const Local_1 = require("../base/Local");
|
|
45
45
|
const ArkClass_1 = require("../model/ArkClass");
|
|
46
46
|
const ArkMethod_1 = require("../model/ArkMethod");
|
|
@@ -457,6 +457,7 @@ ModelUtils.implicitArkUIBuilderMethods = new Set();
|
|
|
457
457
|
const logger = logger_1.default.getLogger(logger_1.LOG_MODULE_TYPE.ARKANALYZER, 'ModelUtils');
|
|
458
458
|
let moduleMap;
|
|
459
459
|
const fileSuffixArray = ['.ets', '.ts', '.d.ets', '.d.ts'];
|
|
460
|
+
exports.sdkImportMap = new Map();
|
|
460
461
|
/**
|
|
461
462
|
* find arkFile by from info
|
|
462
463
|
* export xx from '../xx'
|
|
@@ -482,6 +483,10 @@ function getArkFile(im) {
|
|
|
482
483
|
}
|
|
483
484
|
}
|
|
484
485
|
//sdk path
|
|
486
|
+
const file = exports.sdkImportMap.get(from);
|
|
487
|
+
if (file) {
|
|
488
|
+
return file;
|
|
489
|
+
}
|
|
485
490
|
const scene = im.getDeclaringArkFile().getScene();
|
|
486
491
|
for (const sdk of scene.getProjectSdkMap().values()) {
|
|
487
492
|
const arkFile = getArkFileFormMap(sdk.name, processSdkPath(sdk, from), scene);
|
|
@@ -576,24 +581,11 @@ function findArkExportInFile(name, declaringArkFile) {
|
|
|
576
581
|
}
|
|
577
582
|
exports.findArkExportInFile = findArkExportInFile;
|
|
578
583
|
function processSdkPath(sdk, formPath) {
|
|
579
|
-
let
|
|
580
|
-
if (
|
|
581
|
-
|
|
582
|
-
}
|
|
583
|
-
else if (formPath.startsWith('@kit.')) {
|
|
584
|
-
dir = 'kits';
|
|
585
|
-
}
|
|
586
|
-
else if (formPath.startsWith('@arkts.')) {
|
|
587
|
-
dir = 'arkts';
|
|
588
|
-
}
|
|
589
|
-
else {
|
|
590
|
-
let originPath = path_1.default.join(sdk.path, formPath);
|
|
591
|
-
if (FileUtils_1.FileUtils.isDirectory(originPath)) {
|
|
592
|
-
formPath = path_1.default.join(formPath, FileUtils_1.FileUtils.getIndexFileName(originPath));
|
|
593
|
-
}
|
|
594
|
-
return `${formPath}`;
|
|
584
|
+
let originPath = path_1.default.join(sdk.path, formPath);
|
|
585
|
+
if (FileUtils_1.FileUtils.isDirectory(originPath)) {
|
|
586
|
+
formPath = path_1.default.join(formPath, FileUtils_1.FileUtils.getIndexFileName(originPath));
|
|
595
587
|
}
|
|
596
|
-
return `${
|
|
588
|
+
return `${formPath}`;
|
|
597
589
|
}
|
|
598
590
|
function getArkFileFromScene(im, originPath) {
|
|
599
591
|
if (FileUtils_1.FileUtils.isDirectory(originPath)) {
|
|
@@ -626,7 +618,7 @@ function findExportInfoInfile(fromInfo, file) {
|
|
|
626
618
|
if (exportInfo) {
|
|
627
619
|
return exportInfo;
|
|
628
620
|
}
|
|
629
|
-
if (
|
|
621
|
+
if (exportName === TSConst_1.DEFAULT) {
|
|
630
622
|
exportInfo = file.getExportInfos().find(p => p.isDefault());
|
|
631
623
|
if (exportInfo) {
|
|
632
624
|
file.addExportInfo(exportInfo, TSConst_1.DEFAULT);
|
|
@@ -638,10 +630,9 @@ function findExportInfoInfile(fromInfo, file) {
|
|
|
638
630
|
file.addExportInfo(exportInfo, TSConst_1.ALL);
|
|
639
631
|
}
|
|
640
632
|
else if (/\.d\.e?ts$/.test(file.getName())) {
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
}
|
|
633
|
+
let declare = exportName === TSConst_1.DEFAULT ? undefined
|
|
634
|
+
: findArkExportInFile(fromInfo.getOriginName(), file) || undefined;
|
|
635
|
+
exportInfo = (0, ArkExportBuilder_1.buildDefaultExportInfo)(fromInfo, file, declare);
|
|
645
636
|
}
|
|
646
637
|
return exportInfo;
|
|
647
638
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SdkUtils.d.ts","sourceRoot":"","sources":["../../../src/core/common/SdkUtils.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"SdkUtils.d.ts","sourceRoot":"","sources":["../../../src/core/common/SdkUtils.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAW/C,qBAAa,QAAQ;WAEH,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,IAAI;IAgCpF,OAAO,CAAC,MAAM,CAAC,SAAS;IAexB,OAAO,CAAC,MAAM,CAAC,eAAe;IAmB9B,OAAO,CAAC,MAAM,CAAC,UAAU;CAW5B"}
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
16
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
20
|
exports.SdkUtils = void 0;
|
|
18
21
|
const EtsConst_1 = require("./EtsConst");
|
|
@@ -21,11 +24,15 @@ const Const_1 = require("./Const");
|
|
|
21
24
|
const ArkClass_1 = require("../model/ArkClass");
|
|
22
25
|
const ArkSignature_1 = require("../model/ArkSignature");
|
|
23
26
|
const ModelUtils_1 = require("./ModelUtils");
|
|
27
|
+
const path_1 = __importDefault(require("path"));
|
|
24
28
|
class SdkUtils {
|
|
25
29
|
static buildGlobalMap(file, globalMap) {
|
|
26
|
-
var _a, _b, _c;
|
|
27
|
-
const
|
|
28
|
-
|
|
30
|
+
var _a, _b, _c, _d;
|
|
31
|
+
const fileName = path_1.default.basename(file.getName());
|
|
32
|
+
if (fileName.startsWith('@')) {
|
|
33
|
+
ModelUtils_1.sdkImportMap.set(fileName.replace(/\.d\.e?ts$/, ''), file);
|
|
34
|
+
}
|
|
35
|
+
const isGlobalPath = (_a = file.getScene().getOptions().sdkGlobalFolders) === null || _a === void 0 ? void 0 : _a.find(x => file.getFilePath().includes(path_1.default.sep + x + path_1.default.sep));
|
|
29
36
|
if (!isGlobalPath) {
|
|
30
37
|
return;
|
|
31
38
|
}
|
|
@@ -40,13 +47,13 @@ class SdkUtils {
|
|
|
40
47
|
}
|
|
41
48
|
});
|
|
42
49
|
const defaultArkMethod = file.getDefaultClass().getDefaultArkMethod();
|
|
43
|
-
(
|
|
50
|
+
(_b = defaultArkMethod === null || defaultArkMethod === void 0 ? void 0 : defaultArkMethod.getBody()) === null || _b === void 0 ? void 0 : _b.getLocals().forEach(local => {
|
|
44
51
|
const name = local.getName();
|
|
45
52
|
if (name !== TSConst_1.THIS_NAME && !name.startsWith(Const_1.TEMP_LOCAL_PREFIX) && !name.endsWith(EtsConst_1.COMPONENT_INSTANCE)) {
|
|
46
53
|
this.loadGlobalLocal(local, defaultArkMethod, globalMap);
|
|
47
54
|
}
|
|
48
55
|
});
|
|
49
|
-
(
|
|
56
|
+
(_d = (_c = defaultArkMethod === null || defaultArkMethod === void 0 ? void 0 : defaultArkMethod.getBody()) === null || _c === void 0 ? void 0 : _c.getAliasTypeMap()) === null || _d === void 0 ? void 0 : _d.forEach(a => globalMap.set(a[0].getName(), a[0]));
|
|
50
57
|
}
|
|
51
58
|
static loadClass(globalMap, cls) {
|
|
52
59
|
const old = globalMap.get(cls.getName());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeInference.d.ts","sourceRoot":"","sources":["../../../src/core/common/TypeInference.ts"],"names":[],"mappings":"AA0BA,OAAO,EAAyC,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,EAOH,YAAY,EACZ,WAAW,EAKX,IAAI,EACJ,oBAAoB,EAKvB,MAAM,cAAc,CAAC;AACt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D3G;;;;;;;OAOG;WACW,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI;WAoBhE,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;WAgB9E,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,IAAI;WAUrE,mBAAmB,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,GAAG,IAAI;WAwCzD,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI;WASlC,iBAAiB,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,SAAS,GAAG,IAAI;CAiBrI"}
|
|
@@ -447,6 +447,9 @@ class TypeInference {
|
|
|
447
447
|
return new Type_1.ArrayType((_a = realTypes[0]) !== null && _a !== void 0 ? _a : Type_1.AnyType.getInstance(), 1);
|
|
448
448
|
}
|
|
449
449
|
let type = this.inferUnclearRefName(urType.getName(), arkClass);
|
|
450
|
+
if (type instanceof Type_1.AliasType) {
|
|
451
|
+
return type;
|
|
452
|
+
}
|
|
450
453
|
return type ? this.replaceTypeWithReal(type, realTypes) : null;
|
|
451
454
|
}
|
|
452
455
|
/**
|
|
@@ -573,7 +576,7 @@ class TypeInference {
|
|
|
573
576
|
if (field && !this.isUnclearType(field.getType())) {
|
|
574
577
|
return field.getType();
|
|
575
578
|
}
|
|
576
|
-
let arkExport = (_m = (
|
|
579
|
+
let arkExport = (_m = (_k = (_j = (_e = ModelUtils_1.ModelUtils.getClassWithName(baseName, arkClass)) !== null && _e !== void 0 ? _e : (_h = (_g = (_f = ModelUtils_1.ModelUtils.getDefaultClass(arkClass)) === null || _f === void 0 ? void 0 : _f.getDefaultArkMethod()) === null || _g === void 0 ? void 0 : _g.getBody()) === null || _h === void 0 ? void 0 : _h.getAliasTypeByName(baseName)) !== null && _j !== void 0 ? _j : ModelUtils_1.ModelUtils.getNamespaceWithName(baseName, arkClass)) !== null && _k !== void 0 ? _k : (_l = ModelUtils_1.ModelUtils.getDefaultClass(arkClass)) === null || _l === void 0 ? void 0 : _l.getMethodWithName(baseName)) !== null && _m !== void 0 ? _m : ModelUtils_1.ModelUtils.getArkExportInImportInfoWithName(baseName, arkClass.getDeclaringArkFile());
|
|
577
580
|
if (!arkExport && !arkClass.getDeclaringArkFile().getImportInfoBy(baseName)) {
|
|
578
581
|
arkExport = arkClass.getDeclaringArkFile().getScene().getSdkGlobal(baseName);
|
|
579
582
|
}
|
|
@@ -603,7 +606,7 @@ class TypeInference {
|
|
|
603
606
|
return TypeInference.parseArkExport2Type((_a = importInfo.getLazyExportInfo()) === null || _a === void 0 ? void 0 : _a.getArkExport());
|
|
604
607
|
}
|
|
605
608
|
static replaceTypeWithReal(type, realTypes) {
|
|
606
|
-
var _a, _b, _c, _d, _e, _f;
|
|
609
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
607
610
|
if (type instanceof Type_1.ClassType) {
|
|
608
611
|
const replacedTypes = (_b = (_a = type.getRealGenericTypes()) === null || _a === void 0 ? void 0 : _a.map(g => this.replaceTypeWithReal(g, realTypes))) !== null && _b !== void 0 ? _b : realTypes;
|
|
609
612
|
return replacedTypes && replacedTypes.length > 0 ? new Type_1.ClassType(type.getClassSignature(), replacedTypes) : type;
|
|
@@ -613,20 +616,30 @@ class TypeInference {
|
|
|
613
616
|
return replacedTypes && replacedTypes.length > 0 ? new Type_1.FunctionType(type.getMethodSignature(), replacedTypes) : type;
|
|
614
617
|
}
|
|
615
618
|
else if (type instanceof Type_1.AliasType && realTypes) {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
619
|
+
const newObjectType = this.replaceTypeWithReal(type.getOriginalType(), realTypes);
|
|
620
|
+
const replacedTypes = (_f = (_e = type.getRealGenericTypes()) === null || _e === void 0 ? void 0 : _e.map(g => this.replaceTypeWithReal(g, realTypes))) !== null && _f !== void 0 ? _f : realTypes;
|
|
621
|
+
if (replacedTypes.length > 0) {
|
|
622
|
+
const newAliasType = new Type_1.AliasType(type.getName(), newObjectType, type.getSignature(), type.getGenericTypes());
|
|
623
|
+
newAliasType.setRealGenericTypes(replacedTypes);
|
|
624
|
+
return newAliasType;
|
|
620
625
|
}
|
|
621
|
-
lastAlias.setOriginalType(this.replaceTypeWithReal(originalType, realTypes));
|
|
622
626
|
}
|
|
623
627
|
else if (type instanceof Type_1.UnionType && realTypes) {
|
|
624
628
|
const types = [];
|
|
625
629
|
type.flatType().forEach(t => types.push(this.replaceTypeWithReal(t, realTypes)));
|
|
626
630
|
return new Type_1.UnionType(types, this.replaceTypeWithReal(type.getCurrType(), realTypes));
|
|
627
631
|
}
|
|
632
|
+
else if (type instanceof Type_1.ArrayType && realTypes) {
|
|
633
|
+
const replacedBaseType = this.replaceTypeWithReal(type.getBaseType(), realTypes);
|
|
634
|
+
return new Type_1.ArrayType(replacedBaseType, type.getDimension());
|
|
635
|
+
}
|
|
636
|
+
else if (type instanceof Type_1.TupleType && realTypes) {
|
|
637
|
+
let replacedTypes = [];
|
|
638
|
+
type.getTypes().forEach(t => { replacedTypes.push(this.replaceTypeWithReal(t, realTypes)); });
|
|
639
|
+
return new Type_1.TupleType(replacedTypes);
|
|
640
|
+
}
|
|
628
641
|
else if (type instanceof Type_1.GenericType) {
|
|
629
|
-
const realType = (
|
|
642
|
+
const realType = (_h = (_g = realTypes === null || realTypes === void 0 ? void 0 : realTypes[type.getIndex()]) !== null && _g !== void 0 ? _g : type.getDefaultType()) !== null && _h !== void 0 ? _h : type.getConstraint();
|
|
630
643
|
if (realType) {
|
|
631
644
|
return realType;
|
|
632
645
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataflowProblem.d.ts","sourceRoot":"","sources":["../../../src/core/dataflow/DataflowProblem.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"DataflowProblem.d.ts","sourceRoot":"","sources":["../../../src/core/dataflow/DataflowProblem.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,8BAAsB,eAAe,CAAC,CAAC;IAEnC;;;;OAIG;IAWH,QAAQ,CAAC,qBAAqB,CAAC,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,IAAI,GAAI,YAAY,CAAC,CAAC,CAAC;IAE5E,QAAQ,CAAC,mBAAmB,CAAC,OAAO,EAAC,IAAI,EAAE,MAAM,EAAC,SAAS,GAAI,YAAY,CAAC,CAAC,CAAC;IAE9E,QAAQ,CAAC,2BAA2B,CAAC,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAC,IAAI,GAAI,YAAY,CAAC,CAAC,CAAC;IAEjG,QAAQ,CAAC,2BAA2B,CAAC,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,IAAI,GAAI,YAAY,CAAC,CAAC,CAAC;IAElF,QAAQ,CAAC,eAAe,IAAK,CAAC;IAE9B,QAAQ,CAAC,aAAa,IAAK,IAAI;IAE/B,QAAQ,CAAC,cAAc,IAAK,SAAS;IAErC,QAAQ,CAAC,SAAS,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,OAAO;CAC5C;AAED,MAAM,WAAW,YAAY,CAAC,CAAC;IAC3B,YAAY,CAAC,CAAC,EAAC,CAAC,GAAI,GAAG,CAAC,CAAC,CAAC,CAAC;CAC9B"}
|