Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let set() replace null with a node #5

Open
aleclarson opened this issue May 20, 2018 · 1 comment
Open

Let set() replace null with a node #5

aleclarson opened this issue May 20, 2018 · 1 comment
Labels
bug Something isn't working

Comments

@aleclarson
Copy link
Collaborator

aleclarson commented May 20, 2018

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")
}`)
@aleclarson aleclarson added the bug Something isn't working label May 20, 2018
@aleclarson aleclarson changed the title Let update() add a block in place of null Let set() add a block in place of null May 22, 2018
@aleclarson aleclarson changed the title Let set() add a block in place of null Let set() replace null with a node May 23, 2018
@aleclarson
Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant