Closed sgkoishi closed 2 years ago
Yeah that's the downside of using the Shift parser. Unfortunately there isn't any good way to fix it aside from adding support for newer JS features to Shift (likely complicated and not worth it) or rewriting the project to use Babel (which I may do at some point, but don't have the time currently).
Found the patterns in the sample are like ""?.["toLowerCase"]()
- gonna simply remove all ?.
here.
Not a regression but some other string simplification with \r\n
not working:
console.log(("b" + "a" + + "a" + "a").toLowerCase())
console.log("b" + "a" + ' ' + "a" + "a")
console.log("b" + "a" + '"' + "a" + "a")
console.log("\n" + "" + '"' + "a" + "a")
Result
console.log("baNaNa".toLowerCase());
console.log("ba aa");
console.log('ba"aa');
console.log("\n" + "" + '"' + "a" + "a");
Most other characters like \t
or regular \a\b\c\d\e\f\g
works correctly.
Newline and return characters should be fixed in 4f57a5c424ffc340883ceb4ef67ab8d3313278b3
The same snippet is also not valid using
https://shift-ast.org/parser.html