Skip to content

Commit c663c32

Browse files
committed
Patch proc-macro
1 parent 73e56e4 commit c663c32

File tree

1 file changed

+7
-0
lines changed
  • crates/swc_ecma_codegen_macros/src

1 file changed

+7
-0
lines changed

crates/swc_ecma_codegen_macros/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub fn node_impl(
6060
/// Returns `(emitter_method, adjuster_method)`
6161
fn expand_node_impl_method(node_type: &Type, src: ImplItemFn) -> ItemImpl {
6262
let emit_block = ReplaceEmit { emit: true }.fold_block(src.block.clone());
63+
let adjust_block = ReplaceEmit { emit: false }.fold_block(src.block.clone());
6364

6465
parse_quote!(
6566
impl crate::Node for #node_type {
@@ -68,6 +69,12 @@ fn expand_node_impl_method(node_type: &Type, src: ImplItemFn) -> ItemImpl {
6869
W: crate::text_writer::WriteJs,
6970
S: swc_common::SourceMapper + swc_ecma_ast::SourceMapperExt,
7071
#emit_block
72+
73+
fn with_new_span<W, S>(&self, emitter: &mut crate::NodeEmitter<'_, W, S>) -> crate::Result<Self>
74+
where
75+
W: crate::text_writer::WriteJs,
76+
S: swc_common::SourceMapper + swc_ecma_ast::SourceMapperExt,
77+
#adjust_block
7178
}
7279
)
7380
}

0 commit comments

Comments
 (0)