mol_wire_lib 1.0.1224 → 1.0.1226

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.mjs CHANGED
@@ -754,12 +754,13 @@ var $;
754
754
  break;
755
755
  }
756
756
  if ($mol_promise_like(result) && !handled.has(result)) {
757
+ handled.add(result);
757
758
  const put = (res) => {
758
759
  if (this.cache === result)
759
760
  this.put(res);
760
761
  return res;
761
762
  };
762
- result = result.then(put, put);
763
+ result = Object.assign(result.then(put, put), { destructor: result.destructor });
763
764
  }
764
765
  }
765
766
  catch (error) {
@@ -770,10 +771,11 @@ var $;
770
771
  result = new Error(String(error), { cause: error });
771
772
  }
772
773
  if ($mol_promise_like(result) && !handled.has(result)) {
773
- result = result.finally(() => {
774
+ handled.add(result);
775
+ result = Object.assign(result.finally(() => {
774
776
  if (this.cache === result)
775
777
  this.absorb();
776
- });
778
+ }), { destructor: result.destructor });
777
779
  }
778
780
  }
779
781
  if ($mol_promise_like(result) && !handled.has(result)) {
package/node.test.js CHANGED
@@ -745,12 +745,13 @@ var $;
745
745
  break;
746
746
  }
747
747
  if ($mol_promise_like(result) && !handled.has(result)) {
748
+ handled.add(result);
748
749
  const put = (res) => {
749
750
  if (this.cache === result)
750
751
  this.put(res);
751
752
  return res;
752
753
  };
753
- result = result.then(put, put);
754
+ result = Object.assign(result.then(put, put), { destructor: result.destructor });
754
755
  }
755
756
  }
756
757
  catch (error) {
@@ -761,10 +762,11 @@ var $;
761
762
  result = new Error(String(error), { cause: error });
762
763
  }
763
764
  if ($mol_promise_like(result) && !handled.has(result)) {
764
- result = result.finally(() => {
765
+ handled.add(result);
766
+ result = Object.assign(result.finally(() => {
765
767
  if (this.cache === result)
766
768
  this.absorb();
767
- });
769
+ }), { destructor: result.destructor });
768
770
  }
769
771
  }
770
772
  if ($mol_promise_like(result) && !handled.has(result)) {