Skip to content

Drop var declarations #703

@ark120202

Description

@ark120202
  • We don't handle it correctly now
  • It's pretty much deprecated in modern JS and especially TS
  • var scoping may confuse Lua developers that are new to JS/TS
  • Apparently, we'll be able to remove a lot of code:
    • Special var handling in hoistVariableDeclarations
    • ...which is the only place that uses replaceStatementInParent
    • ...which is the only place (except printer) that uses tstl.Node.parent
    • ...which is the main reason why nodes are mutated and the reason to use cloneNode

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions