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/web.mjs CHANGED
@@ -1389,16 +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
- handled.add(result);
1398
+ result = result.then(put, put);
1402
1399
  }
1403
1400
  }
1404
1401
  catch (error) {
@@ -1409,15 +1406,20 @@ var $;
1409
1406
  result = new Error(String(error), { cause: error });
1410
1407
  }
1411
1408
  if ($mol_promise_like(result) && !handled.has(result)) {
1412
- result = Object.assign(result.finally(() => {
1409
+ result = result.finally(() => {
1413
1410
  if (this.cache === result)
1414
1411
  this.absorb();
1415
- }), {
1416
- destructor: result['destructor'] ?? (() => { })
1417
1412
  });
1418
- handled.add(result);
1419
1413
  }
1420
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
+ }
1421
1423
  if (!$mol_promise_like(result)) {
1422
1424
  this.track_cut();
1423
1425
  }