fix(es/utils): Fix collect_decls (#2792)

swc_ecma_utils:
 - `collect_decls`: Handle assignment pattern property. (Closes #2785)
This commit is contained in:
Donny/강동윤 2021-11-18 15:05:26 +09:00 committed by GitHub
parent ee12362688
commit af420eab4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -256,7 +256,7 @@ jobs:
- name: Run cargo test (swc, concurrent)
shell: bash
if: matrix.crate == 'swc'
if: matrix.crate == 'swc' && runner.os != 'Windows'
run: |
cargo test --color always -p swc --features concurrent

View File

@ -2165,6 +2165,14 @@ where
{
noop_visit_type!();
fn visit_assign_pat_prop(&mut self, node: &AssignPatProp, _: &dyn Node) {
node.value.visit_with(node, self);
if self.is_pat_decl {
self.add(&node.key);
}
}
fn visit_class_decl(&mut self, node: &ClassDecl, _: &dyn Node) {
node.visit_children_with(self);