Skip to content

Let set() replace null with a node #5

@aleclarson

Description

@aleclarson

Sometimes, a block is optional (eg: the finally block in a try statement). Currently, the set method doesn't know how to handle each case appropriately.

// This *should* work, but it doesn't.
node.set('finalizer', 'console.log("test")')

// In this case, there's a workaround.
node.after(`finally {
  console.log("test")
}`)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions