mol_jsx_lib 0.0.1070 → 0.0.1072
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 +1 -6
- package/node.d.ts.map +1 -1
- package/node.js.map +1 -1
- package/node.test.js +81 -6
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.d.ts +1 -6
- package/web.d.ts.map +1 -1
- package/web.js.map +1 -1
- package/web.test.js +81 -6
- package/web.test.js.map +1 -1
package/node.test.js
CHANGED
|
@@ -3700,7 +3700,7 @@ var $;
|
|
|
3700
3700
|
static last = [];
|
|
3701
3701
|
static send(next) {
|
|
3702
3702
|
$mol_wire_sync(this.first).push(next);
|
|
3703
|
-
|
|
3703
|
+
$$.$mol_wait_timeout(0);
|
|
3704
3704
|
this.last.push(next);
|
|
3705
3705
|
}
|
|
3706
3706
|
}
|
|
@@ -3709,15 +3709,15 @@ var $;
|
|
|
3709
3709
|
const promise = name('jin');
|
|
3710
3710
|
$.$mol_after_mock_warp();
|
|
3711
3711
|
await promise;
|
|
3712
|
-
$
|
|
3713
|
-
$
|
|
3712
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
3713
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
3714
3714
|
},
|
|
3715
3715
|
async 'Latest function calls wins'($) {
|
|
3716
3716
|
const first = [];
|
|
3717
3717
|
const last = [];
|
|
3718
3718
|
function send_name(next) {
|
|
3719
3719
|
$mol_wire_sync(first).push(next);
|
|
3720
|
-
|
|
3720
|
+
$$.$mol_wait_timeout(0);
|
|
3721
3721
|
last.push(next);
|
|
3722
3722
|
}
|
|
3723
3723
|
const name = $mol_wire_async(send_name);
|
|
@@ -3725,8 +3725,8 @@ var $;
|
|
|
3725
3725
|
const promise = name('jin');
|
|
3726
3726
|
$.$mol_after_mock_warp();
|
|
3727
3727
|
await promise;
|
|
3728
|
-
$
|
|
3729
|
-
$
|
|
3728
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
3729
|
+
$mol_assert_equal(last, ['jin']);
|
|
3730
3730
|
},
|
|
3731
3731
|
});
|
|
3732
3732
|
})($ || ($ = {}));
|
|
@@ -3793,6 +3793,81 @@ var $;
|
|
|
3793
3793
|
});
|
|
3794
3794
|
})($ || ($ = {}));
|
|
3795
3795
|
|
|
3796
|
+
;
|
|
3797
|
+
"use strict";
|
|
3798
|
+
var $;
|
|
3799
|
+
(function ($) {
|
|
3800
|
+
class $mol_after_work extends $mol_object2 {
|
|
3801
|
+
delay;
|
|
3802
|
+
task;
|
|
3803
|
+
id;
|
|
3804
|
+
constructor(delay, task) {
|
|
3805
|
+
super();
|
|
3806
|
+
this.delay = delay;
|
|
3807
|
+
this.task = task;
|
|
3808
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
3809
|
+
}
|
|
3810
|
+
destructor() {
|
|
3811
|
+
cancelIdleCallback(this.id);
|
|
3812
|
+
}
|
|
3813
|
+
}
|
|
3814
|
+
$.$mol_after_work = $mol_after_work;
|
|
3815
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
3816
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
3817
|
+
}
|
|
3818
|
+
})($ || ($ = {}));
|
|
3819
|
+
|
|
3820
|
+
;
|
|
3821
|
+
"use strict";
|
|
3822
|
+
var $;
|
|
3823
|
+
(function ($_1) {
|
|
3824
|
+
$mol_test_mocks.push($ => {
|
|
3825
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
3826
|
+
});
|
|
3827
|
+
})($ || ($ = {}));
|
|
3828
|
+
|
|
3829
|
+
;
|
|
3830
|
+
"use strict";
|
|
3831
|
+
var $;
|
|
3832
|
+
(function ($) {
|
|
3833
|
+
function $mol_wait_rest_async() {
|
|
3834
|
+
return new Promise(done => {
|
|
3835
|
+
new this.$mol_after_work(16, () => done(null));
|
|
3836
|
+
});
|
|
3837
|
+
}
|
|
3838
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
3839
|
+
function $mol_wait_rest() {
|
|
3840
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
3841
|
+
}
|
|
3842
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
3843
|
+
})($ || ($ = {}));
|
|
3844
|
+
|
|
3845
|
+
;
|
|
3846
|
+
"use strict";
|
|
3847
|
+
var $;
|
|
3848
|
+
(function ($_1) {
|
|
3849
|
+
var $$;
|
|
3850
|
+
(function ($$) {
|
|
3851
|
+
$mol_test_mocks.push($ => {
|
|
3852
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
3853
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
3854
|
+
});
|
|
3855
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
3856
|
+
})($ || ($ = {}));
|
|
3857
|
+
|
|
3858
|
+
;
|
|
3859
|
+
"use strict";
|
|
3860
|
+
var $;
|
|
3861
|
+
(function ($_1) {
|
|
3862
|
+
var $$;
|
|
3863
|
+
(function ($$) {
|
|
3864
|
+
$mol_test_mocks.push($ => {
|
|
3865
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
3866
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
3867
|
+
});
|
|
3868
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
3869
|
+
})($ || ($ = {}));
|
|
3870
|
+
|
|
3796
3871
|
;
|
|
3797
3872
|
"use strict";
|
|
3798
3873
|
var $;
|