Skip to content

source file binary format is not work #2021

@quininer

Description

@quininer

Currently the @typescript/ast package provided via source file binary format cannot properly access simple ast.

like

function foo() {
    console.log("hello", "world")
}

This failed for two reasons:

  • when FunctionDeclaration.parameter is empty but not nil, it will occupy a slot but will not generate correspond node.
  • getOrCreateChildAtNodeIndex assume a linear layout, but that's not true.

I provided the test and fix in #2006, but I reopened an issue to provide discoverability (I don't know if care about external contributions).

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