-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
overwrite segments for removed code #147
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,12 +27,20 @@ export default class Mappings { | |
let originalCharIndex = chunk.start; | ||
let first = true; | ||
|
||
let len = this.rawSegments.length; | ||
while (originalCharIndex < chunk.end) { | ||
if (this.hires || first || sourcemapLocations[originalCharIndex]) { | ||
this.rawSegments.push([this.generatedCodeColumn, sourceIndex, loc.line, loc.column]); | ||
if (len !== 0) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This would then become |
||
const segment = this.rawSegments[len - 1]; | ||
if (segment[0] === this.generatedCodeColumn) { | ||
len -= 1; // overwrite segments for removed code | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes to this.rawSegments[checkDuplicateSegmentIndex] = [...]; |
||
} | ||
} | ||
this.rawSegments[len++] = [this.generatedCodeColumn, sourceIndex, loc.line, loc.column]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The default path should be able to then revert to a |
||
} | ||
|
||
if (original[originalCharIndex] === '\n') { | ||
len = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And this becomes |
||
loc.line += 1; | ||
loc.column = 0; | ||
this.generatedCodeLine += 1; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rather call this something more explanatory, perhaps: