fix(common): Fix handling of input source maps (#4086)

This commit is contained in:
Donny/강동윤 2022-03-19 15:40:59 +09:00 committed by GitHub
parent 79d0d06fd6
commit b716210de1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1145,11 +1145,10 @@ impl SourceMap {
if let Some(orig) = orig {
for src in orig.sources() {
let idx = builder.add_source(src);
src_id = idx as u32 + 1;
}
for (idx, contents) in orig.source_contents().enumerate() {
builder.set_source_contents(idx as _, contents);
let id = builder.add_source(src);
src_id = id as u32 + 1;
builder.set_source_contents(id, orig.get_source_contents(id));
}
}