hyoo_sync_client 0.0.373 → 0.0.375

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
@@ -2005,16 +2005,13 @@ var $;
2005
2005
  result = this.task.call(this.host, ...this.args);
2006
2006
  break;
2007
2007
  }
2008
- if ($mol_promise_like(result)) {
2008
+ if ($mol_promise_like(result) && !handled.has(result)) {
2009
2009
  const put = (res) => {
2010
2010
  if (this.cache === result)
2011
2011
  this.put(res);
2012
2012
  return res;
2013
2013
  };
2014
- result = Object.assign(result.then(put, put), {
2015
- destructor: result['destructor'] ?? (() => { })
2016
- });
2017
- handled.add(result);
2014
+ result = result.then(put, put);
2018
2015
  }
2019
2016
  }
2020
2017
  catch (error) {
@@ -2025,15 +2022,20 @@ var $;
2025
2022
  result = new Error(String(error), { cause: error });
2026
2023
  }
2027
2024
  if ($mol_promise_like(result) && !handled.has(result)) {
2028
- result = Object.assign(result.finally(() => {
2025
+ result = result.finally(() => {
2029
2026
  if (this.cache === result)
2030
2027
  this.absorb();
2031
- }), {
2032
- destructor: result['destructor'] ?? (() => { })
2033
2028
  });
2034
- handled.add(result);
2035
2029
  }
2036
2030
  }
2031
+ if ($mol_promise_like(result) && !handled.has(result)) {
2032
+ result = Object.assign(result, {
2033
+ destructor: result['destructor'] ?? (() => { })
2034
+ });
2035
+ handled.add(result);
2036
+ const error = new Error();
2037
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
2038
+ }
2037
2039
  if (!$mol_promise_like(result)) {
2038
2040
  this.track_cut();
2039
2041
  }
package/node.test.js CHANGED
@@ -1996,16 +1996,13 @@ var $;
1996
1996
  result = this.task.call(this.host, ...this.args);
1997
1997
  break;
1998
1998
  }
1999
- if ($mol_promise_like(result)) {
1999
+ if ($mol_promise_like(result) && !handled.has(result)) {
2000
2000
  const put = (res) => {
2001
2001
  if (this.cache === result)
2002
2002
  this.put(res);
2003
2003
  return res;
2004
2004
  };
2005
- result = Object.assign(result.then(put, put), {
2006
- destructor: result['destructor'] ?? (() => { })
2007
- });
2008
- handled.add(result);
2005
+ result = result.then(put, put);
2009
2006
  }
2010
2007
  }
2011
2008
  catch (error) {
@@ -2016,15 +2013,20 @@ var $;
2016
2013
  result = new Error(String(error), { cause: error });
2017
2014
  }
2018
2015
  if ($mol_promise_like(result) && !handled.has(result)) {
2019
- result = Object.assign(result.finally(() => {
2016
+ result = result.finally(() => {
2020
2017
  if (this.cache === result)
2021
2018
  this.absorb();
2022
- }), {
2023
- destructor: result['destructor'] ?? (() => { })
2024
2019
  });
2025
- handled.add(result);
2026
2020
  }
2027
2021
  }
2022
+ if ($mol_promise_like(result) && !handled.has(result)) {
2023
+ result = Object.assign(result, {
2024
+ destructor: result['destructor'] ?? (() => { })
2025
+ });
2026
+ handled.add(result);
2027
+ const error = new Error();
2028
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
2029
+ }
2028
2030
  if (!$mol_promise_like(result)) {
2029
2031
  this.track_cut();
2030
2032
  }