@abaplint/runtime 2.11.50 → 2.11.51

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.
@@ -2,17 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LINE_NOT_FOUND = void 0;
4
4
  exports.line_exists = line_exists;
5
+ const is_line_not_found_1 = require("../is_line_not_found");
5
6
  exports.LINE_NOT_FOUND = "CX_SY_ITAB_LINE_NOT_FOUND";
6
7
  function line_exists(callback) {
7
8
  try {
8
9
  callback();
9
10
  }
10
11
  catch (error) {
11
- if (abap.Classes[exports.LINE_NOT_FOUND] !== undefined
12
- && error instanceof abap.Classes[exports.LINE_NOT_FOUND]) {
13
- return abap.builtin.abap_false;
14
- }
15
- else if (error.toString() === `Error: Global class ${exports.LINE_NOT_FOUND} not found`) {
12
+ if ((0, is_line_not_found_1.isLineNotFound)(error)) {
16
13
  return abap.builtin.abap_false;
17
14
  }
18
15
  throw error;
@@ -1,18 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.line_index = line_index;
4
+ const is_line_not_found_1 = require("../is_line_not_found");
4
5
  const operators_1 = require("../operators");
5
- const line_exists_1 = require("./line_exists");
6
6
  function line_index(callback) {
7
7
  try {
8
8
  callback();
9
9
  }
10
10
  catch (error) {
11
- if (abap.Classes[line_exists_1.LINE_NOT_FOUND] !== undefined
12
- && error instanceof abap.Classes[line_exists_1.LINE_NOT_FOUND]) {
13
- return abap.IntegerFactory.get(0);
14
- }
15
- else if (error.toString() === `Error: Global class ${line_exists_1.LINE_NOT_FOUND} not found`) {
11
+ if ((0, is_line_not_found_1.isLineNotFound)(error)) {
16
12
  return abap.IntegerFactory.get(0);
17
13
  }
18
14
  throw error;
@@ -18,6 +18,7 @@ import { IntegerFactory } from "./integer_factory";
18
18
  import { dynamicCallLookup } from "./dynamic_call_lookup";
19
19
  import { CharacterFactory } from "./character_factory";
20
20
  import { ABAPEventing } from "./abap_eventing";
21
+ import { isLineNotFound } from "./is_line_not_found";
21
22
  export { RFC, types, DB, MemoryConsole };
22
23
  export type RuntimeDatabaseOptions = {
23
24
  schemaPrefix?: string;
@@ -69,6 +70,7 @@ export declare class ABAP {
69
70
  templateFormatting: typeof templateFormatting;
70
71
  expandIN: typeof expandIN;
71
72
  expandDynamic: typeof expandDynamic;
73
+ isLineNotFound: typeof isLineNotFound;
72
74
  buildDbTableName: typeof buildDbTableName;
73
75
  ClassicError: typeof ClassicError;
74
76
  dynamicCallLookup: typeof dynamicCallLookup;
@@ -25,6 +25,7 @@ const integer_factory_1 = require("./integer_factory");
25
25
  const dynamic_call_lookup_1 = require("./dynamic_call_lookup");
26
26
  const character_factory_1 = require("./character_factory");
27
27
  const abap_eventing_1 = require("./abap_eventing");
28
+ const is_line_not_found_1 = require("./is_line_not_found");
28
29
  class ABAP {
29
30
  // global objects
30
31
  Classes = {};
@@ -49,6 +50,7 @@ class ABAP {
49
50
  templateFormatting = template_formatting_1.templateFormatting;
50
51
  expandIN = expand_in_1.expandIN;
51
52
  expandDynamic = expand_dynamic_1.expandDynamic;
53
+ isLineNotFound = is_line_not_found_1.isLineNotFound;
52
54
  buildDbTableName = prefix_1.buildDbTableName;
53
55
  ClassicError = classic_error_1.ClassicError;
54
56
  dynamicCallLookup = dynamic_call_lookup_1.dynamicCallLookup;
@@ -0,0 +1 @@
1
+ export declare function isLineNotFound(error: Error): boolean;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isLineNotFound = isLineNotFound;
4
+ const builtin_1 = require("./builtin");
5
+ function isLineNotFound(error) {
6
+ if (abap.Classes[builtin_1.LINE_NOT_FOUND] !== undefined
7
+ && error instanceof abap.Classes[builtin_1.LINE_NOT_FOUND]) {
8
+ return true;
9
+ }
10
+ else if (error.toString() === `Error: Global class ${builtin_1.LINE_NOT_FOUND} not found`) {
11
+ return true;
12
+ }
13
+ return false;
14
+ }
15
+ //# sourceMappingURL=is_line_not_found.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/runtime",
3
- "version": "2.11.50",
3
+ "version": "2.11.51",
4
4
  "description": "Transpiler - Runtime",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",