hyoo_sync_client 0.0.374 → 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,17 +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
- Error.captureStackTrace(result);
2018
- handled.add(result);
2014
+ result = result.then(put, put);
2019
2015
  }
2020
2016
  }
2021
2017
  catch (error) {
@@ -2026,16 +2022,20 @@ var $;
2026
2022
  result = new Error(String(error), { cause: error });
2027
2023
  }
2028
2024
  if ($mol_promise_like(result) && !handled.has(result)) {
2029
- result = Object.assign(result.finally(() => {
2025
+ result = result.finally(() => {
2030
2026
  if (this.cache === result)
2031
2027
  this.absorb();
2032
- }), {
2033
- destructor: result['destructor'] ?? (() => { })
2034
2028
  });
2035
- Error.captureStackTrace(result);
2036
- handled.add(result);
2037
2029
  }
2038
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
+ }
2039
2039
  if (!$mol_promise_like(result)) {
2040
2040
  this.track_cut();
2041
2041
  }
package/node.test.js CHANGED
@@ -1996,17 +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
- Error.captureStackTrace(result);
2009
- handled.add(result);
2005
+ result = result.then(put, put);
2010
2006
  }
2011
2007
  }
2012
2008
  catch (error) {
@@ -2017,16 +2013,20 @@ var $;
2017
2013
  result = new Error(String(error), { cause: error });
2018
2014
  }
2019
2015
  if ($mol_promise_like(result) && !handled.has(result)) {
2020
- result = Object.assign(result.finally(() => {
2016
+ result = result.finally(() => {
2021
2017
  if (this.cache === result)
2022
2018
  this.absorb();
2023
- }), {
2024
- destructor: result['destructor'] ?? (() => { })
2025
2019
  });
2026
- Error.captureStackTrace(result);
2027
- handled.add(result);
2028
2020
  }
2029
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
+ }
2030
2030
  if (!$mol_promise_like(result)) {
2031
2031
  this.track_cut();
2032
2032
  }