Skip to content

Issue with Array Initialization in CodeΒ #167

@K1NZ54

Description

@K1NZ54

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions