-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Reordering is breaking statements with side-effects. #34
Comments
Thanks. No need for a more isolated test, I reckon this is small enough to work with - will look into it as soon as I get a chance. Not immediately sure what's causing it but am sure it's fixable (he said confidently...) |
@mbostock Turns out I'm struggling to reproduce this - all the d3-shape tests are passing for me, and the statement ordering looks to be correct. Has anything changed since this issue was opened? |
Yeah, there’s a workaround I’ve been using. I’ll try to pare down a standalone test case. |
Here ya go: https://gist.github.com/mbostock/bc1ffc78c3f933eff312 Note that if you reverse the order of statements in index.js, the test passes! |
Ah, I see what's going on here. The Not immediately sure what a general solution looks like (the last time I tried to naively sort statements according to their original order, it ended badly), but I'll try a few things. Suggestions welcome! |
Fixed in 0.9.0 - have confirmed all the d3-shape tests now pass without the workaround |
Here’s linear.js (abridged):
The resulting rolled-up file:
Note that the last two lines have been reversed, so the assignment to LinearClosed.prototype.lineEnd gets overwritten. This code is in d3-shape. I can work on creating an isolated test case if you need it.
The text was updated successfully, but these errors were encountered: