-
-
Notifications
You must be signed in to change notification settings - Fork 57
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
Protect against template strings #60
Comments
Can't we make it validate sourceMappingURL string only at the beginning of the line as it's supposed to be? Please see referenced issues, coming from AVA and then nyc. Thanks. |
That'd be a breaking change, could we at least do something like where it can only have whitespaces in between the beginning of the line and the comment? |
Realizing that this wouldn't fix the coffee script problem :( How about a option we pass, i.e. |
@thlorenz, the only problem is that currently there are quite a few packages depending on So this would require all these packages to change their codebase in order to upgrade which I am not sure they are willing to do. To be honest, I see this as a breaking-change, yes, but it's a bug fix as well, so I really don't want to assume, but my initial thought is that most users are indeed only validating What do you guys reckon? |
I believe your assumption is correct, but still some modules may break with It can have pretty far reaching effects since tons of modules use convert-source-map directly or indirectly. So we have some responsibility here. Let's see if others chime in .... |
@thlorenz, I completely understand and I believe we have good options. next patchSetting next major releaseAdjust default @novemberborn would you be happy with that so it's adjusted on nyc? refs: avajs/ava#1595, istanbuljs/nyc#726 |
I disagree with adding a Then library authors don't need to opt-in to get the correct behavior for template strings, which is the real issue right now. |
It's worth noting that Is there a reason Since inline source maps already have the behavior that @zanona is suggesting, perhaps it makes sense to patch the same behavior into |
commentRegex has I have no problem adapting the mapFileCommentRegex to behave like that, but I don't want to remove the optional whitespace chars since that could break people.
some code here
//# sourceMap... (i.e. they have a space at the beginning of the source map line). |
@thlorenz Those cases would not break by merging #61 (what I suggested we do). If we patch in a
I think you misunderstood me. I was pointing out that |
Ah, ok I get it now. Yeah mapFileCommentRegex are less forgiving (they were added much later than the souceMappingURL). However let's keep the commentRegEx non-strict by default (is my suggestion). We can merge #61 since that seems fine to me and think about the |
If I understand correctly #61 will only fix one liner template strings, but not things like `
my string with some info about how to use
//#sourceMapComment
` at any rate there seems to be no simple fix either way for the below case: `
my string with some info about how to use
//#sourceMapComment
` |
Yeah, I don't think |
Guys, do we need any other info or are relying on something else to make this happen? |
Here's a real-world example causing some problems: https://github.com/jashkenas/coffeescript/blob/cbc695b83162c0ee0ffeb61308625f572ee42d6e/lib/coffeescript/coffeescript.js#L194
The text was updated successfully, but these errors were encountered: