File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ const parsers = {
5757 }
5858 const features = new Set ( [ ] . concat ( test . features || [ ] ) ) ;
5959 delete test . features ;
60- const es = test . parserOptions && test . parserOptions . ecmaVersion ;
60+
61+ const es = features . has ( 'class fields' ) ? 2022 : ( features . has ( 'optional chaining' ) ? 2020 : ( test . parserOptions && test . parserOptions . ecmaVersion ) || undefined ) ; // eslint-disable-line no-nested-ternary
6162
6263 function addComment ( testObject , parser ) {
6364 const extras = [ ] . concat (
@@ -130,13 +131,11 @@ const parsers = {
130131 const tsOld = ! skipTS && ! features . has ( 'no-ts-old' ) ;
131132 const tsNew = ! skipTS && ! features . has ( 'no-ts-new' ) ;
132133
133- const minES = features . has ( 'class fields' ) ? 2022 : ( features . has ( 'optional chaining' ) ? 2020 : 5 ) ; // eslint-disable-line no-nested-ternary
134-
135134 return [ ] . concat (
136135 skipBase ? [ ] : addComment (
137- Object . assign ( { } , test , minES > 5 && {
136+ Object . assign ( { } , test , typeof es !== 'undefined' && {
138137 parserOptions : Object . assign ( { } , test . parserOptions , {
139- ecmaVersion : Math . max ( ( test . parserOptions && test . parserOptions . ecmaVersion ) || 0 , minES ) ,
138+ ecmaVersion : Math . max ( ( test . parserOptions && test . parserOptions . ecmaVersion ) || 0 , es ) ,
140139 } ) ,
141140 } ) ,
142141 'default'
You can’t perform that action at this time.
0 commit comments