@abaplint/transpiler 2.0.59 → 2.0.62

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.
@@ -35,6 +35,9 @@ class CompareTranspiler {
35
35
  if (concat.endsWith(" IS SUPPLIED")) {
36
36
  return new chunk_1.Chunk().appendString(pre + "INPUT && INPUT." + concat.replace(" IS SUPPLIED", "").toLowerCase());
37
37
  }
38
+ else if (concat.endsWith(" IS NOT SUPPLIED")) {
39
+ return new chunk_1.Chunk().appendString(pre + "INPUT && INPUT." + concat.replace(" IS NOT SUPPLIED", "").toLowerCase() + " === undefined");
40
+ }
38
41
  }
39
42
  else if (sources.length === 2 && node.findDirectTokenByText("IN")) {
40
43
  if (concat.search(" NOT IN ") >= 0) {
@@ -6,13 +6,14 @@ const chunk_1 = require("../chunk");
6
6
  const expressions_1 = require("../expressions");
7
7
  class RaiseTranspiler {
8
8
  transpile(node, traversal) {
9
- var _a;
9
+ var _a, _b;
10
10
  const classNameToken = (_a = node.findFirstExpression(abaplint.Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();
11
11
  const className = classNameToken === null || classNameToken === void 0 ? void 0 : classNameToken.getStr();
12
12
  if (className === undefined) {
13
13
  const s = node.findFirstExpression(abaplint.Expressions.SimpleSource2);
14
14
  if (s === undefined) {
15
- throw "Raise: Non-class based exceptions not supported";
15
+ const name = (_b = node.findFirstExpression(abaplint.Expressions.ExceptionName)) === null || _b === void 0 ? void 0 : _b.concatTokens().toLowerCase();
16
+ return new chunk_1.Chunk().append(`throw new Error({classic: "${name}"});`, node, traversal);
16
17
  }
17
18
  const sCode = new expressions_1.SourceTranspiler(true).transpile(s, traversal).getCode();
18
19
  return new chunk_1.Chunk().append(`throw ${sCode};`, node, traversal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.0.59",
3
+ "version": "2.0.62",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "author": "abaplint",
29
29
  "license": "MIT",
30
30
  "dependencies": {
31
- "@abaplint/core": "^2.91.7",
31
+ "@abaplint/core": "^2.91.8",
32
32
  "source-map": "^0.7.4"
33
33
  },
34
34
  "devDependencies": {