From 78f2fc479537ec68a7481e33db571385cc21cdb7 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Sun, 24 Nov 2024 20:00:48 -0800 Subject: [PATCH] Fix mapping original name from source maps --- src/printer.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/printer.rs b/src/printer.rs index 235a8eab..a51c1491 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -241,10 +241,11 @@ impl<'a, 'b, 'c, W: std::fmt::Write + Sized> Printer<'a, 'b, 'c, W> { if let Some(orig) = mapping.original { let sources_len = map.get_sources().len(); let source_index = map.add_source(sm.get_source(orig.source).unwrap()); + let name = orig.name.map(|name| map.add_name(sm.get_name(name).unwrap())); original.original_line = orig.original_line; original.original_column = orig.original_column; original.source = source_index; - original.name = orig.name; + original.name = name; if map.get_sources().len() > sources_len { let content = sm.get_source_content(orig.source).unwrap().to_owned();