Skip to content

Commit

Permalink
2.10.17: bugfix ASSIGN (#1467)
Browse files Browse the repository at this point in the history
  • Loading branch information
larshp authored Sep 8, 2024
1 parent 0290fc8 commit b18d1a9
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/regression/regression.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const childProcess = require("child_process");
const repos = [
{name: "abap-openapi/abap-openapi", command: "npm test"},
{name: "abapGit/abapGit", command: "npm run unit"},
{name: "dominikpanzer/cacamber-BDD-for-ABAP", command: "npm test"},
// {name: "dominikpanzer/cacamber-BDD-for-ABAP", command: "npm test"},
{name: "heliconialabs/abap-opentelemetry", command: "npm test"},
{name: "heliconialabs/abap-protobuf", command: "npm test"},
{name: "larshp/abap-advent-2020", command: "npm test"},
Expand Down
18 changes: 9 additions & 9 deletions packages/cli/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abaplint/transpiler-cli",
"version": "2.10.16",
"version": "2.10.17",
"description": "Transpiler - Command Line Interface",
"funding": "https://github.com/sponsors/larshp",
"bin": {
Expand All @@ -26,7 +26,7 @@
"author": "abaplint",
"license": "MIT",
"devDependencies": {
"@abaplint/transpiler": "^2.10.16",
"@abaplint/transpiler": "^2.10.17",
"@types/glob": "^8.1.0",
"glob": "=7.2.0",
"@types/progress": "^2.0.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/runtime/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/runtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abaplint/runtime",
"version": "2.10.16",
"version": "2.10.17",
"description": "Transpiler - Runtime",
"main": "build/src/index.js",
"typings": "build/src/index.d.ts",
Expand Down
8 changes: 7 additions & 1 deletion packages/runtime/src/statements/assign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ export function assign(input: IAssignInput) {
input.dynamicSource = input.dynamicSource.dereference();
} else {
// @ts-ignore
input.dynamicSource = input.dynamicSource.get()[s.toLowerCase().replace(/[~\\/]/g, "$") as any];
const source = input.dynamicSource.get();
if (source === undefined) {
// @ts-ignore
abap.builtin.sy.get().subrc.set(4);
return;
}
input.dynamicSource = source[s.toLowerCase().replace(/[~\\/]/g, "$") as any];
}
}
} else {
Expand Down
4 changes: 2 additions & 2 deletions packages/transpiler/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/transpiler/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@abaplint/transpiler",
"version": "2.10.16",
"version": "2.10.17",
"description": "Transpiler",
"main": "build/src/index.js",
"typings": "build/src/index.d.ts",
Expand Down
27 changes: 27 additions & 0 deletions test/statements/assign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -802,4 +802,31 @@ START-OF-SELECTION.
expect(abap.console.getTrimmed()).to.equal("5\n2");
});

it("assign arrow obj", async () => {
const code = `
CLASS lcl DEFINITION.
PUBLIC SECTION.
CLASS-METHODS bar IMPORTING i_source TYPE any.
ENDCLASS.
CLASS lcl IMPLEMENTATION.
METHOD bar.
FIELD-SYMBOLS <attribute> TYPE any.
DATA attribute_name TYPE string.
attribute_name = 'i_source->DFSDF'.
ASSIGN (attribute_name) TO <attribute>.
WRITE / sy-subrc.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
FIELD-SYMBOLS <fs> TYPE REF TO lcl.
DATA obj TYPE REF TO lcl.
ASSIGN obj TO <fs>.
lcl=>bar( <fs> ).`;
const js = await run(code);
const f = new AsyncFunction("abap", js);
await f(abap);
expect(abap.console.getTrimmed()).to.equal("4");
});

});

0 comments on commit b18d1a9

Please sign in to comment.