{"ast":null,"code":"'use strict';\n\nvar RE_FRAME = /^ {4}at (.+?)(?: \\((native)\\)?| \\((address at )?(.*?):(\\d+):(\\d+)\\))$/;\nvar RE_SKIPPED = /^ {4}... skipping (\\d+) frames$/;\nfunction isInternalBytecodeSourceUrl(sourceUrl) {\n  return sourceUrl === 'InternalBytecode.js';\n}\nfunction parseLine(line) {\n  var asFrame = line.match(RE_FRAME);\n  if (asFrame) {\n    return {\n      type: 'FRAME',\n      functionName: asFrame[1],\n      location: asFrame[2] === 'native' ? {\n        type: 'NATIVE'\n      } : asFrame[3] === 'address at ' ? isInternalBytecodeSourceUrl(asFrame[4]) ? {\n        type: 'INTERNAL_BYTECODE',\n        sourceUrl: asFrame[4],\n        line1Based: Number.parseInt(asFrame[5], 10),\n        virtualOffset0Based: Number.parseInt(asFrame[6], 10)\n      } : {\n        type: 'BYTECODE',\n        sourceUrl: asFrame[4],\n        line1Based: Number.parseInt(asFrame[5], 10),\n        virtualOffset0Based: Number.parseInt(asFrame[6], 10)\n      } : {\n        type: 'SOURCE',\n        sourceUrl: asFrame[4],\n        line1Based: Number.parseInt(asFrame[5], 10),\n        column1Based: Number.parseInt(asFrame[6], 10)\n      }\n    };\n  }\n  var asSkipped = line.match(RE_SKIPPED);\n  if (asSkipped) {\n    return {\n      type: 'SKIPPED',\n      count: Number.parseInt(asSkipped[1], 10)\n    };\n  }\n}\nmodule.exports = function parseHermesStack(stack) {\n  var lines = stack.split(/\\n/);\n  var entries = [];\n  var lastMessageLine = -1;\n  for (var i = 0; i < lines.length; ++i) {\n    var line = lines[i];\n    if (!line) {\n      continue;\n    }\n    var entry = parseLine(line);\n    if (entry) {\n      entries.push(entry);\n      continue;\n    }\n    lastMessageLine = i;\n    entries = [];\n  }\n  var message = lines.slice(0, lastMessageLine + 1).join('\\n');\n  return {\n    message: message,\n    entries: entries\n  };\n};","map":{"version":3,"names":["RE_FRAME","RE_SKIPPED","isInternalBytecodeSourceUrl","sourceUrl","parseLine","line","asFrame","match","type","functionName","location","line1Based","Number","parseInt","virtualOffset0Based","column1Based","asSkipped","count","module","exports","parseHermesStack","stack","lines","split","entries","lastMessageLine","i","length","entry","push","message","slice","join"],"sources":["/Users/Daniel.Antelo/Workspaces/expo-template-reactrouter-nativebase/node_modules/react-native/Libraries/Core/Devtools/parseHermesStack.js"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n * @flow strict\n */\n\n'use strict';\n\ntype HermesStackLocationNative = $ReadOnly<{\n  type: 'NATIVE',\n}>;\n\ntype HermesStackLocationSource = $ReadOnly<{\n  type: 'SOURCE',\n  sourceUrl: string,\n  line1Based: number,\n  column1Based: number,\n}>;\n\ntype HermesStackLocationInternalBytecode = $ReadOnly<{\n  type: 'INTERNAL_BYTECODE',\n  sourceUrl: string,\n  line1Based: number,\n  virtualOffset0Based: number,\n}>;\n\ntype HermesStackLocationBytecode = $ReadOnly<{\n  type: 'BYTECODE',\n  sourceUrl: string,\n  line1Based: number,\n  virtualOffset0Based: number,\n}>;\n\ntype HermesStackLocation =\n  | HermesStackLocationNative\n  | HermesStackLocationSource\n  | HermesStackLocationInternalBytecode\n  | HermesStackLocationBytecode;\n\ntype HermesStackEntryFrame = $ReadOnly<{\n  type: 'FRAME',\n  location: HermesStackLocation,\n  functionName: string,\n}>;\n\ntype HermesStackEntrySkipped = $ReadOnly<{\n  type: 'SKIPPED',\n  count: number,\n}>;\n\ntype HermesStackEntry = HermesStackEntryFrame | HermesStackEntrySkipped;\n\nexport type HermesParsedStack = $ReadOnly<{\n  message: string,\n  entries: $ReadOnlyArray<HermesStackEntry>,\n}>;\n\n// Capturing groups:\n// 1. function name\n// 2. is this a native stack frame?\n// 3. is this a bytecode address or a source location?\n// 4. source URL (filename)\n// 5. line number (1 based)\n// 6. column number (1 based) or virtual offset (0 based)\nconst RE_FRAME =\n  /^ {4}at (.+?)(?: \\((native)\\)?| \\((address at )?(.*?):(\\d+):(\\d+)\\))$/;\n\n// Capturing groups:\n// 1. count of skipped frames\nconst RE_SKIPPED = /^ {4}... skipping (\\d+) frames$/;\n\nfunction isInternalBytecodeSourceUrl(sourceUrl: string): boolean {\n  // See https://github.com/facebook/hermes/blob/3332fa020cae0bab751f648db7c94e1d687eeec7/lib/VM/Runtime.cpp#L1100\n  return sourceUrl === 'InternalBytecode.js';\n}\n\nfunction parseLine(line: string): ?HermesStackEntry {\n  const asFrame = line.match(RE_FRAME);\n  if (asFrame) {\n    return {\n      type: 'FRAME',\n      functionName: asFrame[1],\n      location:\n        asFrame[2] === 'native'\n          ? {type: 'NATIVE'}\n          : asFrame[3] === 'address at '\n          ? isInternalBytecodeSourceUrl(asFrame[4])\n            ? {\n                type: 'INTERNAL_BYTECODE',\n                sourceUrl: asFrame[4],\n                line1Based: Number.parseInt(asFrame[5], 10),\n                virtualOffset0Based: Number.parseInt(asFrame[6], 10),\n              }\n            : {\n                type: 'BYTECODE',\n                sourceUrl: asFrame[4],\n                line1Based: Number.parseInt(asFrame[5], 10),\n                virtualOffset0Based: Number.parseInt(asFrame[6], 10),\n              }\n          : {\n              type: 'SOURCE',\n              sourceUrl: asFrame[4],\n              line1Based: Number.parseInt(asFrame[5], 10),\n              column1Based: Number.parseInt(asFrame[6], 10),\n            },\n    };\n  }\n  const asSkipped = line.match(RE_SKIPPED);\n  if (asSkipped) {\n    return {\n      type: 'SKIPPED',\n      count: Number.parseInt(asSkipped[1], 10),\n    };\n  }\n}\n\nmodule.exports = function parseHermesStack(stack: string): HermesParsedStack {\n  const lines = stack.split(/\\n/);\n  let entries: Array<HermesStackEntryFrame | HermesStackEntrySkipped> = [];\n  let lastMessageLine = -1;\n  for (let i = 0; i < lines.length; ++i) {\n    const line = lines[i];\n    if (!line) {\n      continue;\n    }\n    const entry = parseLine(line);\n    if (entry) {\n      entries.push(entry);\n      continue;\n    }\n    // No match - we're still in the message\n    lastMessageLine = i;\n    entries = [];\n  }\n  const message =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