@abaplint/core 2.79.29 → 2.79.33
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/abaplint.d.ts +3 -1
- package/build/src/abap/2_statements/expressions/field_chain.js +2 -2
- package/build/src/abap/5_syntax/basic_types.js +1 -1
- package/build/src/abap/5_syntax/expressions/field_chain.js +5 -0
- package/build/src/abap/types/class_attributes.js +1 -1
- package/build/src/abap/types/method_parameters.js +3 -0
- package/build/src/registry.js +1 -1
- package/build/src/rules/allowed_object_naming.js +1 -1
- package/build/src/rules/call_transaction_authority_check.js +11 -1
- package/package.json +5 -5
package/build/abaplint.d.ts
CHANGED
|
@@ -641,7 +641,7 @@ declare class ClassConstant extends TypedIdentifier {
|
|
|
641
641
|
private readonly visibility;
|
|
642
642
|
constructor(id: TypedIdentifier, visibility: Visibility, value: string | {
|
|
643
643
|
[index: string]: string;
|
|
644
|
-
});
|
|
644
|
+
} | undefined);
|
|
645
645
|
getVisibility(): Visibility;
|
|
646
646
|
}
|
|
647
647
|
|
|
@@ -2615,6 +2615,7 @@ declare interface IMethodParameters {
|
|
|
2615
2615
|
getOptional(): readonly string[];
|
|
2616
2616
|
getReturning(): TypedIdentifier | undefined;
|
|
2617
2617
|
getExceptions(): readonly string[];
|
|
2618
|
+
getFilename(): string;
|
|
2618
2619
|
getDefaultImporting(): string | undefined;
|
|
2619
2620
|
getParameterDefault(parameter: string): ExpressionNode | undefined;
|
|
2620
2621
|
}
|
|
@@ -3483,6 +3484,7 @@ declare class MethodParameters_2 implements IMethodParameters {
|
|
|
3483
3484
|
private readonly defaults;
|
|
3484
3485
|
private readonly filename;
|
|
3485
3486
|
constructor(node: StatementNode, filename: string, scope: CurrentScope);
|
|
3487
|
+
getFilename(): string;
|
|
3486
3488
|
getOptional(): string[];
|
|
3487
3489
|
getAll(): TypedIdentifier[];
|
|
3488
3490
|
getDefaultImporting(): string | undefined;
|
|
@@ -6,9 +6,9 @@ const _1 = require(".");
|
|
|
6
6
|
const tokens_1 = require("../../1_lexer/tokens");
|
|
7
7
|
class FieldChain extends combi_1.Expression {
|
|
8
8
|
getRunnable() {
|
|
9
|
-
const attr = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.InstanceArrow),
|
|
9
|
+
const attr = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.InstanceArrow), _1.AttributeName);
|
|
10
10
|
const comp = (0, combi_1.seq)((0, combi_1.tok)(tokens_1.Dash), (0, combi_1.optPrio)(_1.ComponentName));
|
|
11
|
-
const chain = (0, combi_1.star)((0, combi_1.altPrio)(attr, comp, _1.TableExpression));
|
|
11
|
+
const chain = (0, combi_1.star)((0, combi_1.altPrio)(_1.Dereference, attr, comp, _1.TableExpression));
|
|
12
12
|
const clas = (0, combi_1.seq)(_1.ClassName, (0, combi_1.tok)(tokens_1.StaticArrow), _1.AttributeName);
|
|
13
13
|
const start = (0, combi_1.altPrio)(clas, _1.SourceField, _1.SourceFieldSymbol);
|
|
14
14
|
const after = (0, combi_1.altPrio)((0, combi_1.tok)(tokens_1.DashW), (0, combi_1.seq)((0, combi_1.optPrio)(_1.TableBody), (0, combi_1.optPrio)(_1.FieldOffset), (0, combi_1.optPrio)(_1.FieldLength)));
|
|
@@ -604,7 +604,7 @@ class BasicTypes {
|
|
|
604
604
|
throw new Error("VALUE missing in expression");
|
|
605
605
|
}
|
|
606
606
|
if (val.concatTokens().toUpperCase() === "VALUE IS INITIAL") {
|
|
607
|
-
return
|
|
607
|
+
return undefined;
|
|
608
608
|
}
|
|
609
609
|
const constant = val.findFirstExpression(Expressions.Constant);
|
|
610
610
|
if (constant) {
|
|
@@ -11,6 +11,8 @@ const _reference_1 = require("../_reference");
|
|
|
11
11
|
const field_offset_1 = require("./field_offset");
|
|
12
12
|
const field_length_1 = require("./field_length");
|
|
13
13
|
const table_expression_1 = require("./table_expression");
|
|
14
|
+
const expressions_1 = require("../../2_statements/expressions");
|
|
15
|
+
const dereference_1 = require("./dereference");
|
|
14
16
|
class FieldChain {
|
|
15
17
|
runSyntax(node, scope, filename, refType) {
|
|
16
18
|
const concat = node.concatTokens();
|
|
@@ -64,6 +66,9 @@ class FieldChain {
|
|
|
64
66
|
throw new Error("Not a object reference, field chain");
|
|
65
67
|
}
|
|
66
68
|
}
|
|
69
|
+
else if (current.get() instanceof expressions_1.Dereference) {
|
|
70
|
+
context = new dereference_1.Dereference().runSyntax(context);
|
|
71
|
+
}
|
|
67
72
|
else if (current.get() instanceof Expressions.ComponentName) {
|
|
68
73
|
context = new component_name_1.ComponentName().runSyntax(context, current);
|
|
69
74
|
}
|
|
@@ -174,7 +174,7 @@ class Attributes {
|
|
|
174
174
|
else if (ctyp instanceof Statements.Constant) {
|
|
175
175
|
const found = new constant_1.Constant().runSyntax(c, scope, this.filename);
|
|
176
176
|
if (found) {
|
|
177
|
-
const attr = new class_constant_1.ClassConstant(found, visibility, found.getValue()
|
|
177
|
+
const attr = new class_constant_1.ClassConstant(found, visibility, found.getValue());
|
|
178
178
|
this.constants.push(attr);
|
|
179
179
|
scope.addIdentifier(attr);
|
|
180
180
|
}
|
package/build/src/registry.js
CHANGED
|
@@ -42,7 +42,7 @@ class AllowedObjectNaming {
|
|
|
42
42
|
message = "Name not allowed";
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
else if (obj.getName().match(/^(\/[A-Z_\d]{3,8}\/)?[A-Z_
|
|
45
|
+
else if (obj.getName().match(/^(\/[A-Z_\d]{3,8}\/)?[A-Z_-\d<> ]+$/i) === null) {
|
|
46
46
|
message = "Name not allowed";
|
|
47
47
|
}
|
|
48
48
|
if (message.length > 0) {
|
|
@@ -6,6 +6,7 @@ const _abap_rule_1 = require("./_abap_rule");
|
|
|
6
6
|
const _irule_1 = require("./_irule");
|
|
7
7
|
const Statements = require("../abap/2_statements/statements");
|
|
8
8
|
const issue_1 = require("../issue");
|
|
9
|
+
const version_1 = require("../version");
|
|
9
10
|
class CallTransactionAuthorityCheckConf extends _basic_rule_config_1.BasicRuleConfig {
|
|
10
11
|
}
|
|
11
12
|
exports.CallTransactionAuthorityCheckConf = CallTransactionAuthorityCheckConf;
|
|
@@ -13,6 +14,7 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
13
14
|
constructor() {
|
|
14
15
|
super(...arguments);
|
|
15
16
|
this.conf = new CallTransactionAuthorityCheckConf();
|
|
17
|
+
this.MINIMUM_VERSION = version_1.Version.v740sp02;
|
|
16
18
|
}
|
|
17
19
|
getMetadata() {
|
|
18
20
|
return {
|
|
@@ -22,7 +24,10 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
22
24
|
extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,
|
|
23
25
|
tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],
|
|
24
26
|
badExample: `CALL TRANSACTION 'FOO'.`,
|
|
25
|
-
goodExample: `
|
|
27
|
+
goodExample: `TRY.
|
|
28
|
+
CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.
|
|
29
|
+
CATCH cx_sy_authorization_error.
|
|
30
|
+
ENDTRY.`,
|
|
26
31
|
};
|
|
27
32
|
}
|
|
28
33
|
getMessage() {
|
|
@@ -35,6 +40,11 @@ class CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {
|
|
|
35
40
|
this.conf = conf;
|
|
36
41
|
}
|
|
37
42
|
runParsed(file, obj) {
|
|
43
|
+
const currentVersion = this.reg.getConfig().getVersion();
|
|
44
|
+
// Cloud version does not support CALL TRANSACTION
|
|
45
|
+
if (currentVersion < this.MINIMUM_VERSION || currentVersion === version_1.Version.Cloud) {
|
|
46
|
+
return [];
|
|
47
|
+
}
|
|
38
48
|
const issues = [];
|
|
39
49
|
if (obj.getType() === "INTF") {
|
|
40
50
|
return [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.79.
|
|
3
|
+
"version": "2.79.33",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -57,18 +57,18 @@
|
|
|
57
57
|
"@microsoft/api-extractor": "^7.18.16",
|
|
58
58
|
"@types/chai": "^4.2.22",
|
|
59
59
|
"@types/mocha": "^9.0.0",
|
|
60
|
-
"@types/node": "^16.
|
|
60
|
+
"@types/node": "^16.11.6",
|
|
61
61
|
"chai": "^4.3.4",
|
|
62
|
-
"eslint": "^8.0
|
|
62
|
+
"eslint": "^8.1.0",
|
|
63
63
|
"madge": "^5.0.1",
|
|
64
|
-
"mocha": "^9.1.
|
|
64
|
+
"mocha": "^9.1.3",
|
|
65
65
|
"c8": "^7.10.0",
|
|
66
66
|
"source-map-support": "^0.5.20",
|
|
67
67
|
"ts-json-schema-generator": "^0.96.0",
|
|
68
68
|
"typescript": "^4.4.4"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"fast-xml-parser": "^3.
|
|
71
|
+
"fast-xml-parser": "^3.21.0",
|
|
72
72
|
"json5": "^2.2.0",
|
|
73
73
|
"vscode-languageserver-protocol": "^3.16.0",
|
|
74
74
|
"vscode-languageserver-types": "^3.16.0"
|