Skip to content

Hoisting causes invalid code #944

@Perryvw

Description

@Perryvw

The following code:

function foo() {
    function bar() {
        console.log(x)
    }
    let x: undefined;
}

Is transpiled to invalid lua syntax:

function foo(self)
    local x
    local function bar(self)
        print(x)
    end
    x = 
end

Playground link

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions