From 65ebfb2f12f7b4fc721d401ea16c6d2432dafdd4 Mon Sep 17 00:00:00 2001 From: Justin Ridgewell Date: Sat, 25 Jan 2020 18:55:14 -0500 Subject: [PATCH] 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 Reviewed-By: Rich Trott Reviewed-By: James M Snell --- lib/internal/source_map/source_map.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/internal/source_map/source_map.js b/lib/internal/source_map/source_map.js index d66230ec37f312..c440dffdf81913 100644 --- a/lib/internal/source_map/source_map.js +++ b/lib/internal/source_map/source_map.js @@ -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]]; - } }; }