You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Javascript syntax highlighting fails with ES6 arrow functions with arguments split over multiple lines, if arguments contain default array or string #499
Just paste this code into a new buffer and configure it to be JavaScript:
constfn=({
arg =[],})=>{return"This line should be highlighted correctly";}
Compare highlighting between:
Code above (incorrect highlighting):
Arguments on single line (correct highlighting):
No [] or "string" as default argument value (correct highlighting):
This example is obviously simplified from where I encountered it. Highlighting resumed midway through my function after a ternary expression (the : specifically). I could replicate the behaviour with either a string or array default value (empty or non-empty did not matter).