Closed mplungjan closed 2 months ago
Refactored the way tidy works, from what I can see this issue is no more.
Where can I test? This one I just made still shows the issue https://jsfiddle.net/mplungjan/7ergahun/
Perhaps a caching issue - I've additionally purged cache on CloudFlare, perhaps this will help.
Ok, that worked - however I get a parsing error on the otherwise correct ??=
https://jsfiddle.net/mplungjan/Lp2v1gcz/
let a = x?.y; let b = 0 ?? 42; let z ??= []; // parsing error let c &&= 2; let d ||= 3;
Not much I can do about that since it's a browser thing. Safari and Firefox will throw a SyntaxError
.
EDIT: From what I can tell on MDN, the line let z ??= []
is imply not valid syntax – https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_assignment
If I press tidy, jsFiddle breaks all conditional chaining and nullish coalescing operators. If I change to JS1.7 as suggested in (https://github.com/jsfiddle/jsfiddle-users/issues/1771) I just do not get the error shown, but the script is still broken.
?. ?? ??= &&= ||=
Valid JS
Clicking Tidy breaks it
Using JS 1.7 hides the error