mol_dump_lib 0.0.661 → 0.0.662

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/web.js CHANGED
@@ -2536,15 +2536,22 @@ var $;
2536
2536
  if (path.length === 0 && check(this))
2537
2537
  return yield [this];
2538
2538
  try {
2539
- for (const item of this.sub()) {
2540
- if (item instanceof $mol_view && check(item)) {
2541
- return yield [...path, this, item];
2542
- }
2539
+ const checked = new Set();
2540
+ const sub = this.sub();
2541
+ for (const item of sub) {
2542
+ if (!(item instanceof $mol_view))
2543
+ continue;
2544
+ if (!check(item))
2545
+ continue;
2546
+ checked.add(item);
2547
+ yield [...path, this, item];
2543
2548
  }
2544
- for (const item of this.sub()) {
2545
- if (item instanceof $mol_view) {
2546
- yield* item.view_find(check, [...path, this]);
2547
- }
2549
+ for (const item of sub) {
2550
+ if (!(item instanceof $mol_view))
2551
+ continue;
2552
+ if (checked.has(item))
2553
+ continue;
2554
+ yield* item.view_find(check, [...path, this]);
2548
2555
  }
2549
2556
  }
2550
2557
  catch (error) {