| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
Sorry, something went wrong.
|
Plain JS tests are in $ts/tests/cases/conformance/salsa/plainJS*. You can get the settings you need to test them from the existing tests. A couple of gotchas I thought of:
At least, I think there are shenanigans possible with valueOf; I couldn't get a working example. |
Sorry, something went wrong.
|
I think there's no need to support the first case. The second case is a bit more interesting, maybe I can add detection to check if the literal contains toString, valueOf, or any computed property name only in JS. |
Sorry, something went wrong.
|
Add test files. |
Sorry, something went wrong.
|
A couple more examples from Brad Zacher (@bradzacher)'s comment: [1,2,3] == '1,2,3'
// -> true
({toString() { return 1 }}) == 1
// -> trueThe second one is pretty close to the second example in my comment but arguably more likely to be written as a weird workaround for something. Even a weird workaround shouldn't have an error in JS given the reaction of some JS users when an unavoidable red squiggly shows up. |
Sorry, something went wrong.
|
So we only emit it for === not for ==? |
Sorry, something went wrong.
|
Yeah, I think so. |
Sorry, something went wrong.
|
done |
Sorry, something went wrong.
|
rebased |
Sorry, something went wrong.
There was a problem hiding this comment.
Almost ready, just one more change.
It's been a long time, so if you want me to finish this, let me know.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
I don't know where I can add a test for JS files.
According to discussion in #45978, I open this PR to also check JavaScript files.