@impakers/debug 1.3.8 → 1.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/react.js CHANGED
@@ -1389,7 +1389,7 @@ function parseComponentFrame(stack) {
1389
1389
  /\/dist\/index\./,
1390
1390
  // Our bundled output (dist/index.mjs, dist/index.js)
1391
1391
  /node_modules\//,
1392
- // Any package in node_modules
1392
+ // Any package in node_modules (dev mode)
1393
1393
  /react-dom/,
1394
1394
  /react\.development/,
1395
1395
  /react\.production/,
@@ -1397,25 +1397,31 @@ function parseComponentFrame(stack) {
1397
1397
  /react-stack-bottom-frame/,
1398
1398
  /react-reconciler/,
1399
1399
  /scheduler/,
1400
- /<anonymous>/
1401
- // Proxy handler frames
1400
+ /at <anonymous>:/
1401
+ // Standalone anonymous frames (proxy handler, eval)
1402
1402
  ];
1403
1403
  const v8Re = /^\s*at\s+(?:.*?\s+\()?(.+?):(\d+):(\d+)\)?$/;
1404
1404
  const webkitRe = /^[^@]*@(.+?):(\d+):(\d+)$/;
1405
+ let lastValid = null;
1405
1406
  for (const line of lines) {
1406
1407
  const trimmed = line.trim();
1407
1408
  if (!trimmed) continue;
1408
- if (skipPatterns.some((p) => p.test(trimmed))) continue;
1409
+ if (skipPatterns.some((p) => p.test(trimmed))) {
1410
+ if (/at <anonymous>:/.test(trimmed) && lastValid) {
1411
+ return lastValid;
1412
+ }
1413
+ continue;
1414
+ }
1409
1415
  const match = v8Re.exec(trimmed) || webkitRe.exec(trimmed);
1410
1416
  if (match) {
1411
- return {
1417
+ lastValid = {
1412
1418
  fileName: match[1],
1413
1419
  line: parseInt(match[2], 10),
1414
1420
  column: parseInt(match[3], 10)
1415
1421
  };
1416
1422
  }
1417
1423
  }
1418
- return null;
1424
+ return lastValid;
1419
1425
  }
1420
1426
  function cleanSourcePath(rawPath) {
1421
1427
  let path = rawPath;