@abaplint/transpiler 2.10.51 → 2.10.52
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/src/initialization.js +15 -18
- package/package.json +1 -1
|
@@ -13,16 +13,16 @@ class Initialization {
|
|
|
13
13
|
let ret = "";
|
|
14
14
|
if (useImport === true) {
|
|
15
15
|
ret = `/* eslint-disable import/newline-after-import */
|
|
16
|
-
|
|
16
|
+
import "./_top.mjs";\n`;
|
|
17
17
|
}
|
|
18
18
|
else {
|
|
19
19
|
ret = `/* eslint-disable import/newline-after-import */
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
import runtime from "@abaplint/runtime";
|
|
21
|
+
globalThis.abap = new runtime.ABAP();\n`;
|
|
22
22
|
}
|
|
23
23
|
ret += `${this.buildImports(reg, useImport)}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
export async function initializeABAP() {\n`;
|
|
26
26
|
ret += ` const sqlite = [];\n`;
|
|
27
27
|
for (const i of dbSetup.schemas.sqlite) {
|
|
28
28
|
ret += ` sqlite.push(\`${i}\`);\n`;
|
|
@@ -80,21 +80,18 @@ class Initialization {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
for (const obj of reg.getObjects()) {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
const name = imp(`${escapeNamespaceFilename(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`);
|
|
84
|
+
if (obj instanceof abaplint.Objects.Class
|
|
85
|
+
&& obj.getName().toUpperCase() !== "CL_ABAP_CHAR_UTILITIES"
|
|
86
|
+
&& this.hasClassConstructor(reg, obj)) {
|
|
87
|
+
// this will not solve all problems with class constructors 100%, but probably good enough
|
|
88
|
+
late.push(name);
|
|
85
89
|
}
|
|
86
|
-
else if (obj instanceof abaplint.Objects.
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
list.push(imp(`${escapeNamespaceFilename(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
else if (obj instanceof abaplint.Objects.Interface) {
|
|
97
|
-
list.push(imp(`${escapeNamespaceFilename(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
|
|
90
|
+
else if (obj instanceof abaplint.Objects.Interface
|
|
91
|
+
|| obj instanceof abaplint.Objects.FunctionGroup
|
|
92
|
+
|| obj instanceof abaplint.Objects.Program
|
|
93
|
+
|| obj instanceof abaplint.Objects.Class) {
|
|
94
|
+
list.push(name);
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
97
|
return [...list.sort(), ...late].join("\n");
|