@@ -75,28 +75,34 @@ pub fn to_code(node: &impl Node) -> String {
75
75
}
76
76
77
77
pub trait Node : Spanned + Sized {
78
- fn emit_with < W , S > ( & self , e : & mut Emitter < ' _ , W , S > ) -> Result
78
+ fn emit_with < W , S > ( & self , emitter : & mut Emitter < ' _ , W , S > ) -> Result
79
79
where
80
80
W : WriteJs ,
81
81
S : SourceMapper + SourceMapperExt ;
82
82
83
- fn with_new_span < W , S > ( & self , e : & mut NodeEmitter < ' _ , W , S > ) -> Result < Self >
83
+ fn with_new_span < W , S > ( & self , emitter : & mut NodeEmitter < ' _ , W , S > ) -> Result < Self >
84
84
where
85
85
W : WriteJs ,
86
86
S : SourceMapper + SourceMapperExt ;
87
87
}
88
88
89
89
impl < N : Node > Node for Box < N > {
90
- #[ inline]
91
- fn emit_with < W , S > ( & self , e : & mut Emitter < ' _ , W , S > ) -> Result
90
+ fn emit_with < W , S > ( & self , emitter : & mut Emitter < ' _ , W , S > ) -> Result
92
91
where
93
92
W : WriteJs ,
94
93
S : SourceMapper + SourceMapperExt ,
95
94
{
96
- ( * * self ) . emit_with ( e )
95
+ ( * * self ) . emit_with ( emitter )
97
96
}
98
- }
99
97
98
+ fn with_new_span < W , S > ( & self , emitter : & mut NodeEmitter < ' _ , W , S > ) -> Result < Self >
99
+ where
100
+ W : WriteJs ,
101
+ S : SourceMapper + SourceMapperExt ,
102
+ {
103
+ Box :: new ( ( * * self ) . with_new_span ( emitter) )
104
+ }
105
+ }
100
106
pub struct Emitter < ' a , W , S >
101
107
where
102
108
W : WriteJs ,
0 commit comments