Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit b1f4a4b

Browse files
committed
use ecmaVersion:6 in the test
1 parent 1aa7901 commit b1f4a4b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

tests/catch-scope.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ describe("catch", () => {
7676
}());
7777
`);
7878

79-
const scopeManager = analyze(ast);
79+
const scopeManager = analyze(ast, { ecmaVersion: 6 });
8080

81-
expect(scopeManager.scopes).to.have.length(3);
81+
expect(scopeManager.scopes).to.have.length(5);
8282

8383
const globalScope = scopeManager.scopes[0];
8484

@@ -96,7 +96,13 @@ describe("catch", () => {
9696
expect(functionScope.references[0].from).to.be.equal(functionScope);
9797
expect(functionScope.references[0].resolved).to.be.equal(functionScope.variables[1]);
9898

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];
100106

101107
expect(catchScope.type).to.be.equal("catch");
102108
expect(catchScope.variables).to.have.length(4);
@@ -133,6 +139,12 @@ describe("catch", () => {
133139
expect(catchScope.references[0].resolved).to.be.equal(catchScope.variables[1]);
134140
expect(catchScope.references[1].from).to.be.equal(catchScope);
135141
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);
136148
});
137149
});
138150

0 commit comments

Comments
 (0)