mol_wire_lib 1.0.967 → 1.0.969

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mol_wire_lib",
3
- "version": "1.0.967",
3
+ "version": "1.0.969",
4
4
  "exports": {
5
5
  "node": {
6
6
  "import": "./node.mjs",
package/web.js CHANGED
@@ -760,16 +760,13 @@ var $;
760
760
  result = this.task.call(this.host, ...this.args);
761
761
  break;
762
762
  }
763
- if ($mol_promise_like(result)) {
763
+ if ($mol_promise_like(result) && !handled.has(result)) {
764
764
  const put = (res) => {
765
765
  if (this.cache === result)
766
766
  this.put(res);
767
767
  return res;
768
768
  };
769
- result = Object.assign(result.then(put, put), {
770
- destructor: result['destructor'] ?? (() => { })
771
- });
772
- handled.add(result);
769
+ result = result.then(put, put);
773
770
  }
774
771
  }
775
772
  catch (error) {
@@ -780,15 +777,20 @@ var $;
780
777
  result = new Error(String(error), { cause: error });
781
778
  }
782
779
  if ($mol_promise_like(result) && !handled.has(result)) {
783
- result = Object.assign(result.finally(() => {
780
+ result = result.finally(() => {
784
781
  if (this.cache === result)
785
782
  this.absorb();
786
- }), {
787
- destructor: result['destructor'] ?? (() => { })
788
783
  });
789
- handled.add(result);
790
784
  }
791
785
  }
786
+ if ($mol_promise_like(result) && !handled.has(result)) {
787
+ result = Object.assign(result, {
788
+ destructor: result['destructor'] ?? (() => { })
789
+ });
790
+ handled.add(result);
791
+ const error = new Error();
792
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
793
+ }
792
794
  if (!$mol_promise_like(result)) {
793
795
  this.track_cut();
794
796
  }