@abaplint/transpiler-cli 2.7.127 → 2.7.129
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/build/bundle.js +55 -20
- package/package.json +4 -4
package/build/bundle.js
CHANGED
|
@@ -24459,6 +24459,7 @@ const source_1 = __webpack_require__(/*! ./source */ "./node_modules/@abaplint/c
|
|
|
24459
24459
|
const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
|
|
24460
24460
|
const method_parameters_1 = __webpack_require__(/*! ./method_parameters */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/method_parameters.js");
|
|
24461
24461
|
const basic_types_1 = __webpack_require__(/*! ../basic_types */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/basic_types.js");
|
|
24462
|
+
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
24462
24463
|
class NewObject {
|
|
24463
24464
|
runSyntax(node, scope, targetType, filename) {
|
|
24464
24465
|
let ret = undefined;
|
|
@@ -24540,7 +24541,10 @@ class NewObject {
|
|
|
24540
24541
|
if (type === undefined) {
|
|
24541
24542
|
throw new Error("NewObject, no default importing parameter found for constructor, " + name);
|
|
24542
24543
|
}
|
|
24543
|
-
new source_1.Source().runSyntax(source, scope, filename, type);
|
|
24544
|
+
const sourceType = new source_1.Source().runSyntax(source, scope, filename, type);
|
|
24545
|
+
if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, type) === false) {
|
|
24546
|
+
throw new Error(`NEW parameter type not compatible`);
|
|
24547
|
+
}
|
|
24544
24548
|
}
|
|
24545
24549
|
else if (parameters) {
|
|
24546
24550
|
// parameters with names
|
|
@@ -24630,7 +24634,12 @@ class ReduceBody {
|
|
|
24630
24634
|
scope.push(_scope_type_1.ScopeType.Let, "LET", node.getFirstToken().getStart(), filename);
|
|
24631
24635
|
scoped = true;
|
|
24632
24636
|
}
|
|
24633
|
-
|
|
24637
|
+
let foundType = targetType;
|
|
24638
|
+
const source = i.findDirectExpression(Expressions.Source);
|
|
24639
|
+
if (source) {
|
|
24640
|
+
foundType = new source_1.Source().runSyntax(source, scope, filename, targetType);
|
|
24641
|
+
}
|
|
24642
|
+
const found = new inline_field_definition_1.InlineFieldDefinition().runSyntax(i, scope, filename, foundType);
|
|
24634
24643
|
if (found && first === undefined) {
|
|
24635
24644
|
first = found;
|
|
24636
24645
|
}
|
|
@@ -24725,6 +24734,9 @@ class Select {
|
|
|
24725
24734
|
const token = node.getFirstToken();
|
|
24726
24735
|
const from = node.findDirectExpression(Expressions.SQLFrom);
|
|
24727
24736
|
const dbSources = from ? new sql_from_1.SQLFrom().runSyntax(from, scope, filename) : [];
|
|
24737
|
+
if (dbSources.length === 0) {
|
|
24738
|
+
throw new Error(`Missing FROM`);
|
|
24739
|
+
}
|
|
24728
24740
|
const fields = this.findFields(node);
|
|
24729
24741
|
if (fields.length === 0
|
|
24730
24742
|
&& node.findDirectExpression(Expressions.SQLFieldListLoop) === undefined) {
|
|
@@ -25516,7 +25528,7 @@ class StringTemplate {
|
|
|
25516
25528
|
}
|
|
25517
25529
|
else if ((typeUtils.isCharLike(type) === false && typeUtils.isHexLike(type) === false)
|
|
25518
25530
|
|| type instanceof basic_1.StructureType) {
|
|
25519
|
-
throw new Error("
|
|
25531
|
+
throw new Error("String template, not character like, " + type.constructor.name);
|
|
25520
25532
|
}
|
|
25521
25533
|
const format = templateSource.findDirectExpression(Expressions.StringTemplateFormatting);
|
|
25522
25534
|
const formatConcat = format === null || format === void 0 ? void 0 : format.concatTokens();
|
|
@@ -27590,6 +27602,7 @@ const _reference_1 = __webpack_require__(/*! ../_reference */ "./node_modules/@a
|
|
|
27590
27602
|
const basic_1 = __webpack_require__(/*! ../../types/basic */ "./node_modules/@abaplint/core/build/src/abap/types/basic/index.js");
|
|
27591
27603
|
const types_1 = __webpack_require__(/*! ../../types */ "./node_modules/@abaplint/core/build/src/abap/types/index.js");
|
|
27592
27604
|
const _object_oriented_1 = __webpack_require__(/*! ../_object_oriented */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js");
|
|
27605
|
+
const _type_utils_1 = __webpack_require__(/*! ../_type_utils */ "./node_modules/@abaplint/core/build/src/abap/5_syntax/_type_utils.js");
|
|
27593
27606
|
class CreateObject {
|
|
27594
27607
|
runSyntax(node, scope, filename) {
|
|
27595
27608
|
let cdef = undefined;
|
|
@@ -27613,7 +27626,7 @@ class CreateObject {
|
|
|
27613
27626
|
}
|
|
27614
27627
|
}
|
|
27615
27628
|
// just recurse
|
|
27616
|
-
for (const s of node.
|
|
27629
|
+
for (const s of node.findDirectExpressions(Expressions.Source)) {
|
|
27617
27630
|
new source_1.Source().runSyntax(s, scope, filename);
|
|
27618
27631
|
}
|
|
27619
27632
|
let first = true;
|
|
@@ -27657,26 +27670,35 @@ class CreateObject {
|
|
|
27657
27670
|
for (const t of node.findDirectExpressions(Expressions.Dynamic)) {
|
|
27658
27671
|
new dynamic_1.Dynamic().runSyntax(t, scope, filename);
|
|
27659
27672
|
}
|
|
27660
|
-
this.validateParameters(cdef, node, scope);
|
|
27673
|
+
this.validateParameters(cdef, node, scope, filename);
|
|
27661
27674
|
}
|
|
27662
|
-
validateParameters(cdef, node, scope) {
|
|
27663
|
-
var _a, _b, _c;
|
|
27675
|
+
validateParameters(cdef, node, scope, filename) {
|
|
27676
|
+
var _a, _b, _c, _d;
|
|
27664
27677
|
if (cdef === undefined) {
|
|
27678
|
+
const sources = (_a = node.findDirectExpression(Expressions.ParameterListS)) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source);
|
|
27679
|
+
for (const s of sources || []) {
|
|
27680
|
+
new source_1.Source().runSyntax(s, scope, filename);
|
|
27681
|
+
}
|
|
27665
27682
|
return;
|
|
27666
27683
|
}
|
|
27667
27684
|
const methodDef = new _object_oriented_1.ObjectOriented(scope).searchMethodName(cdef, "CONSTRUCTOR");
|
|
27668
|
-
const methodParameters = (
|
|
27685
|
+
const methodParameters = (_b = methodDef.method) === null || _b === void 0 ? void 0 : _b.getParameters();
|
|
27669
27686
|
const allImporting = (methodParameters === null || methodParameters === void 0 ? void 0 : methodParameters.getImporting()) || [];
|
|
27670
27687
|
const requiredImporting = new Set(methodParameters === null || methodParameters === void 0 ? void 0 : methodParameters.getRequiredParameters().map(i => i.getName().toUpperCase()));
|
|
27671
|
-
|
|
27672
|
-
|
|
27673
|
-
const name = (_c = p.findDirectExpression(Expressions.ParameterName)) === null || _c === void 0 ? void 0 : _c.concatTokens().toUpperCase();
|
|
27688
|
+
for (const p of ((_c = node.findDirectExpression(Expressions.ParameterListS)) === null || _c === void 0 ? void 0 : _c.findAllExpressions(Expressions.ParameterS)) || []) {
|
|
27689
|
+
const name = (_d = p.findDirectExpression(Expressions.ParameterName)) === null || _d === void 0 ? void 0 : _d.concatTokens().toUpperCase();
|
|
27674
27690
|
if (name === undefined) {
|
|
27675
27691
|
continue;
|
|
27676
27692
|
}
|
|
27677
|
-
|
|
27693
|
+
const source = p.findDirectExpression(Expressions.Source);
|
|
27694
|
+
const sourceType = new source_1.Source().runSyntax(source, scope, filename);
|
|
27695
|
+
const found = allImporting === null || allImporting === void 0 ? void 0 : allImporting.find(p => p.getName().toUpperCase() === name);
|
|
27696
|
+
if (found === undefined) {
|
|
27678
27697
|
throw new Error(`constructor parameter "${name}" does not exist`);
|
|
27679
27698
|
}
|
|
27699
|
+
else if (new _type_utils_1.TypeUtils(scope).isAssignableStrict(sourceType, found.getType()) === false) {
|
|
27700
|
+
throw new Error(`constructor parameter "${name}" type not compatible`);
|
|
27701
|
+
}
|
|
27680
27702
|
requiredImporting.delete(name);
|
|
27681
27703
|
}
|
|
27682
27704
|
for (const r of requiredImporting.values()) {
|
|
@@ -39081,10 +39103,17 @@ class AbstractFile {
|
|
|
39081
39103
|
return this.filename;
|
|
39082
39104
|
}
|
|
39083
39105
|
baseName() {
|
|
39084
|
-
|
|
39085
|
-
|
|
39086
|
-
|
|
39087
|
-
|
|
39106
|
+
let name = this.getFilename();
|
|
39107
|
+
let index = name.lastIndexOf("\\");
|
|
39108
|
+
if (index) {
|
|
39109
|
+
index = index + 1;
|
|
39110
|
+
}
|
|
39111
|
+
name = name.substring(index);
|
|
39112
|
+
index = name.lastIndexOf("/");
|
|
39113
|
+
if (index) {
|
|
39114
|
+
index = index + 1;
|
|
39115
|
+
}
|
|
39116
|
+
return name.substring(index);
|
|
39088
39117
|
}
|
|
39089
39118
|
getObjectType() {
|
|
39090
39119
|
var _a;
|
|
@@ -49091,7 +49120,7 @@ class Registry {
|
|
|
49091
49120
|
}
|
|
49092
49121
|
static abaplintVersion() {
|
|
49093
49122
|
// magic, see build script "version.sh"
|
|
49094
|
-
return "2.102.
|
|
49123
|
+
return "2.102.67";
|
|
49095
49124
|
}
|
|
49096
49125
|
getDDICReferences() {
|
|
49097
49126
|
return this.ddicReferences;
|
|
@@ -66350,6 +66379,7 @@ class SlowParameterPassing {
|
|
|
66350
66379
|
key: "slow_parameter_passing",
|
|
66351
66380
|
title: "Slow Parameter Passing",
|
|
66352
66381
|
shortDescription: `Detects slow pass by value passing for methods where parameter is not changed`,
|
|
66382
|
+
extendedInformation: `Method parameters defined in interfaces is not checked`,
|
|
66353
66383
|
tags: [_irule_1.RuleTag.Performance],
|
|
66354
66384
|
};
|
|
66355
66385
|
}
|
|
@@ -66372,17 +66402,22 @@ class SlowParameterPassing {
|
|
|
66372
66402
|
const methods = this.listMethodNodes(top);
|
|
66373
66403
|
for (const m of methods) {
|
|
66374
66404
|
const vars = m.getData().vars;
|
|
66405
|
+
if (m.getIdentifier().sname.includes("~")) {
|
|
66406
|
+
// skip methods defined in interfaces
|
|
66407
|
+
// todo: checking for just "~" is not correct, there might be ALIASES
|
|
66408
|
+
continue;
|
|
66409
|
+
}
|
|
66375
66410
|
for (const v in vars) {
|
|
66376
66411
|
const id = vars[v];
|
|
66377
66412
|
if (id.getMeta().includes("pass_by_value" /* IdentifierMeta.PassByValue */) === false) {
|
|
66378
66413
|
continue;
|
|
66379
66414
|
}
|
|
66415
|
+
else if (this.reg.isFileDependency(id.getFilename()) === true) {
|
|
66416
|
+
continue;
|
|
66417
|
+
}
|
|
66380
66418
|
const writes = this.listWritePositions(m, id);
|
|
66381
66419
|
if (writes.length === 0) {
|
|
66382
66420
|
const message = "Parameter " + id.getName() + " passed by VALUE but not changed";
|
|
66383
|
-
if (this.reg.isFileDependency(id.getFilename()) === true) {
|
|
66384
|
-
continue;
|
|
66385
|
-
}
|
|
66386
66421
|
issues.push(issue_1.Issue.atIdentifier(id, message, this.getMetadata().key, this.getConfig().severity));
|
|
66387
66422
|
}
|
|
66388
66423
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler-cli",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.129",
|
|
4
4
|
"description": "Transpiler - Command Line Interface",
|
|
5
5
|
"funding": "https://github.com/sponsors/larshp",
|
|
6
6
|
"bin": {
|
|
@@ -26,12 +26,12 @@
|
|
|
26
26
|
"author": "abaplint",
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@abaplint/transpiler": "^2.7.
|
|
29
|
+
"@abaplint/transpiler": "^2.7.129",
|
|
30
30
|
"@types/glob": "^7.2.0",
|
|
31
31
|
"glob": "=7.2.0",
|
|
32
32
|
"@types/progress": "^2.0.6",
|
|
33
|
-
"@types/node": "^20.8.
|
|
34
|
-
"@abaplint/core": "^2.102.
|
|
33
|
+
"@types/node": "^20.8.10",
|
|
34
|
+
"@abaplint/core": "^2.102.67",
|
|
35
35
|
"progress": "^2.0.3",
|
|
36
36
|
"webpack": "^5.89.0",
|
|
37
37
|
"webpack-cli": "^5.1.4",
|