@abaplint/transpiler 2.10.51 → 2.10.53

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.
@@ -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
- import "./_top.mjs";\n`;
16
+ import "./_top.mjs";\n`;
17
17
  }
18
18
  else {
19
19
  ret = `/* eslint-disable import/newline-after-import */
20
- import runtime from "@abaplint/runtime";
21
- globalThis.abap = new runtime.ABAP();\n`;
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
- export async function initializeABAP() {\n`;
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,21 @@ class Initialization {
80
80
  }
81
81
  }
82
82
  for (const obj of reg.getObjects()) {
83
- if (obj instanceof abaplint.Objects.FunctionGroup) {
84
- list.push(imp(`${escapeNamespaceFilename(obj.getName().toLowerCase())}.fugr`));
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.Class) {
87
- if (obj.getName().toUpperCase() !== "CL_ABAP_CHAR_UTILITIES"
88
- && this.hasClassConstructor(reg, obj)) {
89
- // this will not solve all problems with class constors 100%, but probably good enough
90
- late.push(imp(`${escapeNamespaceFilename(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
91
- }
92
- else {
93
- list.push(imp(`${escapeNamespaceFilename(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
94
- }
90
+ else if (obj instanceof abaplint.Objects.Program && obj.isInclude() === true) {
91
+ continue;
95
92
  }
96
- else if (obj instanceof abaplint.Objects.Interface) {
97
- list.push(imp(`${escapeNamespaceFilename(obj.getName().toLowerCase())}.${obj.getType().toLowerCase()}`));
93
+ else if (obj instanceof abaplint.Objects.Interface
94
+ || obj instanceof abaplint.Objects.FunctionGroup
95
+ || obj instanceof abaplint.Objects.Program
96
+ || obj instanceof abaplint.Objects.Class) {
97
+ list.push(name);
98
98
  }
99
99
  }
100
100
  return [...list.sort(), ...late].join("\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.10.51",
3
+ "version": "2.10.53",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",