Skip to content

Commit

Permalink
Fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
The-x-Theorist committed Dec 2, 2021
1 parent dbc8b03 commit b48b880
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/babel-traverse/src/scope/index.ts
Expand Up @@ -705,7 +705,7 @@ export default class Scope {
for (const declar of declarations) {
this.registerBinding(path.node.kind, declar);
}
} else if(path.isClassDeclaration() && path.node.declare) {
} else if (path.isClassDeclaration() && path.node.declare) {
this.registerBinding("class", path);
} else if (path.isClassDeclaration()) {
this.registerBinding("let", path);
Expand Down
16 changes: 8 additions & 8 deletions packages/babel-traverse/test/scope.js
Expand Up @@ -655,17 +655,17 @@ describe("scope", () => {
});
});

describe('duplicate declaration', () => {
it('should not throw error on duplicate class and function declaration', () => {
describe("duplicate declaration", () => {
it("should not throw error on duplicate class and function declaration", () => {
const ast = [
t.classDeclaration(t.identifier('A'), t.super(), t.classBody([]), []),
t.functionDeclaration(t.identifier('A'), [], t.blockStatement([]))
]
t.classDeclaration(t.identifier("A"), t.super(), t.classBody([]), []),
t.functionDeclaration(t.identifier("A"), [], t.blockStatement([])),
];

ast[0].declare = true;
expect(() => getPath(ast)).not.toThrowError()
})
})
expect(() => getPath(ast)).not.toThrowError();
});
});

describe("global", () => {
// node1, node2, success
Expand Down

0 comments on commit b48b880

Please sign in to comment.