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

Strange issue with overzealous helper inclusion during compilation #314

Closed
samuelhorwitz opened this issue May 29, 2014 · 1 comment
Closed

Comments

@samuelhorwitz
Copy link

First of all, I am unsure of whether or not this is expected behavior. If it is expected behavior, then the bug is on Ibrik coverage tool's end https://github.com/Constellation/ibrik

I noticed, when running my coverage tests with Ibrik, that after adding a CS class with the extends syntax that my coverage reports got all weird. Line by line, every path appeared to be covered, but the percentages at the top of the screen for branches/functions/etc. all were displaying non-100% values (however my code is 100% covered and properly reports that way when the extends syntax was removed).

After digging, it appears that enabledHelpers in compiler.coffee (https://github.com/michaelficarra/CoffeeScriptRedux/blob/master/src/compiler.coffee#L372) never gets reinitialized to an empty array after each program block. This means that all of my files processed by a CSR instance after the one that includes extends will have the extends$ and isOwn$ helper functions in the compiled JS. Although these helpers don't show up in the Coffeescript coverage map (which maps all the paths back to the original CS file which doesn't include any of the helpers that come with compilation), I obviously haven't actually covered these extend helpers since the files in question don't necessarily use the extend syntax but simply were processed after a file that did.

Regardless of my coverage reporting issues, is this expected behavior? Should new program/file blocks not compile with a fresh enabledHelpers empty array? Or is this working exactly as expected, and I should report to Ibrik that they need to somehow clean up their CSR instance between files?

@lydell
Copy link
Collaborator

lydell commented Aug 23, 2014

No, this is not expected behavior. I also ran into this problem recently, and opened #323, which is a duplicate of this issue I realize now. Even though this issue was reported first, I’m closing this one in favor of #323, since that one is more straight to the point.

@lydell lydell closed this as completed Aug 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants