@abaplint/runtime 2.12.33 → 2.12.35

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.
@@ -4,6 +4,7 @@ exports.updateDatabase = updateDatabase;
4
4
  const prefix_1 = require("../prefix");
5
5
  const types_1 = require("../types");
6
6
  const insert_database_1 = require("./insert_database");
7
+ const throw_error_1 = require("../throw_error");
7
8
  async function updateDatabase(table, options, context) {
8
9
  if (options.table instanceof types_1.FieldSymbol) {
9
10
  options.table = options.table.getPointer();
@@ -14,7 +15,11 @@ async function updateDatabase(table, options, context) {
14
15
  if (typeof table !== "string") {
15
16
  table = table.get();
16
17
  }
17
- const keys = abap.DDIC[table.toUpperCase()].keyFields;
18
+ const tabl = abap.DDIC[table.toUpperCase()];
19
+ if (tabl === undefined) {
20
+ await (0, throw_error_1.throwErrorWithParameters)("CX_SY_DYNAMIC_OSQL_SEMANTICS", { sqlmsg: new types_1.String().set(`Table ${table} not found`) });
21
+ }
22
+ const keys = tabl.keyFields;
18
23
  const where = [];
19
24
  const set = [];
20
25
  if (options.from) {
@@ -1 +1,2 @@
1
- export declare function throwError(name: string, parameters?: object): never;
1
+ export declare function throwErrorWithParameters(name: string, parameters?: object): Promise<never>;
2
+ export declare function throwError(name: string): never;
@@ -1,10 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.throwErrorWithParameters = throwErrorWithParameters;
3
4
  exports.throwError = throwError;
4
- // todo: add possibility to pass parameters to the exception constructor
5
- function throwError(name, parameters) {
5
+ async function throwErrorWithParameters(name, parameters) {
6
6
  if (abap.Classes[name] !== undefined) {
7
- throw new abap.Classes[name](parameters);
7
+ throw await new abap.Classes[name]().constructor_(parameters);
8
+ }
9
+ else {
10
+ throw new Error(`Global class ${name} not found`);
11
+ }
12
+ }
13
+ function throwError(name) {
14
+ if (abap.Classes[name] !== undefined) {
15
+ throw new abap.Classes[name]();
8
16
  }
9
17
  else {
10
18
  throw new Error(`Global class ${name} not found`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.12.33",
3
+ "version": "2.12.35",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",