File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,9 @@ target/
2222/editors /vscode /out /
2323/editors /vscode /* .vsix
2424
25+ # Jetbrains
26+ /.idea /
27+
2528# Cloned conformance repos
2629tasks /coverage /babel /
2730tasks /coverage /test262 /
Original file line number Diff line number Diff line change @@ -19,12 +19,19 @@ impl<'a> ParserImpl<'a> {
1919 allow_question : bool ,
2020 ) -> Result < BindingPattern < ' a > > {
2121 let mut kind = self . parse_binding_pattern_kind ( ) ?;
22- let optional = if allow_question && self . is_ts { self . eat ( Kind :: Question ) } else { false } ;
22+ let optional = if allow_question && self . is_ts {
23+ let span = self . start_span ( ) ;
24+ if self . eat ( Kind :: Question ) { Some ( self . end_span ( span) ) } else { None }
25+ } else {
26+ None
27+ } ;
2328 let type_annotation = self . parse_ts_type_annotation ( ) ?;
2429 if let Some ( type_annotation) = & type_annotation {
2530 Self :: extend_binding_pattern_span_end ( type_annotation. span , & mut kind) ;
31+ } else if let Some ( span) = optional {
32+ Self :: extend_binding_pattern_span_end ( span, & mut kind) ;
2633 }
27- Ok ( self . ast . binding_pattern ( kind, type_annotation, optional) )
34+ Ok ( self . ast . binding_pattern ( kind, type_annotation, optional. is_some ( ) ) )
2835 }
2936
3037 pub ( crate ) fn parse_binding_pattern_kind ( & mut self ) -> Result < BindingPatternKind < ' a > > {
You can’t perform that action at this time.
0 commit comments