@abaplint/runtime 2.11.50 → 2.11.52
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.
- package/build/src/builtin/line_exists.js +2 -5
- package/build/src/builtin/line_index.js +2 -6
- package/build/src/index.d.ts +2 -0
- package/build/src/index.js +2 -0
- package/build/src/is_line_not_found.d.ts +1 -0
- package/build/src/is_line_not_found.js +15 -0
- package/build/src/statements/assign.d.ts +1 -1
- package/build/src/statements/assign.js +5 -0
- package/build/src/statements/get_reference.d.ts +4 -0
- package/build/src/statements/get_reference.js +22 -0
- package/build/src/statements/index.d.ts +2 -0
- package/build/src/statements/index.js +2 -0
- package/package.json +1 -1
|
@@ -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 (
|
|
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 (
|
|
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;
|
package/build/src/index.d.ts
CHANGED
|
@@ -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;
|
package/build/src/index.js
CHANGED
|
@@ -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
|
|
@@ -2,7 +2,7 @@ import { DataReference, FieldSymbol, Structure, Table } from "../types";
|
|
|
2
2
|
import { ICharacter } from "../types/_character";
|
|
3
3
|
import { INumeric } from "../types/_numeric";
|
|
4
4
|
export interface IAssignInput {
|
|
5
|
-
source?: INumeric | ICharacter | Table | Structure | DataReference;
|
|
5
|
+
source?: INumeric | ICharacter | Table | Structure | DataReference | FieldSymbol;
|
|
6
6
|
target: FieldSymbol;
|
|
7
7
|
dynamicName?: string;
|
|
8
8
|
dynamicSource?: ICharacter;
|
|
@@ -4,6 +4,11 @@ exports.assign = assign;
|
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
function assign(input) {
|
|
6
6
|
// console.dir(input);
|
|
7
|
+
/*
|
|
8
|
+
if (input.source instanceof FieldSymbol) {
|
|
9
|
+
return assign({...input, source: input.source.getPointer()});
|
|
10
|
+
}
|
|
11
|
+
*/
|
|
7
12
|
if (input.dynamicName) {
|
|
8
13
|
if (input.dynamicSource instanceof types_1.FieldSymbol) {
|
|
9
14
|
input.dynamicSource = input.dynamicSource.getPointer();
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { DataReference, FieldSymbol, Structure, Table } from "../types";
|
|
2
|
+
import { ICharacter } from "../types/_character";
|
|
3
|
+
import { INumeric } from "../types/_numeric";
|
|
4
|
+
export declare function getReference(source: INumeric | ICharacter | Table | Structure | DataReference | FieldSymbol, target: FieldSymbol | DataReference): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getReference = getReference;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
function getReference(source, target) {
|
|
6
|
+
// console.dir(input);
|
|
7
|
+
if (source instanceof types_1.FieldSymbol) {
|
|
8
|
+
source = source.getPointer();
|
|
9
|
+
if (source === undefined) {
|
|
10
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
if (target instanceof types_1.FieldSymbol) {
|
|
14
|
+
target = target.getPointer();
|
|
15
|
+
if (target === undefined) {
|
|
16
|
+
throw new Error("GETWA_NOT_ASSIGNED");
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
target = target;
|
|
20
|
+
target.assign(source);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=get_reference.js.map
|
|
@@ -14,6 +14,7 @@ import { overlay } from "./overlay";
|
|
|
14
14
|
import { cast } from "./cast";
|
|
15
15
|
import { getBit } from "./get_bit";
|
|
16
16
|
import { readReport } from "./read_report";
|
|
17
|
+
import { getReference } from "./get_reference";
|
|
17
18
|
import { raiseEvent } from "./raise_event";
|
|
18
19
|
import { receive } from "./receive";
|
|
19
20
|
import { getLocale } from "./get_locale";
|
|
@@ -84,6 +85,7 @@ export declare class Statements {
|
|
|
84
85
|
setBit: typeof setBit;
|
|
85
86
|
setHandler: typeof setHandler;
|
|
86
87
|
setLocale: typeof setLocale;
|
|
88
|
+
getReference: typeof getReference;
|
|
87
89
|
shift: typeof shift;
|
|
88
90
|
sort: typeof sort;
|
|
89
91
|
split: typeof split;
|
|
@@ -17,6 +17,7 @@ const overlay_1 = require("./overlay");
|
|
|
17
17
|
const cast_1 = require("./cast");
|
|
18
18
|
const get_bit_1 = require("./get_bit");
|
|
19
19
|
const read_report_1 = require("./read_report");
|
|
20
|
+
const get_reference_1 = require("./get_reference");
|
|
20
21
|
const raise_event_1 = require("./raise_event");
|
|
21
22
|
const receive_1 = require("./receive");
|
|
22
23
|
const get_locale_1 = require("./get_locale");
|
|
@@ -87,6 +88,7 @@ class Statements {
|
|
|
87
88
|
setBit = set_bit_1.setBit;
|
|
88
89
|
setHandler = set_handler_1.setHandler;
|
|
89
90
|
setLocale = set_locale_1.setLocale;
|
|
91
|
+
getReference = get_reference_1.getReference;
|
|
90
92
|
shift = shift_1.shift;
|
|
91
93
|
sort = sort_1.sort;
|
|
92
94
|
split = split_1.split;
|