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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mol_jsx_lib",
3
- "version": "0.0.832",
3
+ "version": "0.0.834",
4
4
  "exports": {
5
5
  "node": {
6
6
  "import": "./node.mjs",
package/web.js CHANGED
@@ -983,17 +983,13 @@ var $;
983
983
  result = this.task.call(this.host, ...this.args);
984
984
  break;
985
985
  }
986
- if ($mol_promise_like(result)) {
986
+ if ($mol_promise_like(result) && !handled.has(result)) {
987
987
  const put = (res) => {
988
988
  if (this.cache === result)
989
989
  this.put(res);
990
990
  return res;
991
991
  };
992
- result = Object.assign(result.then(put, put), {
993
- destructor: result['destructor'] ?? (() => { })
994
- });
995
- Error.captureStackTrace(result);
996
- handled.add(result);
992
+ result = result.then(put, put);
997
993
  }
998
994
  }
999
995
  catch (error) {
@@ -1004,16 +1000,20 @@ var $;
1004
1000
  result = new Error(String(error), { cause: error });
1005
1001
  }
1006
1002
  if ($mol_promise_like(result) && !handled.has(result)) {
1007
- result = Object.assign(result.finally(() => {
1003
+ result = result.finally(() => {
1008
1004
  if (this.cache === result)
1009
1005
  this.absorb();
1010
- }), {
1011
- destructor: result['destructor'] ?? (() => { })
1012
1006
  });
1013
- Error.captureStackTrace(result);
1014
- handled.add(result);
1015
1007
  }
1016
1008
  }
1009
+ if ($mol_promise_like(result) && !handled.has(result)) {
1010
+ result = Object.assign(result, {
1011
+ destructor: result['destructor'] ?? (() => { })
1012
+ });
1013
+ handled.add(result);
1014
+ const error = new Error();
1015
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
1016
+ }
1017
1017
  if (!$mol_promise_like(result)) {
1018
1018
  this.track_cut();
1019
1019
  }