File tree 1 file changed +4
-5
lines changed
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ const parsers = {
57
57
}
58
58
const features = new Set ( [ ] . concat ( test . features || [ ] ) ) ;
59
59
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
61
62
62
63
function addComment ( testObject , parser ) {
63
64
const extras = [ ] . concat (
@@ -130,13 +131,11 @@ const parsers = {
130
131
const tsOld = ! skipTS && ! features . has ( 'no-ts-old' ) ;
131
132
const tsNew = ! skipTS && ! features . has ( 'no-ts-new' ) ;
132
133
133
- const minES = features . has ( 'class fields' ) ? 2022 : ( features . has ( 'optional chaining' ) ? 2020 : 5 ) ; // eslint-disable-line no-nested-ternary
134
-
135
134
return [ ] . concat (
136
135
skipBase ? [ ] : addComment (
137
- Object . assign ( { } , test , minES > 5 && {
136
+ Object . assign ( { } , test , typeof es !== 'undefined' && {
138
137
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 ) ,
140
139
} ) ,
141
140
} ) ,
142
141
'default'
You can’t perform that action at this time.
0 commit comments