mol_plot_all 1.2.250 → 1.2.253
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.deps.json +1 -1
- package/node.esm.js +4 -2
- package/node.esm.js.map +1 -1
- package/node.js +4 -2
- package/node.js.map +1 -1
- package/node.test.js +119 -110
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
- package/web.esm.js +4 -2
- package/web.esm.js.map +1 -1
- package/web.js +4 -2
- package/web.js.map +1 -1
- package/web.test.js +115 -108
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -2113,6 +2113,8 @@ var $;
|
|
|
2113
2113
|
var $;
|
|
2114
2114
|
(function ($) {
|
|
2115
2115
|
function $mol_wire_async(obj) {
|
|
2116
|
+
let fiber;
|
|
2117
|
+
const temp = $mol_wire_task.getter(obj);
|
|
2116
2118
|
return new Proxy(obj, {
|
|
2117
2119
|
get(obj, field) {
|
|
2118
2120
|
const val = obj[field];
|
|
@@ -2127,8 +2129,8 @@ var $;
|
|
|
2127
2129
|
};
|
|
2128
2130
|
},
|
|
2129
2131
|
apply(obj, self, args) {
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
+
fiber?.destructor();
|
|
2133
|
+
fiber = temp(self, args);
|
|
2132
2134
|
return fiber.async();
|
|
2133
2135
|
},
|
|
2134
2136
|
});
|
|
@@ -6599,114 +6601,6 @@ var $;
|
|
|
6599
6601
|
;
|
|
6600
6602
|
"use strict";
|
|
6601
6603
|
var $;
|
|
6602
|
-
(function ($) {
|
|
6603
|
-
function $mol_promise() {
|
|
6604
|
-
let done;
|
|
6605
|
-
let fail;
|
|
6606
|
-
const promise = new Promise((d, f) => {
|
|
6607
|
-
done = d;
|
|
6608
|
-
fail = f;
|
|
6609
|
-
});
|
|
6610
|
-
return Object.assign(promise, {
|
|
6611
|
-
done,
|
|
6612
|
-
fail,
|
|
6613
|
-
});
|
|
6614
|
-
}
|
|
6615
|
-
$.$mol_promise = $mol_promise;
|
|
6616
|
-
})($ || ($ = {}));
|
|
6617
|
-
//mol/promise/promise.ts
|
|
6618
|
-
;
|
|
6619
|
-
"use strict";
|
|
6620
|
-
var $;
|
|
6621
|
-
(function ($_1) {
|
|
6622
|
-
$mol_test_mocks.push($ => {
|
|
6623
|
-
$.$mol_after_timeout = $mol_after_mock_timeout;
|
|
6624
|
-
});
|
|
6625
|
-
})($ || ($ = {}));
|
|
6626
|
-
//mol/after/timeout/timeout.test.ts
|
|
6627
|
-
;
|
|
6628
|
-
"use strict";
|
|
6629
|
-
var $;
|
|
6630
|
-
(function ($) {
|
|
6631
|
-
function $mol_wire_sync(obj) {
|
|
6632
|
-
return new Proxy(obj, {
|
|
6633
|
-
get(obj, field) {
|
|
6634
|
-
const val = obj[field];
|
|
6635
|
-
if (typeof val !== 'function')
|
|
6636
|
-
return val;
|
|
6637
|
-
const temp = $mol_wire_task.getter(val);
|
|
6638
|
-
return function $mol_wire_sync(...args) {
|
|
6639
|
-
const fiber = temp(obj, args);
|
|
6640
|
-
return fiber.sync();
|
|
6641
|
-
};
|
|
6642
|
-
},
|
|
6643
|
-
apply(obj, self, args) {
|
|
6644
|
-
const temp = $mol_wire_task.getter(obj);
|
|
6645
|
-
const fiber = temp(self, args);
|
|
6646
|
-
return fiber.sync();
|
|
6647
|
-
},
|
|
6648
|
-
});
|
|
6649
|
-
}
|
|
6650
|
-
$.$mol_wire_sync = $mol_wire_sync;
|
|
6651
|
-
})($ || ($ = {}));
|
|
6652
|
-
//mol/wire/sync/sync.ts
|
|
6653
|
-
;
|
|
6654
|
-
"use strict";
|
|
6655
|
-
var $;
|
|
6656
|
-
(function ($) {
|
|
6657
|
-
function $mol_wait_timeout_async(timeout) {
|
|
6658
|
-
const promise = $mol_promise();
|
|
6659
|
-
const task = new this.$mol_after_timeout(timeout, () => promise.done());
|
|
6660
|
-
return Object.assign(promise, {
|
|
6661
|
-
destructor: () => task.destructor()
|
|
6662
|
-
});
|
|
6663
|
-
}
|
|
6664
|
-
$.$mol_wait_timeout_async = $mol_wait_timeout_async;
|
|
6665
|
-
function $mol_wait_timeout(timeout) {
|
|
6666
|
-
return this.$mol_wire_sync(this).$mol_wait_timeout_async(timeout);
|
|
6667
|
-
}
|
|
6668
|
-
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
6669
|
-
})($ || ($ = {}));
|
|
6670
|
-
//mol/wait/timeout/timeout.ts
|
|
6671
|
-
;
|
|
6672
|
-
"use strict";
|
|
6673
|
-
var $;
|
|
6674
|
-
(function ($_1) {
|
|
6675
|
-
$mol_test({
|
|
6676
|
-
async 'Latest Calls Wins on Concurrency'($) {
|
|
6677
|
-
class NameLogger extends $mol_object2 {
|
|
6678
|
-
static $ = $;
|
|
6679
|
-
static first = [];
|
|
6680
|
-
static last = [];
|
|
6681
|
-
static send(next) {
|
|
6682
|
-
$mol_wire_sync(this.first).push(next);
|
|
6683
|
-
this.$.$mol_wait_timeout(0);
|
|
6684
|
-
this.last.push(next);
|
|
6685
|
-
}
|
|
6686
|
-
}
|
|
6687
|
-
const name = $mol_wire_async(NameLogger).send;
|
|
6688
|
-
name('john');
|
|
6689
|
-
const promise = name('jin');
|
|
6690
|
-
$.$mol_after_mock_warp();
|
|
6691
|
-
await promise;
|
|
6692
|
-
$mol_assert_like(NameLogger.first, ['john', 'jin']);
|
|
6693
|
-
$mol_assert_like(NameLogger.last, ['jin']);
|
|
6694
|
-
},
|
|
6695
|
-
async 'Wrap function'($) {
|
|
6696
|
-
const name = $mol_wire_async(function (name) {
|
|
6697
|
-
$.$mol_wait_timeout(0);
|
|
6698
|
-
return name;
|
|
6699
|
-
});
|
|
6700
|
-
const promise = name('jin');
|
|
6701
|
-
$.$mol_after_mock_warp();
|
|
6702
|
-
$mol_assert_like(await promise, 'jin');
|
|
6703
|
-
},
|
|
6704
|
-
});
|
|
6705
|
-
})($ || ($ = {}));
|
|
6706
|
-
//mol/wire/async/async.test.ts
|
|
6707
|
-
;
|
|
6708
|
-
"use strict";
|
|
6709
|
-
var $;
|
|
6710
6604
|
(function ($_1) {
|
|
6711
6605
|
$mol_test({
|
|
6712
6606
|
'Collect deps'() {
|
|
@@ -6765,6 +6659,15 @@ var $;
|
|
|
6765
6659
|
;
|
|
6766
6660
|
"use strict";
|
|
6767
6661
|
var $;
|
|
6662
|
+
(function ($_1) {
|
|
6663
|
+
$mol_test_mocks.push($ => {
|
|
6664
|
+
$.$mol_after_timeout = $mol_after_mock_timeout;
|
|
6665
|
+
});
|
|
6666
|
+
})($ || ($ = {}));
|
|
6667
|
+
//mol/after/timeout/timeout.test.ts
|
|
6668
|
+
;
|
|
6669
|
+
"use strict";
|
|
6670
|
+
var $;
|
|
6768
6671
|
(function ($_1) {
|
|
6769
6672
|
$mol_test_mocks.push($ => {
|
|
6770
6673
|
$.$mol_after_frame = $mol_after_mock_commmon;
|
|
@@ -6856,6 +6759,112 @@ var $;
|
|
|
6856
6759
|
;
|
|
6857
6760
|
"use strict";
|
|
6858
6761
|
var $;
|
|
6762
|
+
(function ($) {
|
|
6763
|
+
function $mol_wire_sync(obj) {
|
|
6764
|
+
return new Proxy(obj, {
|
|
6765
|
+
get(obj, field) {
|
|
6766
|
+
const val = obj[field];
|
|
6767
|
+
if (typeof val !== 'function')
|
|
6768
|
+
return val;
|
|
6769
|
+
const temp = $mol_wire_task.getter(val);
|
|
6770
|
+
return function $mol_wire_sync(...args) {
|
|
6771
|
+
const fiber = temp(obj, args);
|
|
6772
|
+
return fiber.sync();
|
|
6773
|
+
};
|
|
6774
|
+
},
|
|
6775
|
+
apply(obj, self, args) {
|
|
6776
|
+
const temp = $mol_wire_task.getter(obj);
|
|
6777
|
+
const fiber = temp(self, args);
|
|
6778
|
+
return fiber.sync();
|
|
6779
|
+
},
|
|
6780
|
+
});
|
|
6781
|
+
}
|
|
6782
|
+
$.$mol_wire_sync = $mol_wire_sync;
|
|
6783
|
+
})($ || ($ = {}));
|
|
6784
|
+
//mol/wire/sync/sync.ts
|
|
6785
|
+
;
|
|
6786
|
+
"use strict";
|
|
6787
|
+
var $;
|
|
6788
|
+
(function ($) {
|
|
6789
|
+
function $mol_promise() {
|
|
6790
|
+
let done;
|
|
6791
|
+
let fail;
|
|
6792
|
+
const promise = new Promise((d, f) => {
|
|
6793
|
+
done = d;
|
|
6794
|
+
fail = f;
|
|
6795
|
+
});
|
|
6796
|
+
return Object.assign(promise, {
|
|
6797
|
+
done,
|
|
6798
|
+
fail,
|
|
6799
|
+
});
|
|
6800
|
+
}
|
|
6801
|
+
$.$mol_promise = $mol_promise;
|
|
6802
|
+
})($ || ($ = {}));
|
|
6803
|
+
//mol/promise/promise.ts
|
|
6804
|
+
;
|
|
6805
|
+
"use strict";
|
|
6806
|
+
var $;
|
|
6807
|
+
(function ($) {
|
|
6808
|
+
function $mol_wait_timeout_async(timeout) {
|
|
6809
|
+
const promise = $mol_promise();
|
|
6810
|
+
const task = new this.$mol_after_timeout(timeout, () => promise.done());
|
|
6811
|
+
return Object.assign(promise, {
|
|
6812
|
+
destructor: () => task.destructor()
|
|
6813
|
+
});
|
|
6814
|
+
}
|
|
6815
|
+
$.$mol_wait_timeout_async = $mol_wait_timeout_async;
|
|
6816
|
+
function $mol_wait_timeout(timeout) {
|
|
6817
|
+
return this.$mol_wire_sync(this).$mol_wait_timeout_async(timeout);
|
|
6818
|
+
}
|
|
6819
|
+
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
6820
|
+
})($ || ($ = {}));
|
|
6821
|
+
//mol/wait/timeout/timeout.ts
|
|
6822
|
+
;
|
|
6823
|
+
"use strict";
|
|
6824
|
+
var $;
|
|
6825
|
+
(function ($_1) {
|
|
6826
|
+
$mol_test({
|
|
6827
|
+
async 'Latest method calls wins'($) {
|
|
6828
|
+
class NameLogger extends $mol_object2 {
|
|
6829
|
+
static $ = $;
|
|
6830
|
+
static first = [];
|
|
6831
|
+
static last = [];
|
|
6832
|
+
static send(next) {
|
|
6833
|
+
$mol_wire_sync(this.first).push(next);
|
|
6834
|
+
this.$.$mol_wait_timeout(0);
|
|
6835
|
+
this.last.push(next);
|
|
6836
|
+
}
|
|
6837
|
+
}
|
|
6838
|
+
const name = $mol_wire_async(NameLogger).send;
|
|
6839
|
+
name('john');
|
|
6840
|
+
const promise = name('jin');
|
|
6841
|
+
$.$mol_after_mock_warp();
|
|
6842
|
+
await promise;
|
|
6843
|
+
$mol_assert_like(NameLogger.first, ['john', 'jin']);
|
|
6844
|
+
$mol_assert_like(NameLogger.last, ['jin']);
|
|
6845
|
+
},
|
|
6846
|
+
async 'Latest function calls wins'($) {
|
|
6847
|
+
const first = [];
|
|
6848
|
+
const last = [];
|
|
6849
|
+
function send_name(next) {
|
|
6850
|
+
$mol_wire_sync(first).push(next);
|
|
6851
|
+
$.$mol_wait_timeout(0);
|
|
6852
|
+
last.push(next);
|
|
6853
|
+
}
|
|
6854
|
+
const name = $mol_wire_async(send_name);
|
|
6855
|
+
name('john');
|
|
6856
|
+
const promise = name('jin');
|
|
6857
|
+
$.$mol_after_mock_warp();
|
|
6858
|
+
await promise;
|
|
6859
|
+
$mol_assert_like(first, ['john', 'jin']);
|
|
6860
|
+
$mol_assert_like(last, ['jin']);
|
|
6861
|
+
},
|
|
6862
|
+
});
|
|
6863
|
+
})($ || ($ = {}));
|
|
6864
|
+
//mol/wire/async/async.test.ts
|
|
6865
|
+
;
|
|
6866
|
+
"use strict";
|
|
6867
|
+
var $;
|
|
6859
6868
|
(function ($_1) {
|
|
6860
6869
|
$mol_test({
|
|
6861
6870
|
'Cached channel'($) {
|