mol_tree2 1.0.881 → 1.0.882
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 +81 -6
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.test.js +81 -6
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -4615,6 +4615,68 @@ var $;
|
|
|
4615
4615
|
});
|
|
4616
4616
|
})($ || ($ = {}));
|
|
4617
4617
|
|
|
4618
|
+
;
|
|
4619
|
+
"use strict";
|
|
4620
|
+
var $;
|
|
4621
|
+
(function ($) {
|
|
4622
|
+
class $mol_after_work extends $mol_object2 {
|
|
4623
|
+
delay;
|
|
4624
|
+
task;
|
|
4625
|
+
id;
|
|
4626
|
+
constructor(delay, task) {
|
|
4627
|
+
super();
|
|
4628
|
+
this.delay = delay;
|
|
4629
|
+
this.task = task;
|
|
4630
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
4631
|
+
}
|
|
4632
|
+
destructor() {
|
|
4633
|
+
cancelIdleCallback(this.id);
|
|
4634
|
+
}
|
|
4635
|
+
}
|
|
4636
|
+
$.$mol_after_work = $mol_after_work;
|
|
4637
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
4638
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
4639
|
+
}
|
|
4640
|
+
})($ || ($ = {}));
|
|
4641
|
+
|
|
4642
|
+
;
|
|
4643
|
+
"use strict";
|
|
4644
|
+
var $;
|
|
4645
|
+
(function ($_1) {
|
|
4646
|
+
$mol_test_mocks.push($ => {
|
|
4647
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
4648
|
+
});
|
|
4649
|
+
})($ || ($ = {}));
|
|
4650
|
+
|
|
4651
|
+
;
|
|
4652
|
+
"use strict";
|
|
4653
|
+
var $;
|
|
4654
|
+
(function ($) {
|
|
4655
|
+
function $mol_wait_rest_async() {
|
|
4656
|
+
return new Promise(done => {
|
|
4657
|
+
new this.$mol_after_work(16, () => done(null));
|
|
4658
|
+
});
|
|
4659
|
+
}
|
|
4660
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
4661
|
+
function $mol_wait_rest() {
|
|
4662
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
4663
|
+
}
|
|
4664
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
4665
|
+
})($ || ($ = {}));
|
|
4666
|
+
|
|
4667
|
+
;
|
|
4668
|
+
"use strict";
|
|
4669
|
+
var $;
|
|
4670
|
+
(function ($_1) {
|
|
4671
|
+
var $$;
|
|
4672
|
+
(function ($$) {
|
|
4673
|
+
$mol_test_mocks.push($ => {
|
|
4674
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
4675
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
4676
|
+
});
|
|
4677
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
4678
|
+
})($ || ($ = {}));
|
|
4679
|
+
|
|
4618
4680
|
;
|
|
4619
4681
|
"use strict";
|
|
4620
4682
|
var $;
|
|
@@ -4633,6 +4695,19 @@ var $;
|
|
|
4633
4695
|
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
4634
4696
|
})($ || ($ = {}));
|
|
4635
4697
|
|
|
4698
|
+
;
|
|
4699
|
+
"use strict";
|
|
4700
|
+
var $;
|
|
4701
|
+
(function ($_1) {
|
|
4702
|
+
var $$;
|
|
4703
|
+
(function ($$) {
|
|
4704
|
+
$mol_test_mocks.push($ => {
|
|
4705
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
4706
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
4707
|
+
});
|
|
4708
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
4709
|
+
})($ || ($ = {}));
|
|
4710
|
+
|
|
4636
4711
|
;
|
|
4637
4712
|
"use strict";
|
|
4638
4713
|
var $;
|
|
@@ -4711,7 +4786,7 @@ var $;
|
|
|
4711
4786
|
static last = [];
|
|
4712
4787
|
static send(next) {
|
|
4713
4788
|
$mol_wire_sync(this.first).push(next);
|
|
4714
|
-
|
|
4789
|
+
$$.$mol_wait_timeout(0);
|
|
4715
4790
|
this.last.push(next);
|
|
4716
4791
|
}
|
|
4717
4792
|
}
|
|
@@ -4720,15 +4795,15 @@ var $;
|
|
|
4720
4795
|
const promise = name('jin');
|
|
4721
4796
|
$.$mol_after_mock_warp();
|
|
4722
4797
|
await promise;
|
|
4723
|
-
$
|
|
4724
|
-
$
|
|
4798
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
4799
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
4725
4800
|
},
|
|
4726
4801
|
async 'Latest function calls wins'($) {
|
|
4727
4802
|
const first = [];
|
|
4728
4803
|
const last = [];
|
|
4729
4804
|
function send_name(next) {
|
|
4730
4805
|
$mol_wire_sync(first).push(next);
|
|
4731
|
-
|
|
4806
|
+
$$.$mol_wait_timeout(0);
|
|
4732
4807
|
last.push(next);
|
|
4733
4808
|
}
|
|
4734
4809
|
const name = $mol_wire_async(send_name);
|
|
@@ -4736,8 +4811,8 @@ var $;
|
|
|
4736
4811
|
const promise = name('jin');
|
|
4737
4812
|
$.$mol_after_mock_warp();
|
|
4738
4813
|
await promise;
|
|
4739
|
-
$
|
|
4740
|
-
$
|
|
4814
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
4815
|
+
$mol_assert_equal(last, ['jin']);
|
|
4741
4816
|
},
|
|
4742
4817
|
});
|
|
4743
4818
|
})($ || ($ = {}));
|