mol_plot_all 1.2.961 → 1.2.963

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.mjs CHANGED
@@ -780,17 +780,13 @@ var $;
780
780
  result = this.task.call(this.host, ...this.args);
781
781
  break;
782
782
  }
783
- if ($mol_promise_like(result)) {
783
+ if ($mol_promise_like(result) && !handled.has(result)) {
784
784
  const put = (res) => {
785
785
  if (this.cache === result)
786
786
  this.put(res);
787
787
  return res;
788
788
  };
789
- result = Object.assign(result.then(put, put), {
790
- destructor: result['destructor'] ?? (() => { })
791
- });
792
- Error.captureStackTrace(result);
793
- handled.add(result);
789
+ result = result.then(put, put);
794
790
  }
795
791
  }
796
792
  catch (error) {
@@ -801,16 +797,20 @@ var $;
801
797
  result = new Error(String(error), { cause: error });
802
798
  }
803
799
  if ($mol_promise_like(result) && !handled.has(result)) {
804
- result = Object.assign(result.finally(() => {
800
+ result = result.finally(() => {
805
801
  if (this.cache === result)
806
802
  this.absorb();
807
- }), {
808
- destructor: result['destructor'] ?? (() => { })
809
803
  });
810
- Error.captureStackTrace(result);
811
- handled.add(result);
812
804
  }
813
805
  }
806
+ if ($mol_promise_like(result) && !handled.has(result)) {
807
+ result = Object.assign(result, {
808
+ destructor: result['destructor'] ?? (() => { })
809
+ });
810
+ handled.add(result);
811
+ const error = new Error();
812
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
813
+ }
814
814
  if (!$mol_promise_like(result)) {
815
815
  this.track_cut();
816
816
  }