Home / File/ debugInfo.js — react Source File

debugInfo.js — react Source File

Architecture documentation for debugInfo.js, a javascript file in the react codebase.

Entity Profile

Relationship Graph

Source Code

'use strict';

type DebugInfoConfig = {
  ignoreProps?: boolean,
  ignoreRscStreamInfo?: boolean,
  useFixedTime?: boolean,
  useV8Stack?: boolean,
};

function formatV8Stack(stack) {
  let v8StyleStack = '';
  if (stack) {
    for (let i = 0; i < stack.length; i++) {
      const [name] = stack[i];
      if (v8StyleStack !== '') {
        v8StyleStack += '\n';
      }
      v8StyleStack += '    in ' + name + ' (at **)';
    }
  }
  return v8StyleStack;
}

function normalizeStack(stack) {
  if (!stack) {
    return stack;
  }
  const copy = [];
  for (let i = 0; i < stack.length; i++) {
    const [name, file, line, col, enclosingLine, enclosingCol] = stack[i];
    copy.push([
      name,
      file.replace(__REACT_ROOT_PATH_TEST__, ''),
      line,
      col,
      enclosingLine,
      enclosingCol,
    ]);
  }
  return copy;
}

function normalizeIOInfo(config: DebugInfoConfig, ioInfo) {
  const {debugTask, debugStack, debugLocation, ...copy} = ioInfo;
  if (ioInfo.stack) {
    copy.stack = config.useV8Stack
      ? formatV8Stack(ioInfo.stack)
      : normalizeStack(ioInfo.stack);
  }
  if (ioInfo.owner) {
    copy.owner = normalizeDebugInfo(config, ioInfo.owner);
  }
  if (typeof ioInfo.start === 'number' && config.useFixedTime) {
    copy.start = 0;
  }
  if (typeof ioInfo.end === 'number' && config.useFixedTime) {
    copy.end = 0;
  }
  const promise = ioInfo.value;
  if (promise) {
// ... (80 more lines)

Domain

Subdomains

Frequently Asked Questions

What does debugInfo.js do?
debugInfo.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Optimization subdomain.
What functions are defined in debugInfo.js?
debugInfo.js defines 5 function(s): formatV8Stack, getDebugInfo, normalizeDebugInfo, normalizeIOInfo, normalizeStack.
Where is debugInfo.js in the architecture?
debugInfo.js is located at packages/internal-test-utils/debugInfo.js (domain: BabelCompiler, subdomain: Optimization, directory: packages/internal-test-utils).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free