GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • lib/internal/source_map
    • source_map.js
    • source_map_cache.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/internal/source_map/source_map.js‎

Copy file name to clipboardExpand all lines: lib/internal/source_map/source_map.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,8 @@ function cloneSourceMapV3(payload) {
334334
* @return {number}
335335
*/
336336
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;
339339
if (lineNumber1 !== lineNumber2) {
340340
return lineNumber1 - lineNumber2;
341341
}
Collapse file

‎lib/internal/source_map/source_map_cache.js‎

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 numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ function sourceMapFromFile(mapURL) {
138138
// data:[<mediatype>][;base64],<data> see:
139139
// https://tools.ietf.org/html/rfc2397#section-2
140140
function sourceMapFromDataUrl(sourceURL, url) {
141-
const [format, data] = StringPrototypeSplit(url, ',');
141+
const { 0: format, 1: data } = StringPrototypeSplit(url, ',');
142142
const splitFormat = StringPrototypeSplit(format, ';');
143143
const contentType = splitFormat[0];
144144
const base64 = splitFormat[splitFormat.length - 1] === 'base64';

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.