Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Array Initialization in Code #167

Open
K1NZ54 opened this issue Jul 1, 2024 · 1 comment
Open

Issue with Array Initialization in Code #167

K1NZ54 opened this issue Jul 1, 2024 · 1 comment

Comments

@K1NZ54
Copy link

K1NZ54 commented Jul 1, 2024

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.

@kyky709
Copy link

kyky709 commented Jul 24, 2024

I noticed the same bug. No feedback ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants