Skip to content

Commit

Permalink
lib: delete dead code in SourceMap
Browse files Browse the repository at this point in the history
This seems to be a leftover from the chromium project. Nothing uses
`#reverseMappingsBySourceURL`, so constructing it isn't necessary.

PR-URL: #31512
Reviewed-By: Ben Coe <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
jridgewell authored and codebytere committed Feb 17, 2020
1 parent 3c6545f commit 9ecae58
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions lib/internal/source_map/source_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ class StringCharIterator {
*/
class SourceMap {
#payload;
#reverseMappingsBySourceURL = [];
#mappings = [];
#sources = {};
#sourceContentByURL = {};
Expand Down Expand Up @@ -262,19 +261,6 @@ class SourceMap {
this.#mappings.push([lineNumber, columnNumber, sourceURL,
sourceLineNumber, sourceColumnNumber]);
}

for (let i = 0; i < this.#mappings.length; ++i) {
const mapping = this.#mappings[i];
const url = mapping[2];
if (!url)
continue;
if (!this.#reverseMappingsBySourceURL[url])
this.#reverseMappingsBySourceURL[url] = [];
const reverseMappings = this.#reverseMappingsBySourceURL[url];
const sourceLine = mapping[3];
if (!reverseMappings[sourceLine])
reverseMappings[sourceLine] = [mapping[0], mapping[1]];
}
};
}

Expand Down

0 comments on commit 9ecae58

Please sign in to comment.