@ai-ecoverse/slicc-kernel 1.165.2 → 1.166.0

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.
@@ -1525,8 +1525,21 @@ var ownNames = /* @__PURE__ */ new Set([
1525
1525
  var ownHash = apply(hashOf, self, []);
1526
1526
  var programHashes = /* @__PURE__ */ new Set();
1527
1527
  var programNames = /* @__PURE__ */ new Set();
1528
+ var SOURCE_NAMES = 4096;
1529
+ var sourceNames = /* @__PURE__ */ new Set();
1528
1530
  function programName(name) {
1529
- return apply(startsWith, name, ["data:"]) === true || apply(setHas, programNames, [name]) === true;
1531
+ return apply(startsWith, name, ["data:"]) === true || apply(setHas, programNames, [name]) === true || apply(setHas, sourceNames, [name]) === true;
1532
+ }
1533
+ function noteSourceUrls(trace) {
1534
+ for (let i = 0; i < trace.length; i++) {
1535
+ const site = trace[i];
1536
+ if (apply(isEval, site, []) !== true || apply(hashOf, site, []) === ownHash) continue;
1537
+ const origin = apply(originOf, site, []);
1538
+ if (typeof origin !== "string" || evalAt(origin)) continue;
1539
+ const name = apply(nameOf, site, []);
1540
+ if (typeof name !== "string" || apply(setHas, ownNames, [name]) === true) continue;
1541
+ if (sourceNames.size < SOURCE_NAMES) apply(setAdd, sourceNames, [name]);
1542
+ }
1530
1543
  }
1531
1544
  function rootOrigin(origin) {
1532
1545
  let at = origin;
@@ -1574,6 +1587,7 @@ function keptFrame(site) {
1574
1587
  return apply(startsWith, file, ["node:"]) === true || programName(file);
1575
1588
  }
1576
1589
  function keptFrames(trace) {
1590
+ noteSourceUrls(trace);
1577
1591
  const out = [];
1578
1592
  for (let i = 0; i < trace.length; i++) {
1579
1593
  const site = trace[i];
@@ -1595,6 +1609,7 @@ function positionsAt(positions, error, site) {
1595
1609
  }
1596
1610
  function record(positions, error, trace) {
1597
1611
  if (typeof error === "object" && error !== null && trace.length > 0) {
1612
+ noteSourceUrls(trace);
1598
1613
  const site = trace[0];
1599
1614
  apply(mapSet, seen, [error, { site, at: positionsAt(positions, error, site) }]);
1600
1615
  }