mirror of
https://github.com/swc-project/swc.git
synced 2024-12-25 22:56:11 +03:00
fix(es/compat): Set inserted var inside export class in destructing (#8470)
This commit is contained in:
parent
ae659616e6
commit
4416077f4a
@ -565,6 +565,24 @@ impl VisitMut for AssignFolder {
|
||||
self.exporting = exporting;
|
||||
}
|
||||
|
||||
fn visit_mut_class(&mut self, f: &mut Class) {
|
||||
let exporting = mem::replace(&mut self.exporting, false);
|
||||
f.visit_mut_children_with(self);
|
||||
self.exporting = exporting;
|
||||
}
|
||||
|
||||
fn visit_mut_object_lit(&mut self, f: &mut ObjectLit) {
|
||||
let exporting = mem::replace(&mut self.exporting, false);
|
||||
f.visit_mut_children_with(self);
|
||||
self.exporting = exporting;
|
||||
}
|
||||
|
||||
fn visit_mut_arrow_expr(&mut self, f: &mut ArrowExpr) {
|
||||
let exporting = mem::replace(&mut self.exporting, false);
|
||||
f.visit_mut_children_with(self);
|
||||
self.exporting = exporting;
|
||||
}
|
||||
|
||||
fn visit_mut_expr(&mut self, expr: &mut Expr) {
|
||||
let ignore_return_value = self.ignore_return_value.take().is_some();
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
export class A {
|
||||
constructor(t, { a, b = 6, c } = {}) {}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
export class A {
|
||||
constructor(t, ref){
|
||||
let _ref = ref === void 0 ? {} : ref, a = _ref.a, _ref_b = _ref.b, b = _ref_b === void 0 ? 6 : _ref_b, c = _ref.c;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user