File tree Expand file tree Collapse file tree 1 file changed +15
-20
lines changed
Expand file tree Collapse file tree 1 file changed +15
-20
lines changed Original file line number Diff line number Diff line change @@ -159,26 +159,6 @@ describe("Parser", () => {
159159 fgh : [ "test" , "test ttt" , "test e" ]
160160 }
161161 ] ,
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- ] ,
182162 "renaming with const" : [
183163 function ( ) {
184164 const xyz = abc ;
@@ -638,4 +618,19 @@ describe("Parser", () => {
638618 } ) ;
639619 } ) ;
640620 } ) ;
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+ } ) ;
641636} ) ;
You can’t perform that action at this time.
0 commit comments