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

Align forEachChild with the compiler API #633

Closed
dsherret opened this issue May 27, 2019 · 1 comment
Closed

Align forEachChild with the compiler API #633

dsherret opened this issue May 27, 2019 · 1 comment

Comments

@dsherret
Copy link
Owner

dsherret commented May 27, 2019

This is a big breaking change, but I think it's necessary. Basically when I created this library I deviated from the compiler api and made forEachChild not return values that are returned from it. The problem with doing this is that it makes using forEachChild very impractical for finding values in the AST. I've regretted that deviation for a while now. Just need to bite the bullet and change this as soon as possible.

Regarding #632

cc @cancerberoSgx

  • This could lead to bugs in people's code when they upgrade to 3.0.
  • Move the stop() method to ForEachDescendantTraversalControl and remove ForEachTraversalControl when doing this.
@dsherret dsherret added this to the 3.0.0 milestone May 27, 2019
dsherret added a commit that referenced this issue May 27, 2019
… API (same with `forEachDescendant`).

BREAKING CHANGE: These methods now stop when a value is returned in a callback and they will return the returned value.
@dsherret
Copy link
Owner Author

@cancerberoSgx FYI, this is now released in 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant