File tree 1 file changed +15
-20
lines changed
1 file changed +15
-20
lines changed Original file line number Diff line number Diff line change @@ -159,26 +159,6 @@ describe("Parser", () => {
159
159
fgh : [ "test" , "test ttt" , "test e" ]
160
160
}
161
161
] ,
162
- "in try, no binding" : [
163
- function ( ) {
164
- try {
165
- fgh . sub ;
166
- fgh ;
167
-
168
- function test ( ttt ) {
169
- fgh . sub ;
170
- fgh ;
171
- }
172
- } catch {
173
- fgh . sub ;
174
- fgh ;
175
- }
176
- } ,
177
- {
178
- fghsub : [ "try" , "notry" , "notry" ] ,
179
- fgh : [ "test" , "test ttt" , "test" ]
180
- }
181
- ] ,
182
162
"renaming with const" : [
183
163
function ( ) {
184
164
const xyz = abc ;
@@ -638,4 +618,19 @@ describe("Parser", () => {
638
618
} ) ;
639
619
} ) ;
640
620
} ) ;
621
+
622
+ describe ( "optional catch binding support" , ( ) => {
623
+ describe ( "should accept" , ( ) => {
624
+ const cases = {
625
+ "optional binding" : "try {} catch {}"
626
+ } ;
627
+ Object . keys ( cases ) . forEach ( name => {
628
+ const expr = cases [ name ] ;
629
+ it ( name , ( ) => {
630
+ const actual = Parser . parse ( expr ) ;
631
+ expect ( typeof actual ) . toBe ( "object" ) ;
632
+ } ) ;
633
+ } ) ;
634
+ } ) ;
635
+ } ) ;
641
636
} ) ;
You can’t perform that action at this time.
0 commit comments