nebu
nebu copied to clipboard
Let set() replace null with a node
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")
}`)
Fixing this bug will go hand-in-hand with #8, because nebu cannot insert new code reliably without extra context based on the node type.