Skip to content

Array unpacking handling #1651

@LibertasIoT

Description

@LibertasIoT

I have a suggestion.

When transpiling code like the following:
const [x, y] = an_array

The current result is:
local x, y = table.unpack(an_array)

I would suggest adding range to the unpack function, such as
local x, y = table.unpack(an_array, 1, 2)

It will greatly improve compatibility with TypeScript and should be more efficient to run.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions