mol_wire_lib 1.0.1451 → 1.0.1453

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
@@ -100,7 +100,7 @@ var $;
100
100
  emit(quant = $mol_wire_cursor.stale) {
101
101
  for (let i = this.sub_from; i < this.data.length; i += 2) {
102
102
  ;
103
- this.data[i].absorb(quant);
103
+ this.data[i].absorb(quant, this.data[i + 1]);
104
104
  }
105
105
  }
106
106
  peer_move(from_pos, to_pos) {
@@ -351,13 +351,24 @@ var $;
351
351
  pub?.complete();
352
352
  }
353
353
  }
354
- absorb(quant = $mol_wire_cursor.stale) {
354
+ absorb(quant = $mol_wire_cursor.stale, pos = -1) {
355
355
  if (this.cursor === $mol_wire_cursor.final)
356
356
  return;
357
357
  if (this.cursor >= quant)
358
358
  return;
359
359
  this.cursor = quant;
360
360
  this.emit($mol_wire_cursor.doubt);
361
+ if (pos >= 0 && pos < this.sub_from - 2) {
362
+ const pub = this.data[pos];
363
+ if (pub instanceof $mol_wire_task)
364
+ return;
365
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
366
+ const pub = this.data[cursor];
367
+ if (pub instanceof $mol_wire_task) {
368
+ pub.destructor();
369
+ }
370
+ }
371
+ }
361
372
  }
362
373
  [$mol_dev_format_head]() {
363
374
  return $mol_dev_format_native(this);
package/node.test.js CHANGED
@@ -91,7 +91,7 @@ var $;
91
91
  emit(quant = $mol_wire_cursor.stale) {
92
92
  for (let i = this.sub_from; i < this.data.length; i += 2) {
93
93
  ;
94
- this.data[i].absorb(quant);
94
+ this.data[i].absorb(quant, this.data[i + 1]);
95
95
  }
96
96
  }
97
97
  peer_move(from_pos, to_pos) {
@@ -342,13 +342,24 @@ var $;
342
342
  pub?.complete();
343
343
  }
344
344
  }
345
- absorb(quant = $mol_wire_cursor.stale) {
345
+ absorb(quant = $mol_wire_cursor.stale, pos = -1) {
346
346
  if (this.cursor === $mol_wire_cursor.final)
347
347
  return;
348
348
  if (this.cursor >= quant)
349
349
  return;
350
350
  this.cursor = quant;
351
351
  this.emit($mol_wire_cursor.doubt);
352
+ if (pos >= 0 && pos < this.sub_from - 2) {
353
+ const pub = this.data[pos];
354
+ if (pub instanceof $mol_wire_task)
355
+ return;
356
+ for (let cursor = this.pub_from; cursor < this.sub_from; cursor += 2) {
357
+ const pub = this.data[cursor];
358
+ if (pub instanceof $mol_wire_task) {
359
+ pub.destructor();
360
+ }
361
+ }
362
+ }
352
363
  }
353
364
  [$mol_dev_format_head]() {
354
365
  return $mol_dev_format_native(this);
@@ -5075,8 +5086,6 @@ var $;
5075
5086
  $mol_wire_sync(this).wait();
5076
5087
  return this.value();
5077
5088
  }
5078
- static test() {
5079
- }
5080
5089
  }
5081
5090
  __decorate([
5082
5091
  $mol_wire_solo
@@ -5087,9 +5096,6 @@ var $;
5087
5096
  __decorate([
5088
5097
  $mol_wire_solo
5089
5098
  ], App, "result", null);
5090
- __decorate([
5091
- $mol_wire_method
5092
- ], App, "test", null);
5093
5099
  $mol_assert_equal(App.result(), 1);
5094
5100
  App.resets(null);
5095
5101
  $mol_wire_fiber.sync();