mirror of
https://github.com/swc-project/swc.git
synced 2024-11-27 13:38:33 +03:00
fix(es/decorator): Remove noop_fold_type
(#4022)
This commit is contained in:
parent
531762ae71
commit
0c8c3d7d51
23
crates/swc/tests/fixture/decorators/issue-4021/input/.swcrc
Normal file
23
crates/swc/tests/fixture/decorators/issue-4021/input/.swcrc
Normal file
@ -0,0 +1,23 @@
|
||||
{
|
||||
"jsc": {
|
||||
"parser": {
|
||||
"syntax": "typescript",
|
||||
"tsx": false,
|
||||
"decorators": true
|
||||
},
|
||||
"target": "es2022",
|
||||
"loose": false,
|
||||
"transform": {
|
||||
"legacyDecorator": true,
|
||||
"decoratorMetadata": false
|
||||
},
|
||||
"minify": {
|
||||
"compress": false,
|
||||
"mangle": false
|
||||
}
|
||||
},
|
||||
"module": {
|
||||
"type": "es6"
|
||||
},
|
||||
"minify": false
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
namespace N { @foo class C1 { } }
|
||||
@foo class C2 { }
|
@ -0,0 +1,8 @@
|
||||
var _class, _class1;
|
||||
var N;
|
||||
(function(N) {
|
||||
let C1 = _class = foo((_class = class C1 {
|
||||
}) || _class) || _class;
|
||||
})(N || (N = {}));
|
||||
let C2 = _class1 = foo((_class1 = class C2 {
|
||||
}) || _class1) || _class1;
|
@ -10,7 +10,7 @@ use swc_ecma_utils::{
|
||||
prop_name_to_expr, prop_name_to_expr_value, quote_ident, replace_ident, undefined, ExprFactory,
|
||||
ModuleItemLike, StmtLike,
|
||||
};
|
||||
use swc_ecma_visit::{noop_fold_type, Fold, FoldWith, Visit, VisitWith};
|
||||
use swc_ecma_visit::{Fold, FoldWith, Visit, VisitWith};
|
||||
|
||||
use self::metadata::{Metadata, ParamMetadata};
|
||||
use super::{contains_decorator, DecoratorFinder};
|
||||
@ -86,8 +86,6 @@ impl Visit for Legacy {
|
||||
|
||||
/// TODO: VisitMut
|
||||
impl Fold for Legacy {
|
||||
noop_fold_type!();
|
||||
|
||||
fn fold_decl(&mut self, decl: Decl) -> Decl {
|
||||
let decl: Decl = decl.fold_children_with(self);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user