@@ -76,9 +76,9 @@ describe("catch", () => {
76
76
}());
77
77
` ) ;
78
78
79
- const scopeManager = analyze ( ast ) ;
79
+ const scopeManager = analyze ( ast , { ecmaVersion : 6 } ) ;
80
80
81
- expect ( scopeManager . scopes ) . to . have . length ( 3 ) ;
81
+ expect ( scopeManager . scopes ) . to . have . length ( 5 ) ;
82
82
83
83
const globalScope = scopeManager . scopes [ 0 ] ;
84
84
@@ -96,7 +96,13 @@ describe("catch", () => {
96
96
expect ( functionScope . references [ 0 ] . from ) . to . be . equal ( functionScope ) ;
97
97
expect ( functionScope . references [ 0 ] . resolved ) . to . be . equal ( functionScope . variables [ 1 ] ) ;
98
98
99
- const catchScope = scopeManager . scopes [ 2 ] ;
99
+ const tryBlockScope = scopeManager . scopes [ 2 ] ;
100
+
101
+ expect ( tryBlockScope . type ) . to . be . equal ( "block" ) ;
102
+ expect ( tryBlockScope . variables ) . to . have . length ( 0 ) ;
103
+ expect ( tryBlockScope . references ) . to . have . length ( 0 ) ;
104
+
105
+ const catchScope = scopeManager . scopes [ 3 ] ;
100
106
101
107
expect ( catchScope . type ) . to . be . equal ( "catch" ) ;
102
108
expect ( catchScope . variables ) . to . have . length ( 4 ) ;
@@ -133,6 +139,12 @@ describe("catch", () => {
133
139
expect ( catchScope . references [ 0 ] . resolved ) . to . be . equal ( catchScope . variables [ 1 ] ) ;
134
140
expect ( catchScope . references [ 1 ] . from ) . to . be . equal ( catchScope ) ;
135
141
expect ( catchScope . references [ 1 ] . resolved ) . to . be . equal ( functionScope . variables [ 1 ] ) ;
142
+
143
+ const catchBlockScope = scopeManager . scopes [ 4 ] ;
144
+
145
+ expect ( catchBlockScope . type ) . to . be . equal ( "block" ) ;
146
+ expect ( catchBlockScope . variables ) . to . have . length ( 0 ) ;
147
+ expect ( catchBlockScope . references ) . to . have . length ( 0 ) ;
136
148
} ) ;
137
149
} ) ;
138
150
0 commit comments