mol_jsx_lib 0.0.832 → 0.0.834

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
@@ -1624,17 +1624,13 @@ var $;
1624
1624
  result = this.task.call(this.host, ...this.args);
1625
1625
  break;
1626
1626
  }
1627
- if ($mol_promise_like(result)) {
1627
+ if ($mol_promise_like(result) && !handled.has(result)) {
1628
1628
  const put = (res) => {
1629
1629
  if (this.cache === result)
1630
1630
  this.put(res);
1631
1631
  return res;
1632
1632
  };
1633
- result = Object.assign(result.then(put, put), {
1634
- destructor: result['destructor'] ?? (() => { })
1635
- });
1636
- Error.captureStackTrace(result);
1637
- handled.add(result);
1633
+ result = result.then(put, put);
1638
1634
  }
1639
1635
  }
1640
1636
  catch (error) {
@@ -1645,16 +1641,20 @@ var $;
1645
1641
  result = new Error(String(error), { cause: error });
1646
1642
  }
1647
1643
  if ($mol_promise_like(result) && !handled.has(result)) {
1648
- result = Object.assign(result.finally(() => {
1644
+ result = result.finally(() => {
1649
1645
  if (this.cache === result)
1650
1646
  this.absorb();
1651
- }), {
1652
- destructor: result['destructor'] ?? (() => { })
1653
1647
  });
1654
- Error.captureStackTrace(result);
1655
- handled.add(result);
1656
1648
  }
1657
1649
  }
1650
+ if ($mol_promise_like(result) && !handled.has(result)) {
1651
+ result = Object.assign(result, {
1652
+ destructor: result['destructor'] ?? (() => { })
1653
+ });
1654
+ handled.add(result);
1655
+ const error = new Error();
1656
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
1657
+ }
1658
1658
  if (!$mol_promise_like(result)) {
1659
1659
  this.track_cut();
1660
1660
  }