@abaplint/core 2.97.5 → 2.97.7
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.
|
@@ -14,9 +14,10 @@ const tokens_1 = require("../../1_lexer/tokens");
|
|
|
14
14
|
const attribute_name_1 = require("./attribute_name");
|
|
15
15
|
const component_name_1 = require("./component_name");
|
|
16
16
|
const types_1 = require("../../types");
|
|
17
|
+
const version_1 = require("../../../version");
|
|
17
18
|
class MethodSource {
|
|
18
19
|
runSyntax(node, scope, filename) {
|
|
19
|
-
var _a;
|
|
20
|
+
var _a, _b, _c;
|
|
20
21
|
const helper = new _object_oriented_1.ObjectOriented(scope);
|
|
21
22
|
const children = node.getChildren().slice();
|
|
22
23
|
const first = children.shift();
|
|
@@ -28,6 +29,15 @@ class MethodSource {
|
|
|
28
29
|
context = (_a = scope.findVariable("me")) === null || _a === void 0 ? void 0 : _a.getType();
|
|
29
30
|
children.unshift(first);
|
|
30
31
|
}
|
|
32
|
+
if (scope.getVersion() === version_1.Version.Cloud
|
|
33
|
+
&& first.get() instanceof Expressions.Dynamic
|
|
34
|
+
&& first instanceof nodes_1.ExpressionNode
|
|
35
|
+
&& ((_b = children[0]) === null || _b === void 0 ? void 0 : _b.concatTokens()) === "=>") {
|
|
36
|
+
const name = (_c = first.findDirectExpression(Expressions.Constant)) === null || _c === void 0 ? void 0 : _c.concatTokens().replace(/'/g, "");
|
|
37
|
+
if (name !== undefined && scope.findClassDefinition(name) === undefined) {
|
|
38
|
+
throw new Error(`Class "${name}" not found/released`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
31
41
|
if (context instanceof basic_1.VoidType) {
|
|
32
42
|
// todo, if there are more dynamic with variables, the references for the variables are not added?
|
|
33
43
|
return context;
|
|
@@ -58,7 +68,7 @@ class MethodSource {
|
|
|
58
68
|
continue;
|
|
59
69
|
}
|
|
60
70
|
}
|
|
61
|
-
catch (
|
|
71
|
+
catch (_d) {
|
|
62
72
|
// ignore
|
|
63
73
|
}
|
|
64
74
|
// try looking for method name
|
|
@@ -56,7 +56,10 @@ class CreateObject {
|
|
|
56
56
|
}
|
|
57
57
|
else if (found instanceof basic_1.ObjectReferenceType) {
|
|
58
58
|
const id = found.getIdentifier();
|
|
59
|
-
if (id instanceof types_1.
|
|
59
|
+
if (id instanceof types_1.InterfaceDefinition && type === undefined) {
|
|
60
|
+
throw new Error("Interface reference, cannot be instantiated");
|
|
61
|
+
}
|
|
62
|
+
else if (id instanceof types_1.ClassDefinition && cdef === undefined) {
|
|
60
63
|
cdef = id;
|
|
61
64
|
}
|
|
62
65
|
if (type === undefined && id instanceof types_1.ClassDefinition && id.isAbstract() === true) {
|
package/build/src/registry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abaplint/core",
|
|
3
|
-
"version": "2.97.
|
|
3
|
+
"version": "2.97.7",
|
|
4
4
|
"description": "abaplint - Core API",
|
|
5
5
|
"main": "build/src/index.js",
|
|
6
6
|
"typings": "build/abaplint.d.ts",
|
|
@@ -52,15 +52,15 @@
|
|
|
52
52
|
"@types/mocha": "^10.0.1",
|
|
53
53
|
"@types/node": "^18.15.11",
|
|
54
54
|
"chai": "^4.3.7",
|
|
55
|
-
"eslint": "^8.
|
|
55
|
+
"eslint": "^8.38.0",
|
|
56
56
|
"mocha": "^10.2.0",
|
|
57
57
|
"c8": "^7.13.0",
|
|
58
58
|
"source-map-support": "^0.5.21",
|
|
59
59
|
"ts-json-schema-generator": "^1.2.0",
|
|
60
|
-
"typescript": "^5.0.
|
|
60
|
+
"typescript": "^5.0.4"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"fast-xml-parser": "^4.1.
|
|
63
|
+
"fast-xml-parser": "^4.1.4",
|
|
64
64
|
"json5": "^2.2.3",
|
|
65
65
|
"vscode-languageserver-types": "^3.17.3"
|
|
66
66
|
}
|