Skip to content

traverse crashes on ES dynamic import #97

@dgoldstein0

Description

@dgoldstein0

the es8 (7? 9? not sure exactly which number it is, but it's stage 4 now I believe) style import("foo") crashes estraverse. In particular:

  • use a parser that produces an estree spec AST and understands this syntax. I discovered this with cherow, but I suspect acorn will also work
  • estraverse.traverse(ast, {enter: function(){}, leave: function(){}}); should probably then be enough to repro if there's a dynamic import in the tree

I expect estraverse to be able to handle the type: "Import" nodes, and it instead throws. This seems to happen when it tries to visit the children of these nodes, as a this.skip() in the enter function when an import node is encountered does the trick. That said, skipping it's children shouldn't be necessary.

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