mam 1.11.721 → 1.11.722

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
@@ -887,10 +887,12 @@ var $;
887
887
  result = wrappers.get(result);
888
888
  }
889
889
  else {
890
- wrappers.set(result, result = Object.assign(result.finally(() => {
890
+ const put = (v) => {
891
891
  if (this.cache === result)
892
892
  this.absorb();
893
- }), { destructor: result.destructor || (() => { }) }));
893
+ return v;
894
+ };
895
+ wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
894
896
  const error = new Error(`Promise in ${this}`);
895
897
  Object.defineProperty(result, 'stack', { get: () => error.stack });
896
898
  }
@@ -1992,6 +1994,12 @@ var $;
1992
1994
  $mol_wire_atom.watching.add(this);
1993
1995
  }
1994
1996
  resync(args) {
1997
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
1998
+ const pub = this.data[cursor];
1999
+ if (pub && pub instanceof $mol_wire_task) {
2000
+ pub.destructor();
2001
+ }
2002
+ }
1995
2003
  return this.put(this.task.call(this.host, ...args));
1996
2004
  }
1997
2005
  once() {
package/node.test.js CHANGED
@@ -878,10 +878,12 @@ var $;
878
878
  result = wrappers.get(result);
879
879
  }
880
880
  else {
881
- wrappers.set(result, result = Object.assign(result.finally(() => {
881
+ const put = (v) => {
882
882
  if (this.cache === result)
883
883
  this.absorb();
884
- }), { destructor: result.destructor || (() => { }) }));
884
+ return v;
885
+ };
886
+ wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
885
887
  const error = new Error(`Promise in ${this}`);
886
888
  Object.defineProperty(result, 'stack', { get: () => error.stack });
887
889
  }
@@ -1983,6 +1985,12 @@ var $;
1983
1985
  $mol_wire_atom.watching.add(this);
1984
1986
  }
1985
1987
  resync(args) {
1988
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
1989
+ const pub = this.data[cursor];
1990
+ if (pub && pub instanceof $mol_wire_task) {
1991
+ pub.destructor();
1992
+ }
1993
+ }
1986
1994
  return this.put(this.task.call(this.host, ...args));
1987
1995
  }
1988
1996
  once() {