mol_regexp 0.0.1397 → 0.0.1399

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.test.js CHANGED
@@ -514,11 +514,13 @@ var $node = new Proxy({ require }, {
514
514
  get(target, name, wrapper) {
515
515
  if (target[name])
516
516
  return target[name];
517
- const mod = target.require('module');
518
- if (mod.builtinModules.indexOf(name) >= 0)
517
+ if (name.startsWith('node:'))
519
518
  return target.require(name);
520
519
  if (name[0] === '.')
521
520
  return target.require(name);
521
+ const mod = target.require('module');
522
+ if (mod.builtinModules.indexOf(name) >= 0)
523
+ return target.require(name);
522
524
  try {
523
525
  target.require.resolve(name);
524
526
  }
@@ -887,9 +889,8 @@ var $;
887
889
  if (sub_pos !== end) {
888
890
  this.peer_move(end, sub_pos);
889
891
  }
890
- this.data.pop();
891
- this.data.pop();
892
- if (this.data.length === this.sub_from)
892
+ this.data.length = end;
893
+ if (end === this.sub_from)
893
894
  this.reap();
894
895
  }
895
896
  reap() { }
@@ -1121,9 +1122,8 @@ var $;
1121
1122
  const sub = this.data[cursor];
1122
1123
  const pos = this.data[cursor + 1];
1123
1124
  sub.pub_off(pos);
1124
- this.data.pop();
1125
- this.data.pop();
1126
1125
  }
1126
+ this.data.length = this.sub_from;
1127
1127
  this.cursor = this.pub_from;
1128
1128
  this.track_cut();
1129
1129
  this.cursor = $mol_wire_cursor.final;
@@ -1132,23 +1132,15 @@ var $;
1132
1132
  if (this.cursor < this.pub_from) {
1133
1133
  $mol_fail(new Error('Cut of non begun sub'));
1134
1134
  }
1135
- let tail = 0;
1135
+ let end = this.data.length;
1136
1136
  for (let cursor = this.cursor; cursor < this.sub_from; cursor += 2) {
1137
1137
  const pub = this.data[cursor];
1138
1138
  pub?.sub_off(this.data[cursor + 1]);
1139
- if (this.sub_from < this.data.length) {
1140
- this.peer_move(this.data.length - 2, cursor);
1141
- this.data.pop();
1142
- this.data.pop();
1143
- }
1144
- else {
1145
- ++tail;
1146
- }
1147
- }
1148
- for (; tail; --tail) {
1149
- this.data.pop();
1150
- this.data.pop();
1139
+ end -= 2;
1140
+ if (this.sub_from <= end)
1141
+ this.peer_move(end, cursor);
1151
1142
  }
1143
+ this.data.length = end;
1152
1144
  this.sub_from = this.cursor;
1153
1145
  }
1154
1146
  complete() { }