0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-29 23:16:30 +01:00

lib: delete dead code in SourceMap

This seems to be a leftover from the chromium project. Nothing uses
`#reverseMappingsBySourceURL`, so constructing it isn't necessary.

PR-URL: https://github.com/nodejs/node/pull/31512
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Justin Ridgewell 2020-01-25 18:55:14 -05:00 committed by Anna Henningsen
parent 59a1981a22
commit f2ec64fbcf
No known key found for this signature in database
GPG Key ID: 9C63F3A6CD2AD8F9

View File

@ -121,7 +121,6 @@ class StringCharIterator {
*/
class SourceMap {
#payload;
#reverseMappingsBySourceURL = [];
#mappings = [];
#sources = {};
#sourceContentByURL = {};
@ -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]];
}
};
}