mol_plot_all 1.2.1216 → 1.2.1218
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.d.ts +8 -6
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +49 -31
- package/node.js.map +1 -1
- package/node.mjs +49 -31
- package/node.test.js +73 -31
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +8 -6
- package/web.d.ts.map +1 -1
- package/web.deps.json +1 -1
- package/web.js +49 -31
- package/web.js.map +1 -1
- package/web.mjs +49 -31
- package/web.test.js +24 -0
- package/web.test.js.map +1 -1
package/web.js
CHANGED
|
@@ -638,7 +638,7 @@ var $;
|
|
|
638
638
|
"use strict";
|
|
639
639
|
var $;
|
|
640
640
|
(function ($) {
|
|
641
|
-
const
|
|
641
|
+
const wrappers = new WeakMap();
|
|
642
642
|
class $mol_wire_fiber extends $mol_wire_pub_sub {
|
|
643
643
|
task;
|
|
644
644
|
host;
|
|
@@ -773,14 +773,21 @@ var $;
|
|
|
773
773
|
result = this.task.call(this.host, ...this.args);
|
|
774
774
|
break;
|
|
775
775
|
}
|
|
776
|
-
if ($mol_promise_like(result)
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
776
|
+
if ($mol_promise_like(result)) {
|
|
777
|
+
if (wrappers.has(result)) {
|
|
778
|
+
result = wrappers.get(result).then(a => a);
|
|
779
|
+
}
|
|
780
|
+
else {
|
|
781
|
+
const put = (res) => {
|
|
782
|
+
if (this.cache === result)
|
|
783
|
+
this.put(res);
|
|
784
|
+
return res;
|
|
785
|
+
};
|
|
786
|
+
wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
|
|
787
|
+
wrappers.set(result, result);
|
|
788
|
+
const error = new Error(`Promise in ${this}`);
|
|
789
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
790
|
+
}
|
|
784
791
|
}
|
|
785
792
|
}
|
|
786
793
|
catch (error) {
|
|
@@ -790,22 +797,20 @@ var $;
|
|
|
790
797
|
else {
|
|
791
798
|
result = new Error(String(error), { cause: error });
|
|
792
799
|
}
|
|
793
|
-
if ($mol_promise_like(result)
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
800
|
+
if ($mol_promise_like(result)) {
|
|
801
|
+
if (wrappers.has(result)) {
|
|
802
|
+
result = wrappers.get(result);
|
|
803
|
+
}
|
|
804
|
+
else {
|
|
805
|
+
wrappers.set(result, result = Object.assign(result.finally(() => {
|
|
806
|
+
if (this.cache === result)
|
|
807
|
+
this.absorb();
|
|
808
|
+
}), { destructor: result.destructor || (() => { }) }));
|
|
809
|
+
const error = new Error(`Promise in ${this}`);
|
|
810
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
811
|
+
}
|
|
799
812
|
}
|
|
800
813
|
}
|
|
801
|
-
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
802
|
-
result = Object.assign(result, {
|
|
803
|
-
destructor: result['destructor'] ?? (() => { })
|
|
804
|
-
});
|
|
805
|
-
handled.add(result);
|
|
806
|
-
const error = new Error(`Promise in ${this}`);
|
|
807
|
-
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
808
|
-
}
|
|
809
814
|
if (!$mol_promise_like(result)) {
|
|
810
815
|
this.track_cut();
|
|
811
816
|
}
|
|
@@ -865,6 +870,12 @@ var $;
|
|
|
865
870
|
};
|
|
866
871
|
});
|
|
867
872
|
}
|
|
873
|
+
destructor() {
|
|
874
|
+
super.destructor();
|
|
875
|
+
if ($mol_owning_check(this, this.cache)) {
|
|
876
|
+
this.cache.destructor();
|
|
877
|
+
}
|
|
878
|
+
}
|
|
868
879
|
}
|
|
869
880
|
$.$mol_wire_fiber = $mol_wire_fiber;
|
|
870
881
|
})($ || ($ = {}));
|
|
@@ -889,6 +900,7 @@ var $;
|
|
|
889
900
|
var $;
|
|
890
901
|
(function ($) {
|
|
891
902
|
$.$mol_key_store = new WeakMap();
|
|
903
|
+
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
|
892
904
|
function $mol_key(value) {
|
|
893
905
|
if (typeof value === 'bigint')
|
|
894
906
|
return value.toString() + 'n';
|
|
@@ -918,7 +930,7 @@ var $;
|
|
|
918
930
|
return value;
|
|
919
931
|
if (value instanceof RegExp)
|
|
920
932
|
return value.toString();
|
|
921
|
-
if (value instanceof
|
|
933
|
+
if (value instanceof TypedArray)
|
|
922
934
|
return [...value];
|
|
923
935
|
let key = $.$mol_key_store.get(value);
|
|
924
936
|
if (key)
|
|
@@ -1194,7 +1206,8 @@ var $;
|
|
|
1194
1206
|
$$.$mol_log3_warn({
|
|
1195
1207
|
place: '$mol_wire_task',
|
|
1196
1208
|
message: `Non idempotency`,
|
|
1197
|
-
|
|
1209
|
+
sub,
|
|
1210
|
+
pubs: [...sub?.pub_list ?? [], existen],
|
|
1198
1211
|
next,
|
|
1199
1212
|
hint: 'Ignore it',
|
|
1200
1213
|
});
|
|
@@ -1217,6 +1230,14 @@ var $;
|
|
|
1217
1230
|
this.cursor = $mol_wire_cursor.fresh;
|
|
1218
1231
|
if (next !== prev)
|
|
1219
1232
|
this.emit();
|
|
1233
|
+
if ($mol_owning_catch(this, next)) {
|
|
1234
|
+
try {
|
|
1235
|
+
next[Symbol.toStringTag] = this[Symbol.toStringTag];
|
|
1236
|
+
}
|
|
1237
|
+
catch {
|
|
1238
|
+
Object.defineProperty(next, Symbol.toStringTag, { value: this[Symbol.toStringTag] });
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1220
1241
|
return next;
|
|
1221
1242
|
}
|
|
1222
1243
|
this.cursor = $mol_wire_cursor.final;
|
|
@@ -1371,10 +1392,6 @@ var $;
|
|
|
1371
1392
|
}
|
|
1372
1393
|
destructor() {
|
|
1373
1394
|
super.destructor();
|
|
1374
|
-
const prev = this.cache;
|
|
1375
|
-
if ($mol_owning_check(this, prev)) {
|
|
1376
|
-
prev.destructor();
|
|
1377
|
-
}
|
|
1378
1395
|
if (this.pub_from === 0) {
|
|
1379
1396
|
;
|
|
1380
1397
|
(this.host ?? this.task)[this.field()] = null;
|
|
@@ -1642,13 +1659,15 @@ var $;
|
|
|
1642
1659
|
class $mol_memo extends $mol_wrapper {
|
|
1643
1660
|
static wrap(task) {
|
|
1644
1661
|
const store = new WeakMap();
|
|
1645
|
-
|
|
1662
|
+
const fun = function (next) {
|
|
1646
1663
|
if (next === undefined && store.has(this))
|
|
1647
1664
|
return store.get(this);
|
|
1648
1665
|
const val = task.call(this, next) ?? next;
|
|
1649
1666
|
store.set(this, val);
|
|
1650
1667
|
return val;
|
|
1651
1668
|
};
|
|
1669
|
+
Reflect.defineProperty(fun, 'name', { value: task.name + ' ' });
|
|
1670
|
+
return fun;
|
|
1652
1671
|
}
|
|
1653
1672
|
}
|
|
1654
1673
|
$.$mol_memo = $mol_memo;
|
|
@@ -2482,7 +2501,6 @@ var $;
|
|
|
2482
2501
|
const win = this.$.$mol_dom_context;
|
|
2483
2502
|
if (win.parent !== win.self && !win.document.hasFocus())
|
|
2484
2503
|
return;
|
|
2485
|
-
this.focused(true);
|
|
2486
2504
|
}
|
|
2487
2505
|
destructor() {
|
|
2488
2506
|
const node = $mol_wire_probe(() => this.dom_node());
|