@abaplint/transpiler 2.10.40 → 2.10.42

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.
@@ -81,12 +81,12 @@ class ReadTableTranspiler {
81
81
  prefix += "const " + id + " = " + s + ";\n";
82
82
  withKey.push("abap.compare.eq(" + field + ", " + id + ")");
83
83
  withKeyValue.push(`{key: (i) => {return ${field}}, value: ${id}}`);
84
- withKeySimple.push(`"${field.replace("i.", "")}": ${id}`);
84
+ withKeySimple.push(`"${field.replace("i.", "").replace(/\$/g, "/")}": ${id}`);
85
85
  }
86
86
  else {
87
87
  withKey.push("abap.compare.eq(" + field + ", " + s + ")");
88
88
  withKeyValue.push(`{key: (i) => {return ${field}}, value: ${s}}`);
89
- withKeySimple.push(`"${field.replace("i.", "")}": ${s}`);
89
+ withKeySimple.push(`"${field.replace("i.", "").replace(/\$/g, "/")}": ${s}`);
90
90
  }
91
91
  }
92
92
  extra.push("withKey: (i) => {return " + withKey.join(" && ") + ";}");
@@ -169,24 +169,35 @@ function getData() {
169
169
  skip: skipThis,
170
170
  });
171
171
  }
172
- ret += ` ret.push({objectName: "${st.obj.getName()}", localClass: "${st.localClass}", methods: ${JSON.stringify(methods)}, filename: "${st.filename}"});\n`;
172
+ ret += ` ret.push({objectName: "${st.obj.getName()}",
173
+ localClass: "${st.localClass}",
174
+ methods: ${JSON.stringify(methods)},
175
+ riskLevel: "${st.riskLevel}",
176
+ filename: "${st.filename}"});\n`;
173
177
  }
174
178
  ret += ` return ret;
175
179
  }
176
180
 
177
181
  async function run() {
182
+ const skipCritical = process.argv[2] === "--skip-critical";
183
+ const onlyCritical = process.argv[2] === "--only-critical";
178
184
  await initializeABAP();
179
185
  for (const st of getData()) {
180
186
  const imported = await import(st.filename);
181
187
  const localClass = imported[st.localClass];
182
188
  if (localClass.class_setup) await localClass.class_setup();
183
189
  for (const m of st.methods) {
190
+ const prefix = st.objectName + ": running " + st.localClass + "->" + m.name;
184
191
  if (m.skip) {
185
- console.log(st.objectName + ": running " + st.localClass + "->" + m.name + ", skipped");
192
+ console.log(prefix + ", skipped due to configuration");
193
+ } else if (skipCritical && st.riskLevel === "CRITICAL") {
194
+ console.log(prefix + ", skipped due to risk level " + st.riskLevel);
195
+ } else if (onlyCritical && st.riskLevel !== "CRITICAL") {
196
+ console.log(prefix + ", skipped due to risk level " + st.riskLevel);
186
197
  } else {
187
198
  const test = await (new localClass()).constructor_();
188
199
  ${callSpecial("setup")}
189
- console.log(st.objectName + ": running " + st.localClass + "->" + m.name);
200
+ console.log(prefix);
190
201
  await test.FRIENDS_ACCESS_INSTANCE[m.name]();
191
202
  ${callSpecial("teardown")}
192
203
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.10.40",
3
+ "version": "2.10.42",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",