prevwong/reka.js

Issue with Array Initialization in Code

Opened this issue · 1 comments

I am experiencing an issue when initializing an array as shown in the attached images. The initialization works correctly when done via the interface, but results in an error when stringified in the code. Specifically, I encounter the error:

Unexpected token (1:10)

This issue also occurs when initializing the array as a JSON object. However, the initialization works fine if the array contains only a single value.

Steps to Reproduce:

  1. Initialize an array in the code as shown in the provided screenshot:

component App(test: any = ["1", "2"]) {
    val text: any = "Bye";
    val counter: any = 0;
}
  1. Alternatively, initialize the array as a JSON object:
component App(test: any = { "test": ["1", "2"] }) {
    val text: any = "Bye";
    val counter: any = 0;
}

  1. Attempt to stringify the code.
    Expected Behavior:

The array should be initialized without any errors, similar to the behavior observed when the initialization is done via the interface.

Actual Behavior:

The code throws an Unexpected token (1:10) error when attempting to stringify the array initialization.

Thank you.

I noticed the same bug. No feedback ?