hyoo_sync_client 0.0.374 → 0.0.376

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
@@ -1389,17 +1389,13 @@ var $;
1389
1389
  result = this.task.call(this.host, ...this.args);
1390
1390
  break;
1391
1391
  }
1392
- if ($mol_promise_like(result)) {
1392
+ if ($mol_promise_like(result) && !handled.has(result)) {
1393
1393
  const put = (res) => {
1394
1394
  if (this.cache === result)
1395
1395
  this.put(res);
1396
1396
  return res;
1397
1397
  };
1398
- result = Object.assign(result.then(put, put), {
1399
- destructor: result['destructor'] ?? (() => { })
1400
- });
1401
- Error.captureStackTrace(result);
1402
- handled.add(result);
1398
+ result = result.then(put, put);
1403
1399
  }
1404
1400
  }
1405
1401
  catch (error) {
@@ -1410,16 +1406,20 @@ var $;
1410
1406
  result = new Error(String(error), { cause: error });
1411
1407
  }
1412
1408
  if ($mol_promise_like(result) && !handled.has(result)) {
1413
- result = Object.assign(result.finally(() => {
1409
+ result = result.finally(() => {
1414
1410
  if (this.cache === result)
1415
1411
  this.absorb();
1416
- }), {
1417
- destructor: result['destructor'] ?? (() => { })
1418
1412
  });
1419
- Error.captureStackTrace(result);
1420
- handled.add(result);
1421
1413
  }
1422
1414
  }
1415
+ if ($mol_promise_like(result) && !handled.has(result)) {
1416
+ result = Object.assign(result, {
1417
+ destructor: result['destructor'] ?? (() => { })
1418
+ });
1419
+ handled.add(result);
1420
+ const error = new Error();
1421
+ Object.defineProperty(result, 'stack', { get: () => error.stack });
1422
+ }
1423
1423
  if (!$mol_promise_like(result)) {
1424
1424
  this.track_cut();
1425
1425
  }