Repository: facebook/react
File: packages/react-devtools-shared/src/symbolicateSource.js (JavaScript)

Code before:
        sourceMapAnnotationStartIndex + SOURCE_MAP_ANNOTATION_PREFIX.length,
        resourceLine.length,
      );

      const sourceMapURL = new URL(sourceMapAt, sourceURL).toString();
      const sourceMap = await fetchFileWithCaching(sourceMapURL).catch(
        () => null,
      );
      if (sourceMap != null) {
        try {
          const parsedSourceMap = JSON.parse(sourceMap);
          const consumer = SourceMapConsumer(parsedSourceMap);
          const {
            sourceURL: possiblyURL,
            line,
            column,
          } = consumer.originalPositionFor({
            lineNumber, // 1-based
            columnNumber, // 1-based
          });

          if (possiblyURL === null) {
            return null;
          }
          try {
            // sourceMapURL=https://...
            void new URL(possiblyURL); // test if it is a valid URL
            const normalizedURL = normalizeUrl(possiblyURL);

            return {sourceURL: normalizedURL, line, column};
          } catch (e) {
            // This is not valid URL
            if (
              // sourceMapURL=/file
              possiblyURL.startsWith('/') ||
              // sourceMapURL=C:\\...
              possiblyURL.slice(1).startsWith(':\\\\')
            ) {
              // This is an absolute path
              return {sourceURL: possiblyURL, line, column};
            }

            // This is a relative path
            // sourceMapURL=x.js.map
            const absoluteSourcePath = new URL(
              possiblyURL,
              sourceMapURL,
            ).toString();
            return {sourceURL: absoluteSourcePath, line, column};
          }
        } catch (e) {

Review comment (suggestion):
```suggestion
            // sourceMapURL = https://react.dev/script.js.map
```

Code after:
        sourceMapAnnotationStartIndex + SOURCE_MAP_ANNOTATION_PREFIX.length,
        resourceLine.length,
      );

      const sourceMapURL = new URL(sourceMapAt, sourceURL).toString();
      const sourceMap = await fetchFileWithCaching(sourceMapURL).catch(
        () => null,
      );
      if (sourceMap != null) {
        try {
          const parsedSourceMap = JSON.parse(sourceMap);
          const consumer = SourceMapConsumer(parsedSourceMap);
          const {
            sourceURL: possiblyURL,
            line,
            column,
          } = consumer.originalPositionFor({
            lineNumber, // 1-based
            columnNumber, // 1-based
          });

          if (possiblyURL === null) {
            return null;
          }
          try {
            // sourceMapURL = https://react.dev/script.js.map
            void new URL(possiblyURL); // test if it is a valid URL
            const normalizedURL = normalizeUrl(possiblyURL);

            return {sourceURL: normalizedURL, line, column};
          } catch (e) {
            // This is not valid URL
            if (
              // sourceMapURL = /file
              possiblyURL.startsWith('/') ||
              // sourceMapURL = C:\\...
              possiblyURL.slice(1).startsWith(':\\\\')
            ) {
              // This is an absolute path
              return {sourceURL: possiblyURL, line, column};
            }

            // This is a relative path
            // possiblyURL = x.js.map, sourceMapURL = https://react.dev/script.js.map
            const absoluteSourcePath = new URL(
              possiblyURL,
              sourceMapURL,
            ).toString();
            return {sourceURL: absoluteSourcePath, line, column};
          }
        } catch (e) {