arkanalyzer 1.0.81 → 1.0.82
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/lib/core/common/Const.d.ts +2 -0
- package/lib/core/common/Const.d.ts.map +1 -1
- package/lib/core/common/Const.js +4 -2
- package/lib/core/common/EtsConst.d.ts +1 -0
- package/lib/core/common/EtsConst.d.ts.map +1 -1
- package/lib/core/common/EtsConst.js +3 -2
- package/lib/core/common/IRInference.d.ts +0 -7
- package/lib/core/common/IRInference.d.ts.map +1 -1
- package/lib/core/common/IRInference.js +11 -27
- package/lib/core/common/ModelUtils.d.ts.map +1 -1
- package/lib/core/common/ModelUtils.js +8 -15
- package/lib/core/inference/ModelInference.d.ts.map +1 -1
- package/lib/core/inference/ModelInference.js +25 -5
- package/lib/core/inference/ValueInference.d.ts +1 -36
- package/lib/core/inference/ValueInference.d.ts.map +1 -1
- package/lib/core/inference/ValueInference.js +1 -174
- package/lib/core/inference/abc/AbcInference.d.ts +7 -0
- package/lib/core/inference/abc/AbcInference.d.ts.map +1 -1
- package/lib/core/inference/abc/AbcInference.js +28 -2
- package/lib/core/inference/arkts/ArkTsInference.d.ts +43 -1
- package/lib/core/inference/arkts/ArkTsInference.d.ts.map +1 -1
- package/lib/core/inference/arkts/ArkTsInference.js +189 -2
- package/lib/core/model/builder/ArkClassBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkClassBuilder.js +2 -5
- package/lib/core/model/builder/ArkMethodBuilder.d.ts.map +1 -1
- package/lib/core/model/builder/ArkMethodBuilder.js +3 -3
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -1
- package/lib/save/base/BasePrinter.d.ts.map +1 -1
- package/lib/save/base/BasePrinter.js +6 -5
- package/lib/utils/IntMap.d.ts +48 -0
- package/lib/utils/IntMap.d.ts.map +1 -0
- package/lib/utils/IntMap.js +134 -0
- package/lib/utils/IntWorkList.d.ts +35 -0
- package/lib/utils/IntWorkList.d.ts.map +1 -0
- package/lib/utils/IntWorkList.js +97 -0
- package/lib/utils/PackedSparseMap.d.ts +26 -0
- package/lib/utils/PackedSparseMap.d.ts.map +1 -0
- package/lib/utils/PackedSparseMap.js +140 -0
- package/lib/utils/logger.d.ts +1 -0
- package/lib/utils/logger.d.ts.map +1 -1
- package/lib/utils/logger.js +1 -0
- package/package.json +2 -2
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ImportInfoInference, MethodInference, StmtInference } from '../ModelInference';
|
|
2
2
|
import { ArkMethod } from '../../model/ArkMethod';
|
|
3
3
|
import { InferenceBuilder } from '../InferenceBuilder';
|
|
4
|
+
import { FieldRefInference } from '../ValueInference';
|
|
5
|
+
import { Stmt } from '../../base/Stmt';
|
|
6
|
+
import { ArkInstanceFieldRef } from '../../base/Ref';
|
|
4
7
|
export declare class AbcMethodInference extends MethodInference {
|
|
5
8
|
preInfer(arkMethod: ArkMethod): void;
|
|
6
9
|
private inferArkUIComponentLifeCycleMethod;
|
|
@@ -10,4 +13,8 @@ export declare class AbcInferenceBuilder extends InferenceBuilder {
|
|
|
10
13
|
buildMethodInference(): MethodInference;
|
|
11
14
|
buildStmtInference(): StmtInference;
|
|
12
15
|
}
|
|
16
|
+
export declare class AbcFieldRefInference extends FieldRefInference {
|
|
17
|
+
getValueName(): string;
|
|
18
|
+
preInfer(value: ArkInstanceFieldRef, stmt: Stmt): boolean;
|
|
19
|
+
}
|
|
13
20
|
//# sourceMappingURL=AbcInference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbcInference.d.ts","sourceRoot":"","sources":["../../../../src/core/inference/abc/AbcInference.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGxF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"AbcInference.d.ts","sourceRoot":"","sources":["../../../../src/core/inference/abc/AbcInference.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGxF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,EAAQ,iBAAiB,EAAiC,MAAM,mBAAmB,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,OAAO,EAAoB,mBAAmB,EAAmB,MAAM,gBAAgB,CAAC;AA6BxF,qBAAa,kBAAmB,SAAQ,eAAe;IAE5C,QAAQ,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI;IAQ3C,OAAO,CAAC,kCAAkC;CA8B7C;AA0CD,qBAAa,mBAAoB,SAAQ,gBAAgB;IAE9C,wBAAwB,IAAI,mBAAmB;IAI/C,oBAAoB,IAAI,eAAe;IAIvC,kBAAkB,IAAI,aAAa;CAK7C;AAED,qBACa,oBAAqB,SAAQ,iBAAiB;IAChD,YAAY,IAAI,MAAM;IAItB,QAAQ,CAAC,KAAK,EAAE,mBAAmB,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO;CAWnE"}
|
|
@@ -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
|
|
@@ -13,8 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
16
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.AbcInferenceBuilder = exports.AbcMethodInference = void 0;
|
|
23
|
+
exports.AbcFieldRefInference = exports.AbcInferenceBuilder = exports.AbcMethodInference = void 0;
|
|
18
24
|
const ModelInference_1 = require("../ModelInference");
|
|
19
25
|
const ModelUtils_1 = require("../../common/ModelUtils");
|
|
20
26
|
const ArkMethod_1 = require("../../model/ArkMethod");
|
|
@@ -142,3 +148,23 @@ class AbcInferenceBuilder extends InferenceBuilder_1.InferenceBuilder {
|
|
|
142
148
|
}
|
|
143
149
|
}
|
|
144
150
|
exports.AbcInferenceBuilder = AbcInferenceBuilder;
|
|
151
|
+
let AbcFieldRefInference = class AbcFieldRefInference extends ValueInference_1.FieldRefInference {
|
|
152
|
+
getValueName() {
|
|
153
|
+
return 'ArkInstanceFieldRef';
|
|
154
|
+
}
|
|
155
|
+
preInfer(value, stmt) {
|
|
156
|
+
const type = value.getType();
|
|
157
|
+
const projectName = stmt.getCfg().getDeclaringMethod().getDeclaringArkFile().getProjectName();
|
|
158
|
+
if (TypeInference_1.TypeInference.isAnonType(type, projectName)) {
|
|
159
|
+
const baseType = value.getBase().getType();
|
|
160
|
+
if (!TypeInference_1.TypeInference.isUnclearType(baseType) && !TypeInference_1.TypeInference.isAnonType(baseType, projectName)) {
|
|
161
|
+
return true;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return super.preInfer(value, stmt);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
AbcFieldRefInference = __decorate([
|
|
168
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ABC)
|
|
169
|
+
], AbcFieldRefInference);
|
|
170
|
+
exports.AbcFieldRefInference = AbcFieldRefInference;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { ClassInference, ImportInfoInference, MethodInference, StmtInference } from '../ModelInference';
|
|
2
2
|
import { ArkMethod } from '../../model/ArkMethod';
|
|
3
3
|
import { InferenceBuilder } from '../InferenceBuilder';
|
|
4
|
-
import { ValueInference } from '../ValueInference';
|
|
4
|
+
import { FieldRefInference, InstanceInvokeExprInference, LocalInference, ValueInference } from '../ValueInference';
|
|
5
5
|
import { Stmt } from '../../base/Stmt';
|
|
6
6
|
import { Value } from '../../base/Value';
|
|
7
7
|
import { Type } from '../../base/Type';
|
|
8
|
+
import { ArkInstanceFieldRef } from '../../base/Ref';
|
|
9
|
+
import { Local } from '../../base/Local';
|
|
10
|
+
import { AliasTypeExpr, ArkInstanceInvokeExpr } from '../../base/Expr';
|
|
8
11
|
export declare class ArkTsStmtInference extends StmtInference {
|
|
9
12
|
constructor(valueInferences: ValueInference<Value>[]);
|
|
10
13
|
typeSpread(stmt: Stmt, method: ArkMethod): Set<Stmt>;
|
|
@@ -25,4 +28,43 @@ export declare class JsInferenceBuilder extends InferenceBuilder {
|
|
|
25
28
|
buildMethodInference(): MethodInference;
|
|
26
29
|
buildStmtInference(): StmtInference;
|
|
27
30
|
}
|
|
31
|
+
export declare class ArkTSFieldRefInference extends FieldRefInference {
|
|
32
|
+
preInfer(value: ArkInstanceFieldRef, stmt: Stmt): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Checks if a value represents an anonymous class 'this' field reference
|
|
35
|
+
* Identifies field references that access fields directly on 'this' in anonymous class constructors
|
|
36
|
+
* @param {Value} stmtDef - The value to check (typically a field reference)
|
|
37
|
+
* @param {ArkMethod} arkMethod - The method containing the value
|
|
38
|
+
* @returns {boolean} True if the value is an anonymous class 'this' field reference
|
|
39
|
+
*/
|
|
40
|
+
private isAnonClassThisRef;
|
|
41
|
+
}
|
|
42
|
+
export declare class ArkTsInstanceInvokeExprInference extends InstanceInvokeExprInference {
|
|
43
|
+
/**
|
|
44
|
+
* Performs inference on an instance invocation expression within the context of a statement
|
|
45
|
+
* Enhances the base implementation with real generic type inference and extension function support
|
|
46
|
+
* @param {ArkInstanceInvokeExpr} value - The invocation expression to infer
|
|
47
|
+
* @param {Stmt} stmt - The statement containing the invocation
|
|
48
|
+
* @returns {Value | undefined} Returns a new expression if transformed, undefined otherwise
|
|
49
|
+
*/
|
|
50
|
+
infer(value: ArkInstanceInvokeExpr, stmt: Stmt): Value | undefined;
|
|
51
|
+
/**
|
|
52
|
+
* process arkUI function with Annotation @Extend @Styles @AnimatableExtend
|
|
53
|
+
* @param expr
|
|
54
|
+
* @param arkMethod
|
|
55
|
+
* @param methodName
|
|
56
|
+
*/
|
|
57
|
+
private processExtendFunc;
|
|
58
|
+
}
|
|
59
|
+
export declare class AliasTypeExprInference extends ValueInference<AliasTypeExpr> {
|
|
60
|
+
getValueName(): string;
|
|
61
|
+
preInfer(value: AliasTypeExpr): boolean;
|
|
62
|
+
infer(value: AliasTypeExpr, stmt: Stmt): Value | undefined;
|
|
63
|
+
}
|
|
64
|
+
export declare class ArkTSLocalInference extends LocalInference {
|
|
65
|
+
getValueName(): string;
|
|
66
|
+
preInfer(value: Local): boolean;
|
|
67
|
+
infer(value: Local, stmt: Stmt): Value | undefined;
|
|
68
|
+
private getEnumValue;
|
|
69
|
+
}
|
|
28
70
|
//# sourceMappingURL=ArkTsInference.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkTsInference.d.ts","sourceRoot":"","sources":["../../../../src/core/inference/arkts/ArkTsInference.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM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AG,SAAS;IA0BzD,OAAO,CAAC,YAAY;CASvB"}
|
|
@@ -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
|
|
@@ -13,10 +13,18 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
17
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
|
+
};
|
|
16
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.JsInferenceBuilder = exports.ArkTs2InferenceBuilder = exports.ArkTsInferenceBuilder = exports.ArkTsStmtInference = void 0;
|
|
23
|
+
exports.ArkTSLocalInference = exports.AliasTypeExprInference = exports.ArkTsInstanceInvokeExprInference = exports.ArkTSFieldRefInference = exports.JsInferenceBuilder = exports.ArkTs2InferenceBuilder = exports.ArkTsInferenceBuilder = exports.ArkTsStmtInference = void 0;
|
|
18
24
|
const ModelInference_1 = require("../ModelInference");
|
|
25
|
+
const ArkImport_1 = require("../../model/ArkImport");
|
|
19
26
|
const ModelUtils_1 = require("../../common/ModelUtils");
|
|
27
|
+
const ArkClass_1 = require("../../model/ArkClass");
|
|
20
28
|
const TypeInference_1 = require("../../common/TypeInference");
|
|
21
29
|
const InferenceBuilder_1 = require("../InferenceBuilder");
|
|
22
30
|
const ValueInference_1 = require("../ValueInference");
|
|
@@ -25,6 +33,11 @@ const Type_1 = require("../../base/Type");
|
|
|
25
33
|
const Ref_1 = require("../../base/Ref");
|
|
26
34
|
const Local_1 = require("../../base/Local");
|
|
27
35
|
const AbcInference_1 = require("../abc/AbcInference");
|
|
36
|
+
const Const_1 = require("../../common/Const");
|
|
37
|
+
const TSConst_1 = require("../../common/TSConst");
|
|
38
|
+
const Expr_1 = require("../../base/Expr");
|
|
39
|
+
const IRInference_1 = require("../../common/IRInference");
|
|
40
|
+
const ArkField_1 = require("../../model/ArkField");
|
|
28
41
|
class ArkTsImportInference extends ModelInference_1.ImportInfoInference {
|
|
29
42
|
/**
|
|
30
43
|
* get arkFile and assign to from file
|
|
@@ -162,3 +175,177 @@ class JsInferenceBuilder extends InferenceBuilder_1.InferenceBuilder {
|
|
|
162
175
|
}
|
|
163
176
|
}
|
|
164
177
|
exports.JsInferenceBuilder = JsInferenceBuilder;
|
|
178
|
+
let ArkTSFieldRefInference = class ArkTSFieldRefInference extends ValueInference_1.FieldRefInference {
|
|
179
|
+
preInfer(value, stmt) {
|
|
180
|
+
if (stmt.getDef() === value && this.isAnonClassThisRef(value, stmt.getCfg().getDeclaringMethod())) {
|
|
181
|
+
return false;
|
|
182
|
+
}
|
|
183
|
+
return super.preInfer(value);
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Checks if a value represents an anonymous class 'this' field reference
|
|
187
|
+
* Identifies field references that access fields directly on 'this' in anonymous class constructors
|
|
188
|
+
* @param {Value} stmtDef - The value to check (typically a field reference)
|
|
189
|
+
* @param {ArkMethod} arkMethod - The method containing the value
|
|
190
|
+
* @returns {boolean} True if the value is an anonymous class 'this' field reference
|
|
191
|
+
*/
|
|
192
|
+
isAnonClassThisRef(stmtDef, arkMethod) {
|
|
193
|
+
return (arkMethod.getName() === Const_1.INSTANCE_INIT_METHOD_NAME || arkMethod.getName() === TSConst_1.CONSTRUCTOR_NAME) &&
|
|
194
|
+
stmtDef instanceof Ref_1.ArkInstanceFieldRef &&
|
|
195
|
+
stmtDef.getBase().getName() === TSConst_1.THIS_NAME &&
|
|
196
|
+
arkMethod.getDeclaringArkClass().isAnonymousClass() &&
|
|
197
|
+
stmtDef.getFieldName().indexOf('.') === -1;
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
ArkTSFieldRefInference = __decorate([
|
|
201
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ARK_TS1_1)
|
|
202
|
+
], ArkTSFieldRefInference);
|
|
203
|
+
exports.ArkTSFieldRefInference = ArkTSFieldRefInference;
|
|
204
|
+
let ArkTsInstanceInvokeExprInference = class ArkTsInstanceInvokeExprInference extends ValueInference_1.InstanceInvokeExprInference {
|
|
205
|
+
/**
|
|
206
|
+
* Performs inference on an instance invocation expression within the context of a statement
|
|
207
|
+
* Enhances the base implementation with real generic type inference and extension function support
|
|
208
|
+
* @param {ArkInstanceInvokeExpr} value - The invocation expression to infer
|
|
209
|
+
* @param {Stmt} stmt - The statement containing the invocation
|
|
210
|
+
* @returns {Value | undefined} Returns a new expression if transformed, undefined otherwise
|
|
211
|
+
*/
|
|
212
|
+
infer(value, stmt) {
|
|
213
|
+
var _a;
|
|
214
|
+
const arkMethod = stmt.getCfg().getDeclaringMethod();
|
|
215
|
+
TypeInference_1.TypeInference.inferRealGenericTypes(value.getRealGenericTypes(), arkMethod.getDeclaringArkClass());
|
|
216
|
+
const result = (_a = IRInference_1.IRInference.inferInstanceMember(value.getBase().getType(), value, arkMethod, ValueInference_1.InstanceInvokeExprInference.inferInvokeExpr)) !== null && _a !== void 0 ? _a : this.processExtendFunc(value, arkMethod, super.getMethodName(value, arkMethod));
|
|
217
|
+
return !result || result === value ? undefined : result;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* process arkUI function with Annotation @Extend @Styles @AnimatableExtend
|
|
221
|
+
* @param expr
|
|
222
|
+
* @param arkMethod
|
|
223
|
+
* @param methodName
|
|
224
|
+
*/
|
|
225
|
+
processExtendFunc(expr, arkMethod, methodName) {
|
|
226
|
+
var _a;
|
|
227
|
+
const annoMethod = (_a = arkMethod.getDeclaringArkClass().getMethodWithName(methodName)) !== null && _a !== void 0 ? _a : arkMethod.getDeclaringArkFile().getDefaultClass().getMethodWithName(methodName);
|
|
228
|
+
if (annoMethod) {
|
|
229
|
+
expr.setMethodSignature(annoMethod.getSignature());
|
|
230
|
+
return expr;
|
|
231
|
+
}
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
ArkTsInstanceInvokeExprInference = __decorate([
|
|
236
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ARK_TS1_1)
|
|
237
|
+
], ArkTsInstanceInvokeExprInference);
|
|
238
|
+
exports.ArkTsInstanceInvokeExprInference = ArkTsInstanceInvokeExprInference;
|
|
239
|
+
let AliasTypeExprInference = class AliasTypeExprInference extends ValueInference_1.ValueInference {
|
|
240
|
+
getValueName() {
|
|
241
|
+
return 'AliasTypeExpr';
|
|
242
|
+
}
|
|
243
|
+
preInfer(value) {
|
|
244
|
+
return value.getOriginalType() === undefined;
|
|
245
|
+
}
|
|
246
|
+
infer(value, stmt) {
|
|
247
|
+
var _a;
|
|
248
|
+
let originalObject = value.getOriginalObject();
|
|
249
|
+
const arkMethod = stmt.getCfg().getDeclaringMethod();
|
|
250
|
+
let type;
|
|
251
|
+
let originalLocal;
|
|
252
|
+
if (originalObject instanceof Local_1.Local) {
|
|
253
|
+
originalLocal = ModelUtils_1.ModelUtils.findArkModelByRefName(originalObject.getName(), arkMethod.getDeclaringArkClass());
|
|
254
|
+
if (Expr_1.AliasTypeExpr.isAliasTypeOriginalModel(originalLocal)) {
|
|
255
|
+
originalObject = originalLocal;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
if (originalObject instanceof ArkImport_1.ImportInfo) {
|
|
259
|
+
const arkExport = (_a = originalObject.getLazyExportInfo()) === null || _a === void 0 ? void 0 : _a.getArkExport();
|
|
260
|
+
const importClauseName = originalObject.getImportClauseName();
|
|
261
|
+
if (importClauseName.includes('.') && arkExport instanceof ArkClass_1.ArkClass) {
|
|
262
|
+
type = TypeInference_1.TypeInference.inferUnclearRefName(importClauseName, arkExport);
|
|
263
|
+
}
|
|
264
|
+
else if (arkExport) {
|
|
265
|
+
type = TypeInference_1.TypeInference.parseArkExport2Type(arkExport);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
else if (originalObject instanceof Type_1.Type) {
|
|
269
|
+
type = TypeInference_1.TypeInference.inferUnclearedType(originalObject, arkMethod.getDeclaringArkClass());
|
|
270
|
+
}
|
|
271
|
+
else if (originalObject instanceof ArkField_1.ArkField) {
|
|
272
|
+
type = originalObject.getType();
|
|
273
|
+
}
|
|
274
|
+
else {
|
|
275
|
+
type = TypeInference_1.TypeInference.parseArkExport2Type(originalObject);
|
|
276
|
+
}
|
|
277
|
+
if (type) {
|
|
278
|
+
const realGenericTypes = value.getRealGenericTypes();
|
|
279
|
+
if (TypeInference_1.TypeInference.checkType(type, t => t instanceof Type_1.GenericType || t instanceof Type_1.AnyType) && realGenericTypes && realGenericTypes.length > 0) {
|
|
280
|
+
TypeInference_1.TypeInference.inferRealGenericTypes(realGenericTypes, arkMethod.getDeclaringArkClass());
|
|
281
|
+
type = TypeInference_1.TypeInference.replaceTypeWithReal(type, realGenericTypes);
|
|
282
|
+
}
|
|
283
|
+
value.setOriginalType(type);
|
|
284
|
+
if (Expr_1.AliasTypeExpr.isAliasTypeOriginalModel(originalLocal)) {
|
|
285
|
+
value.setOriginalObject(originalLocal);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
return undefined;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
AliasTypeExprInference = __decorate([
|
|
292
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ARK_TS1_1)
|
|
293
|
+
], AliasTypeExprInference);
|
|
294
|
+
exports.AliasTypeExprInference = AliasTypeExprInference;
|
|
295
|
+
let ArkTSLocalInference = class ArkTSLocalInference extends ValueInference_1.LocalInference {
|
|
296
|
+
getValueName() {
|
|
297
|
+
return 'Local';
|
|
298
|
+
}
|
|
299
|
+
preInfer(value) {
|
|
300
|
+
const type = value.getType();
|
|
301
|
+
if (value.getName() === TSConst_1.THIS_NAME && type instanceof Type_1.ClassType &&
|
|
302
|
+
type.getClassSignature().getClassName().startsWith(Const_1.ANONYMOUS_CLASS_PREFIX)) {
|
|
303
|
+
return true;
|
|
304
|
+
}
|
|
305
|
+
else if (type instanceof Type_1.FunctionType) {
|
|
306
|
+
return true;
|
|
307
|
+
}
|
|
308
|
+
return super.preInfer(value);
|
|
309
|
+
}
|
|
310
|
+
infer(value, stmt) {
|
|
311
|
+
var _a, _b;
|
|
312
|
+
const name = value.getName();
|
|
313
|
+
const type = value.getType();
|
|
314
|
+
const arkMethod = stmt.getCfg().getDeclaringMethod();
|
|
315
|
+
let newType;
|
|
316
|
+
if (name === TSConst_1.THIS_NAME) {
|
|
317
|
+
newType = (_a = IRInference_1.IRInference.inferThisLocal(arkMethod)) === null || _a === void 0 ? void 0 : _a.getType();
|
|
318
|
+
if (newType) {
|
|
319
|
+
value.setType(newType);
|
|
320
|
+
}
|
|
321
|
+
return undefined;
|
|
322
|
+
}
|
|
323
|
+
else if (type instanceof Type_1.FunctionType) {
|
|
324
|
+
const methodSignature = type.getMethodSignature();
|
|
325
|
+
methodSignature.getMethodSubSignature().getParameters().forEach(p => TypeInference_1.TypeInference.inferParameterType(p, arkMethod));
|
|
326
|
+
TypeInference_1.TypeInference.inferSignatureReturnType(methodSignature, arkMethod);
|
|
327
|
+
return undefined;
|
|
328
|
+
}
|
|
329
|
+
else {
|
|
330
|
+
newType = (_b = TypeInference_1.TypeInference.inferUnclearedType(type, arkMethod.getDeclaringArkClass())) !== null && _b !== void 0 ? _b : this.getEnumValue(arkMethod.getDeclaringArkClass(), name);
|
|
331
|
+
}
|
|
332
|
+
if (newType) {
|
|
333
|
+
value.setType(newType);
|
|
334
|
+
return undefined;
|
|
335
|
+
}
|
|
336
|
+
return super.infer(value, stmt);
|
|
337
|
+
}
|
|
338
|
+
getEnumValue(arkClass, name) {
|
|
339
|
+
if (arkClass.getCategory() === ArkClass_1.ClassCategory.ENUM) {
|
|
340
|
+
const field = arkClass.getStaticFieldWithName(name);
|
|
341
|
+
if (field) {
|
|
342
|
+
return TypeInference_1.TypeInference.getEnumValueType(field);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
ArkTSLocalInference = __decorate([
|
|
349
|
+
(0, ValueInference_1.Bind)(ValueInference_1.InferLanguage.ARK_TS1_1)
|
|
350
|
+
], ArkTSLocalInference);
|
|
351
|
+
exports.ArkTSLocalInference = ArkTSLocalInference;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArkClassBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkClassBuilder.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAmE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAiB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"ArkClassBuilder.d.ts","sourceRoot":"","sources":["../../../../src/core/model/builder/ArkClassBuilder.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAmE,MAAM,iB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IAAI,CA0BvI"}
|
|
@@ -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
|
|
@@ -390,10 +390,7 @@ function buildMethodsForClass(clsNode, cls, sourceFile) {
|
|
|
390
390
|
ohos_typescript_1.default.isCallSignatureDeclaration(member)) {
|
|
391
391
|
let mthd = new ArkMethod_1.ArkMethod();
|
|
392
392
|
(0, ArkMethodBuilder_1.buildArkMethodFromArkClass)(member, cls, mthd, sourceFile);
|
|
393
|
-
if (ohos_typescript_1.default.
|
|
394
|
-
(0, ArkFieldBuilder_1.buildGetAccessor2ArkField)(member, mthd, sourceFile);
|
|
395
|
-
}
|
|
396
|
-
else if (ohos_typescript_1.default.isConstructorDeclaration(member)) {
|
|
393
|
+
if (ohos_typescript_1.default.isConstructorDeclaration(member)) {
|
|
397
394
|
buildParameterProperty2ArkField(member.parameters, cls, sourceFile);
|
|
398
395
|
}
|
|
399
396
|
}
|
|
@@ -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,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;
|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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,CAwDnE;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,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,CAsC3E;AAED,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,SAAS,GAAG,IAAI,CAqCrE"}
|
|
@@ -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
|
|
@@ -167,10 +167,10 @@ function buildMethodName(node, declaringClass, sourceFile, declaringMethod) {
|
|
|
167
167
|
name = Const_1.CALL_SIGNATURE_NAME;
|
|
168
168
|
}
|
|
169
169
|
else if (ohos_typescript_1.default.isGetAccessor(node) && ohos_typescript_1.default.isIdentifier(node.name)) {
|
|
170
|
-
name =
|
|
170
|
+
name = Const_1.GETTER_PREFIX + node.name.text;
|
|
171
171
|
}
|
|
172
172
|
else if (ohos_typescript_1.default.isSetAccessor(node) && ohos_typescript_1.default.isIdentifier(node.name)) {
|
|
173
|
-
name =
|
|
173
|
+
name = Const_1.SETTER_PREFIX + node.name.text;
|
|
174
174
|
}
|
|
175
175
|
else if (ohos_typescript_1.default.isArrowFunction(node)) {
|
|
176
176
|
name = buildAnonymousMethodName(node, declaringClass);
|
package/lib/index.d.ts
CHANGED
|
@@ -79,6 +79,9 @@ export * from './utils/pathTransfer';
|
|
|
79
79
|
export * from './utils/AstTreeUtils';
|
|
80
80
|
export { LOG_LEVEL, LOG_MODULE_TYPE } from './utils/logger';
|
|
81
81
|
export { default as Logger } from './utils/logger';
|
|
82
|
+
export { IntMap } from './utils/IntMap';
|
|
83
|
+
export { IntWorkList } from './utils/IntWorkList';
|
|
84
|
+
export { PackedSparseMap } from './utils/PackedSparseMap';
|
|
82
85
|
import ts from 'ohos-typescript';
|
|
83
86
|
export { ts };
|
|
84
87
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAC;AAG5E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAGzE,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAG9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,cAAc,iCAAiC,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM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e,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG1D,OAAO,EAAE,MAAM,iBAAiB,CAAC;AACjC,OAAO,EAAE,EAAE,EAAE,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -32,7 +32,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
exports.ArkNamespace = exports.ArkFile = exports.SCCDetection = exports.BaseExplicitGraph = exports.BaseNode = exports.BaseEdge = exports.DominanceTree = exports.DominanceFinder = exports.Cfg = exports.BasicBlock = exports.UndefinedVariableSolver = exports.UndefinedVariableChecker = exports.Fact = exports.PathEdge = exports.PathEdgePoint = exports.DataflowSolver = exports.DataflowResult = exports.DataflowProblem = exports.Scope = exports.VisibleValue = exports.ValueUtil = exports.TypeInference = exports.StmtUseReplacer = exports.RefUseReplacer = exports.IRUtils = exports.ExprUseReplacer = exports.DummyMainCreater = exports.ModelUtils = exports.FullPosition = exports.LineColPosition = exports.Local = exports.DefUseChain = exports.Decorator = exports.Constant = exports.DVFGBuilder = exports.DVFG = exports.DiffPTData = exports.PtsSet = exports.PointerAnalysisConfig = exports.PointerAnalysis = exports.PagBuilder = exports.CSFuncID = exports.DummyCallCreator = exports.CallGraphBuilder = exports.CGStat = exports.PAGStat = exports.PTAStat = exports.RapidTypeAnalysis = exports.ClassHierarchyAnalysis = exports.AbstractAnalysis = void 0;
|
|
35
|
-
exports.ts = exports.Logger = exports.LOG_MODULE_TYPE = exports.LOG_LEVEL = exports.ViewTreePrinter = exports.GraphPrinter = exports.JsonPrinter = exports.SourceFilePrinter = exports.SourceNamespacePrinter = exports.SourceClassPrinter = exports.SourceMethodPrinter = exports.DotFilePrinter = exports.DotNamespacePrinter = exports.DotClassPrinter = exports.DotMethodPrinter = exports.PrinterBuilder = exports.Printer = exports.Scene = exports.SceneConfig = exports.ArkBody = exports.ImportInfo = exports.ExportInfo = exports.ArkField = exports.ArkMethod = exports.ArkClass = void 0;
|
|
35
|
+
exports.ts = exports.PackedSparseMap = exports.IntWorkList = exports.IntMap = exports.Logger = exports.LOG_MODULE_TYPE = exports.LOG_LEVEL = exports.ViewTreePrinter = exports.GraphPrinter = exports.JsonPrinter = exports.SourceFilePrinter = exports.SourceNamespacePrinter = exports.SourceClassPrinter = exports.SourceMethodPrinter = exports.DotFilePrinter = exports.DotNamespacePrinter = exports.DotClassPrinter = exports.DotMethodPrinter = exports.PrinterBuilder = exports.Printer = exports.Scene = exports.SceneConfig = exports.ArkBody = exports.ImportInfo = exports.ExportInfo = exports.ArkField = exports.ArkMethod = exports.ArkClass = void 0;
|
|
36
36
|
// callgraph/algorithm
|
|
37
37
|
var AbstractAnalysis_1 = require("./callgraph/algorithm/AbstractAnalysis");
|
|
38
38
|
Object.defineProperty(exports, "AbstractAnalysis", { enumerable: true, get: function () { return AbstractAnalysis_1.AbstractAnalysis; } });
|
|
@@ -198,6 +198,12 @@ Object.defineProperty(exports, "LOG_LEVEL", { enumerable: true, get: function ()
|
|
|
198
198
|
Object.defineProperty(exports, "LOG_MODULE_TYPE", { enumerable: true, get: function () { return logger_1.LOG_MODULE_TYPE; } });
|
|
199
199
|
var logger_2 = require("./utils/logger");
|
|
200
200
|
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return __importDefault(logger_2).default; } });
|
|
201
|
+
var IntMap_1 = require("./utils/IntMap");
|
|
202
|
+
Object.defineProperty(exports, "IntMap", { enumerable: true, get: function () { return IntMap_1.IntMap; } });
|
|
203
|
+
var IntWorkList_1 = require("./utils/IntWorkList");
|
|
204
|
+
Object.defineProperty(exports, "IntWorkList", { enumerable: true, get: function () { return IntWorkList_1.IntWorkList; } });
|
|
205
|
+
var PackedSparseMap_1 = require("./utils/PackedSparseMap");
|
|
206
|
+
Object.defineProperty(exports, "PackedSparseMap", { enumerable: true, get: function () { return PackedSparseMap_1.PackedSparseMap; } });
|
|
201
207
|
//ohos-typescript
|
|
202
208
|
const ohos_typescript_1 = __importDefault(require("ohos-typescript"));
|
|
203
209
|
exports.ts = ohos_typescript_1.default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BasePrinter.d.ts","sourceRoot":"","sources":["../../../src/save/base/BasePrinter.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"BasePrinter.d.ts","sourceRoot":"","sources":["../../../src/save/base/BasePrinter.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,MAAM,WAAW,IAAI;IACjB,OAAO,IAAI,MAAM,CAAC;IAClB,IAAI,IAAI,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACzB;AAGD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAE/D;AAED,8BAAsB,WAAY,SAAQ,OAAQ,YAAW,IAAI;gBAC1C,MAAM,EAAE,MAAM;IAGjC,QAAQ,CAAC,OAAO,IAAI,MAAM;IAE1B,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,GAAG,IAAI;IAMtD,SAAS,CAAC,aAAa,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAOjE,SAAS,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAKtD,SAAS,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAajD,SAAS,CAAC,uBAAuB,CAAC,WAAW,EAAE,aAAa,GAAG,MAAM;WAUvD,iBAAiB,IAAI,cAAc;CAGpD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*
|
|
3
|
-
* Copyright (c)
|
|
3
|
+
* Copyright (c) 2024-2026 Huawei Device Co., Ltd.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
6
6
|
* You may obtain a copy of the License at
|
|
@@ -19,6 +19,7 @@ const ArkBaseModel_1 = require("../../core/model/ArkBaseModel");
|
|
|
19
19
|
const ArkClass_1 = require("../../core/model/ArkClass");
|
|
20
20
|
const Printer_1 = require("../Printer");
|
|
21
21
|
const PrinterUtils_1 = require("./PrinterUtils");
|
|
22
|
+
const Const_1 = require("../../core/common/Const");
|
|
22
23
|
let printerOptions = { pureTs: false, noMethodBody: false };
|
|
23
24
|
function setPrinterOptions(options) {
|
|
24
25
|
printerOptions = Object.assign(Object.assign({}, printerOptions), options);
|
|
@@ -47,11 +48,11 @@ class BasePrinter extends Printer_1.Printer {
|
|
|
47
48
|
if (name === '_Constructor') {
|
|
48
49
|
return 'constructor';
|
|
49
50
|
}
|
|
50
|
-
if (name.startsWith(
|
|
51
|
-
return name.replace(
|
|
51
|
+
if (name.startsWith(Const_1.GETTER_PREFIX)) {
|
|
52
|
+
return name.replace(Const_1.GETTER_PREFIX, 'get ');
|
|
52
53
|
}
|
|
53
|
-
if (name.startsWith(
|
|
54
|
-
return name.replace(
|
|
54
|
+
if (name.startsWith(Const_1.SETTER_PREFIX)) {
|
|
55
|
+
return name.replace(Const_1.SETTER_PREFIX, 'set ');
|
|
55
56
|
}
|
|
56
57
|
return name;
|
|
57
58
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A memory-efficient Map-like structure where keys are integers and values are lists of integers.
|
|
3
|
+
* Uses a static linked list approach based on TypedArrays (SoA) to avoid JS object overhead.
|
|
4
|
+
*
|
|
5
|
+
* Memory per entry: 8 bytes (value + next pointer).
|
|
6
|
+
* Memory per key: 4 bytes (head pointer).
|
|
7
|
+
*/
|
|
8
|
+
export declare class IntMap {
|
|
9
|
+
private heads;
|
|
10
|
+
private values;
|
|
11
|
+
private nexts;
|
|
12
|
+
private count;
|
|
13
|
+
private capacity;
|
|
14
|
+
private keyRange;
|
|
15
|
+
/**
|
|
16
|
+
* @param keyRange - The maximum value of keys (nodeCapacity).
|
|
17
|
+
* @param initialCapacity - The initial total number of values across all keys.
|
|
18
|
+
*/
|
|
19
|
+
constructor(keyRange: number, initialCapacity?: number);
|
|
20
|
+
/**
|
|
21
|
+
* Add a value to the list associated with the key.
|
|
22
|
+
*/
|
|
23
|
+
add(key: number, value: number): void;
|
|
24
|
+
/**
|
|
25
|
+
* Check if the list for a key contains a value.
|
|
26
|
+
*/
|
|
27
|
+
contains(key: number, value: number): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Add a value only if it doesn't already exist in the key's list.
|
|
30
|
+
*/
|
|
31
|
+
addUnique(key: number, value: number): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Get an iterator for the values associated with a key.
|
|
34
|
+
* Efficient for loops: for (const v of map.getValues(key)) { ... }
|
|
35
|
+
*/
|
|
36
|
+
getValues(key: number): IterableIterator<number>;
|
|
37
|
+
/**
|
|
38
|
+
* Get all values as an array (less efficient due to allocation).
|
|
39
|
+
*/
|
|
40
|
+
getAsArray(key: number): number[];
|
|
41
|
+
/**
|
|
42
|
+
* Check if a key has any values.
|
|
43
|
+
*/
|
|
44
|
+
has(key: number): boolean;
|
|
45
|
+
private resizeHeads;
|
|
46
|
+
private resizeCapacity;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=IntMap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntMap.d.ts","sourceRoot":"","sources":["../../src/utils/IntMap.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,qBAAa,MAAM;IACf,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,KAAK,CAAa;IAC1B,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAS;IAEzB;;;OAGG;gBACS,QAAQ,EAAE,MAAM,EAAE,eAAe,GAAE,MAAa;IAQ5D;;OAEG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAe5C;;OAEG;IACI,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAcpD;;OAEG;IACI,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAQrD;;;OAGG;IACK,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAWxD;;OAEG;IACI,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE;IAaxC;;OAEG;IACI,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAOhC,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,cAAc;CAUzB"}
|