mol_mutable 0.0.711 → 0.0.712
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/node.test.js
CHANGED
|
@@ -1569,7 +1569,7 @@ var $;
|
|
|
1569
1569
|
static last = [];
|
|
1570
1570
|
static send(next) {
|
|
1571
1571
|
$mol_wire_sync(this.first).push(next);
|
|
1572
|
-
|
|
1572
|
+
$$.$mol_wait_timeout(0);
|
|
1573
1573
|
this.last.push(next);
|
|
1574
1574
|
}
|
|
1575
1575
|
}
|
|
@@ -1578,15 +1578,15 @@ var $;
|
|
|
1578
1578
|
const promise = name('jin');
|
|
1579
1579
|
$.$mol_after_mock_warp();
|
|
1580
1580
|
await promise;
|
|
1581
|
-
$
|
|
1582
|
-
$
|
|
1581
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
1582
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
1583
1583
|
},
|
|
1584
1584
|
async 'Latest function calls wins'($) {
|
|
1585
1585
|
const first = [];
|
|
1586
1586
|
const last = [];
|
|
1587
1587
|
function send_name(next) {
|
|
1588
1588
|
$mol_wire_sync(first).push(next);
|
|
1589
|
-
|
|
1589
|
+
$$.$mol_wait_timeout(0);
|
|
1590
1590
|
last.push(next);
|
|
1591
1591
|
}
|
|
1592
1592
|
const name = $mol_wire_async(send_name);
|
|
@@ -1594,8 +1594,8 @@ var $;
|
|
|
1594
1594
|
const promise = name('jin');
|
|
1595
1595
|
$.$mol_after_mock_warp();
|
|
1596
1596
|
await promise;
|
|
1597
|
-
$
|
|
1598
|
-
$
|
|
1597
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
1598
|
+
$mol_assert_equal(last, ['jin']);
|
|
1599
1599
|
},
|
|
1600
1600
|
});
|
|
1601
1601
|
})($ || ($ = {}));
|
|
@@ -1740,6 +1740,68 @@ var $;
|
|
|
1740
1740
|
});
|
|
1741
1741
|
})($ || ($ = {}));
|
|
1742
1742
|
|
|
1743
|
+
;
|
|
1744
|
+
"use strict";
|
|
1745
|
+
var $;
|
|
1746
|
+
(function ($) {
|
|
1747
|
+
class $mol_after_work extends $mol_object2 {
|
|
1748
|
+
delay;
|
|
1749
|
+
task;
|
|
1750
|
+
id;
|
|
1751
|
+
constructor(delay, task) {
|
|
1752
|
+
super();
|
|
1753
|
+
this.delay = delay;
|
|
1754
|
+
this.task = task;
|
|
1755
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
1756
|
+
}
|
|
1757
|
+
destructor() {
|
|
1758
|
+
cancelIdleCallback(this.id);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
$.$mol_after_work = $mol_after_work;
|
|
1762
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
1763
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
1764
|
+
}
|
|
1765
|
+
})($ || ($ = {}));
|
|
1766
|
+
|
|
1767
|
+
;
|
|
1768
|
+
"use strict";
|
|
1769
|
+
var $;
|
|
1770
|
+
(function ($_1) {
|
|
1771
|
+
$mol_test_mocks.push($ => {
|
|
1772
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
1773
|
+
});
|
|
1774
|
+
})($ || ($ = {}));
|
|
1775
|
+
|
|
1776
|
+
;
|
|
1777
|
+
"use strict";
|
|
1778
|
+
var $;
|
|
1779
|
+
(function ($) {
|
|
1780
|
+
function $mol_wait_rest_async() {
|
|
1781
|
+
return new Promise(done => {
|
|
1782
|
+
new this.$mol_after_work(16, () => done(null));
|
|
1783
|
+
});
|
|
1784
|
+
}
|
|
1785
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
1786
|
+
function $mol_wait_rest() {
|
|
1787
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
1788
|
+
}
|
|
1789
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
1790
|
+
})($ || ($ = {}));
|
|
1791
|
+
|
|
1792
|
+
;
|
|
1793
|
+
"use strict";
|
|
1794
|
+
var $;
|
|
1795
|
+
(function ($_1) {
|
|
1796
|
+
var $$;
|
|
1797
|
+
(function ($$) {
|
|
1798
|
+
$mol_test_mocks.push($ => {
|
|
1799
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
1800
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
1801
|
+
});
|
|
1802
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
1803
|
+
})($ || ($ = {}));
|
|
1804
|
+
|
|
1743
1805
|
;
|
|
1744
1806
|
"use strict";
|
|
1745
1807
|
var $;
|
|
@@ -1758,6 +1820,19 @@ var $;
|
|
|
1758
1820
|
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
1759
1821
|
})($ || ($ = {}));
|
|
1760
1822
|
|
|
1823
|
+
;
|
|
1824
|
+
"use strict";
|
|
1825
|
+
var $;
|
|
1826
|
+
(function ($_1) {
|
|
1827
|
+
var $$;
|
|
1828
|
+
(function ($$) {
|
|
1829
|
+
$mol_test_mocks.push($ => {
|
|
1830
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
1831
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
1832
|
+
});
|
|
1833
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
1834
|
+
})($ || ($ = {}));
|
|
1835
|
+
|
|
1761
1836
|
;
|
|
1762
1837
|
"use strict";
|
|
1763
1838
|
var $;
|