@abaplint/transpiler 2.0.60 → 2.0.61
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.
|
@@ -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
|
-
|
|
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);
|