File tree Expand file tree Collapse file tree 4 files changed +38
-2
lines changed
swc_ecma_transforms_proposal/src
swc/tests/fixture/issues-8xxx/8551 Expand file tree Collapse file tree 4 files changed +38
-2
lines changed Original file line number Diff line number Diff line change 1+ {
2+ "jsc" : {
3+ "parser" : {
4+ "syntax" : " typescript" ,
5+ "decorators" : true
6+ },
7+ "transform" : {
8+ "decoratorVersion" : " 2022-03"
9+ },
10+ "target" : " es2022"
11+ },
12+ "isModule" : true
13+ }
Original file line number Diff line number Diff line change 1+ class C {
2+ [ Symbol . iterator ] ( ) { }
3+ }
4+
5+ namespace NS {
6+ export function f ( ) { }
7+ }
Original file line number Diff line number Diff line change 1+ var _computedKey ;
2+ _computedKey = Symbol . iterator ;
3+ class C {
4+ [ _computedKey ] ( ) { }
5+ }
6+ var NS ;
7+ ( function ( NS ) {
8+ function f ( ) { }
9+ NS . f = f ;
10+ } ) ( NS || ( NS = { } ) ) ;
Original file line number Diff line number Diff line change @@ -1499,7 +1499,10 @@ impl VisitMut for Decorator202203 {
14991499 }
15001500
15011501 fn visit_mut_module_items ( & mut self , n : & mut Vec < ModuleItem > ) {
1502- let old_extra_lets = self . extra_lets . take ( ) ;
1502+ let extra_vars = self . extra_vars . take ( ) ;
1503+ let extra_lets = self . extra_lets . take ( ) ;
1504+ let pre_class_inits = self . pre_class_inits . take ( ) ;
1505+ let extra_exports = self . extra_exports . take ( ) ;
15031506
15041507 let mut new = Vec :: with_capacity ( n. len ( ) ) ;
15051508
@@ -1559,7 +1562,10 @@ impl VisitMut for Decorator202203 {
15591562 n. visit_mut_with ( & mut IdentRenamer :: new ( & self . rename_map ) ) ;
15601563 }
15611564
1562- self . extra_lets = old_extra_lets;
1565+ self . extra_vars = extra_vars;
1566+ self . extra_lets = extra_lets;
1567+ self . pre_class_inits = pre_class_inits;
1568+ self . extra_exports = extra_exports;
15631569 }
15641570
15651571 fn visit_mut_private_prop ( & mut self , p : & mut PrivateProp ) {
You can’t perform that action at this time.
0 commit comments