GeezerVison is showing github.com — lib: refactor source_map to avoid unsafe array iteration · nodejs/node@1ef92f6
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/source_map/source_map.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -334,8 +334,8 @@ function cloneSourceMapV3(payload) { |
334 | 334 | * @return {number} |
335 | 335 | */ |
336 | 336 | function compareSourceMapEntry(entry1, entry2) { |
337 | | - const [lineNumber1, columnNumber1] = entry1; |
338 | | - const [lineNumber2, columnNumber2] = entry2; |
| 337 | + const { 0: lineNumber1, 1: columnNumber1 } = entry1; |
| 338 | + const { 0: lineNumber2, 1: columnNumber2 } = entry2; |
339 | 339 | if (lineNumber1 !== lineNumber2) { |
340 | 340 | return lineNumber1 - lineNumber2; |
341 | 341 | } |
|
Collapse file
Copy file name to clipboardExpand all lines: lib/internal/source_map/source_map_cache.js +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -138,7 +138,7 @@ function sourceMapFromFile(mapURL) { |
138 | 138 | // data:[<mediatype>][;base64],<data> see: |
139 | 139 | // https://tools.ietf.org/html/rfc2397#section-2 |
140 | 140 | function sourceMapFromDataUrl(sourceURL, url) { |
141 | | - const [format, data] = StringPrototypeSplit(url, ','); |
| 141 | + const { 0: format, 1: data } = StringPrototypeSplit(url, ','); |
142 | 142 | const splitFormat = StringPrototypeSplit(format, ';'); |
143 | 143 | const contentType = splitFormat[0]; |
144 | 144 | const base64 = splitFormat[splitFormat.length - 1] === 'base64'; |
|