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/node.js CHANGED
@@ -3250,15 +3250,22 @@ var $;
3250
3250
  if (path.length === 0 && check(this))
3251
3251
  return yield [this];
3252
3252
  try {
3253
- for (const item of this.sub()) {
3254
- if (item instanceof $mol_view && check(item)) {
3255
- return yield [...path, this, item];
3256
- }
3253
+ const checked = new Set();
3254
+ const sub = this.sub();
3255
+ for (const item of sub) {
3256
+ if (!(item instanceof $mol_view))
3257
+ continue;
3258
+ if (!check(item))
3259
+ continue;
3260
+ checked.add(item);
3261
+ yield [...path, this, item];
3257
3262
  }
3258
- for (const item of this.sub()) {
3259
- if (item instanceof $mol_view) {
3260
- yield* item.view_find(check, [...path, this]);
3261
- }
3263
+ for (const item of sub) {
3264
+ if (!(item instanceof $mol_view))
3265
+ continue;
3266
+ if (checked.has(item))
3267
+ continue;
3268
+ yield* item.view_find(check, [...path, this]);
3262
3269
  }
3263
3270
  }
3264
3271
  catch (error) {