-
Notifications
You must be signed in to change notification settings - Fork 150
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
Some template string conversions aren't safe #107
Comments
That's indeed a tricky case. Pretty much impossible to ensure that it doesn't happen. Did you actually encounter a code like this or is it a purely theoretical issue? I think the best we can do about this is to document this shortcoming of the template transform. Not even feasible to display a warning, as that would mean printing a warning for pretty much every template string conversion. |
I've linked this issue from the main page, but I don't think there's anything we can really do about that. If somebody actually encounters this bug with real-world code, feel free to comment. Closing this for now as won't fix. |
Consider this code:
This outputs "bar". But Lebab will convert it to this code:
This outputs "foo" in conforming ES6 engines.
Of course, it isn't possible to statically confirm whether a given value has a
valueOf
that meaningfully differs fromtoString
. At the least, consider including a warning about this.The text was updated successfully, but these errors were encountered: