mirror of
https://github.com/swc-project/swc.git
synced 2024-12-29 16:42:28 +03:00
resolver: Handle constructor properly (#1054)
This commit is contained in:
parent
3a26d3d34d
commit
e2546e0100
@ -6,7 +6,7 @@ edition = "2018"
|
||||
license = "Apache-2.0/MIT"
|
||||
name = "swc_ecma_transforms"
|
||||
repository = "https://github.com/swc-project/swc.git"
|
||||
version = "0.23.5"
|
||||
version = "0.23.6"
|
||||
|
||||
[features]
|
||||
const-modules = ["dashmap"]
|
||||
|
@ -692,13 +692,23 @@ impl<'a> VisitMut for Resolver<'a> {
|
||||
}
|
||||
|
||||
fn visit_mut_constructor(&mut self, c: &mut Constructor) {
|
||||
let child_mark = Mark::fresh(self.mark);
|
||||
|
||||
// Child folder
|
||||
let mut folder = Resolver::new(
|
||||
child_mark,
|
||||
Scope::new(ScopeKind::Fn, Some(&self.current)),
|
||||
None,
|
||||
self.handle_types,
|
||||
);
|
||||
|
||||
let old = self.ident_type;
|
||||
self.ident_type = IdentType::Binding;
|
||||
c.params.visit_mut_with(self);
|
||||
c.params.visit_mut_with(&mut folder);
|
||||
self.ident_type = old;
|
||||
|
||||
c.body.visit_mut_with(self);
|
||||
c.key.visit_mut_with(self);
|
||||
c.body.visit_mut_with(&mut folder);
|
||||
c.key.visit_mut_with(&mut folder);
|
||||
}
|
||||
|
||||
/// Leftmost one of a member expression should be resolved.
|
||||
|
Loading…
Reference in New Issue
Block a user