This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Description
Prerequisites
Description
Atom does not take ?? (Nullish Coalescing Operator ) into account when highlighting/folding
Steps to Reproduce
Use the JavaScript syntax highlighter
Copy/Paste
// ...
// Notifications
NOTIFICATIONS = $ ( '[data-test-selector="onsite-notifications-toast-manager"i] [data-test-selector^="onsite-notification-toast"i]' , true ) . map (
element => {
let streamer = {
live : true ,
href : $ ( 'a' , false , element ) ?. href ,
icon : $ ( 'figure img' , false , element ) ?. src ,
name : $ ( 'figure img' , false , element ) ?. alt ,
} ;
if ( ! defined ( streamer . name ) )
return ;
element . setAttribute ( 'draggable' , true ) ;
element . setAttribute ( 'twitch-tools-streamer-data' , JSON . stringify ( streamer ) ) ;
element . ondragstart ??= event => {
let { currentTarget } = event ;
event . dataTransfer . setData ( 'application/twitch-tools-streamer' , currentTarget . getAttribute ( 'twitch-tools-streamer-data' ) ) ;
event . dataTransfer . dropEffect = 'move' ;
} ;
}
) ;
// ...
Attempt to fold line 17 (it should be matched with line 22 but isn't)
Expected Behavior
The JavaScript syntax highlighter should distinguish between ?? and ? ...: ...
The highlighter should also allow the correct code-folding for ??
Actual Behavior
The syntax highlighter ignores ?? and treats it as ? ...: ...
Code-folding currently mismatches {} [] and () due to it thinking ?? ⇒ ? ...: ...
Reproduces how often:
100%
Versions
Electron Version: 5.0.13
Chrome Version: 73.0.3683.121
Node Version: v12.0.0
Operating System: Windows 10
Last known working version: N/A
Additional Information
Screenshots
Incorrect pair being matched (line 17 → line 23 )
Correct pair being matched (line 17 ← line 22 )
Reactions are currently unavailable