@abaplint/transpiler 2.3.63 → 2.3.65
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.
|
@@ -12,11 +12,14 @@ class CompareTranspiler {
|
|
|
12
12
|
const sources = node.findDirectExpressions(core_1.Expressions.Source).concat(node.findDirectExpressions(core_1.Expressions.SourceFieldSymbol));
|
|
13
13
|
if (sources.length === 1) {
|
|
14
14
|
const s0 = traversal.traverse(sources[0]);
|
|
15
|
-
if (
|
|
16
|
-
|
|
15
|
+
if (concat.startsWith("NOT ") && concat.endsWith(" IS NOT INITIAL")) {
|
|
16
|
+
return new chunk_1.Chunk().appendString("abap.compare.initial(").appendChunk(s0).appendString(") === true");
|
|
17
|
+
}
|
|
18
|
+
else if ((concat.startsWith("NOT ") && concat.endsWith(" IS INITIAL"))
|
|
19
|
+
|| concat.endsWith(" IS NOT INITIAL")) {
|
|
17
20
|
return new chunk_1.Chunk().appendString("abap.compare.initial(").appendChunk(s0).appendString(") === false");
|
|
18
21
|
}
|
|
19
|
-
else if (concat.endsWith("IS INITIAL")) {
|
|
22
|
+
else if (concat.endsWith(" IS INITIAL")) {
|
|
20
23
|
return new chunk_1.Chunk().appendString("abap.compare.initial(").appendChunk(s0).appendString(")");
|
|
21
24
|
}
|
|
22
25
|
if ((concat.startsWith("NOT ") && concat.endsWith(" IS BOUND"))
|
|
@@ -94,6 +94,12 @@ class MethodImplementationTranspiler {
|
|
|
94
94
|
const method = this.findMethod(methodName, classDef, traversal);
|
|
95
95
|
let staticMethod = "";
|
|
96
96
|
methodName = methodName.replace("~", "$").toLowerCase();
|
|
97
|
+
const superDef = traversal.findClassDefinition(classDef === null || classDef === void 0 ? void 0 : classDef.getSuperClass(), scope);
|
|
98
|
+
for (const a of (superDef === null || superDef === void 0 ? void 0 : superDef.getAliases().getAll()) || []) {
|
|
99
|
+
if (a.getName().toLowerCase() === methodName) {
|
|
100
|
+
methodName = a.getComponent().replace("~", "$").toLowerCase();
|
|
101
|
+
}
|
|
102
|
+
}
|
|
97
103
|
if (method && method.isStatic()) {
|
|
98
104
|
// in ABAP static methods can be called with instance arrows, "->"
|
|
99
105
|
const className = (_b = (_a = scope.getParent()) === null || _a === void 0 ? void 0 : _a.getIdentifier().sname) === null || _b === void 0 ? void 0 : _b.toLowerCase();
|
package/build/src/traversal.d.ts
CHANGED
|
@@ -34,7 +34,7 @@ export declare class Traversal {
|
|
|
34
34
|
buildConstructorContents(scope: abaplint.ISpaghettiScopeNode | undefined, def: abaplint.IClassDefinition): string;
|
|
35
35
|
findInterfaceDefinition(name: string, scope: abaplint.ISpaghettiScopeNode | undefined): abaplint.IInterfaceDefinition | undefined;
|
|
36
36
|
findTable(name: string): abaplint.Objects.Table | undefined;
|
|
37
|
-
findClassDefinition(name: string, scope: abaplint.ISpaghettiScopeNode | undefined): abaplint.IClassDefinition | undefined;
|
|
37
|
+
findClassDefinition(name: string | undefined, scope: abaplint.ISpaghettiScopeNode | undefined): abaplint.IClassDefinition | undefined;
|
|
38
38
|
private dataFromInterfaces;
|
|
39
39
|
determineType(node: abaplint.Nodes.ExpressionNode | abaplint.Nodes.StatementNode, scope: abaplint.ISpaghettiScopeNode | undefined): abaplint.AbstractType | undefined;
|
|
40
40
|
isInsideLoop(node: abaplint.Nodes.StatementNode): boolean;
|
package/build/src/traversal.js
CHANGED
|
@@ -295,7 +295,10 @@ class Traversal {
|
|
|
295
295
|
return tabl;
|
|
296
296
|
}
|
|
297
297
|
findClassDefinition(name, scope) {
|
|
298
|
-
|
|
298
|
+
if (name === undefined || scope === undefined) {
|
|
299
|
+
return undefined;
|
|
300
|
+
}
|
|
301
|
+
let clas = scope.findClassDefinition(name);
|
|
299
302
|
if (clas === undefined) {
|
|
300
303
|
const iglobal = this.reg.getObject("CLAS", name);
|
|
301
304
|
clas = iglobal === null || iglobal === void 0 ? void 0 : iglobal.getDefinition();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/transpiler",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.65",
|
|
4
4
|
"description": "Transpiler",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/src/index.d.ts",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
"author": "abaplint",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@abaplint/core": "^2.
|
|
31
|
+
"@abaplint/core": "^2.94.0",
|
|
32
32
|
"source-map": "^0.7.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/chai": "^4.3.4",
|
|
36
|
-
"@types/mocha": "^10.0.
|
|
36
|
+
"@types/mocha": "^10.0.1",
|
|
37
37
|
"chai": "^4.3.7",
|
|
38
38
|
"mocha": "^10.1.0",
|
|
39
39
|
"source-map-support": "^0.5.21",
|