mol_regexp 0.0.1331 → 0.0.1333
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
|
@@ -1834,7 +1834,7 @@ var $;
|
|
|
1834
1834
|
static last = [];
|
|
1835
1835
|
static send(next) {
|
|
1836
1836
|
$mol_wire_sync(this.first).push(next);
|
|
1837
|
-
|
|
1837
|
+
$$.$mol_wait_timeout(0);
|
|
1838
1838
|
this.last.push(next);
|
|
1839
1839
|
}
|
|
1840
1840
|
}
|
|
@@ -1843,15 +1843,15 @@ var $;
|
|
|
1843
1843
|
const promise = name('jin');
|
|
1844
1844
|
$.$mol_after_mock_warp();
|
|
1845
1845
|
await promise;
|
|
1846
|
-
$
|
|
1847
|
-
$
|
|
1846
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
1847
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
1848
1848
|
},
|
|
1849
1849
|
async 'Latest function calls wins'($) {
|
|
1850
1850
|
const first = [];
|
|
1851
1851
|
const last = [];
|
|
1852
1852
|
function send_name(next) {
|
|
1853
1853
|
$mol_wire_sync(first).push(next);
|
|
1854
|
-
|
|
1854
|
+
$$.$mol_wait_timeout(0);
|
|
1855
1855
|
last.push(next);
|
|
1856
1856
|
}
|
|
1857
1857
|
const name = $mol_wire_async(send_name);
|
|
@@ -1859,8 +1859,8 @@ var $;
|
|
|
1859
1859
|
const promise = name('jin');
|
|
1860
1860
|
$.$mol_after_mock_warp();
|
|
1861
1861
|
await promise;
|
|
1862
|
-
$
|
|
1863
|
-
$
|
|
1862
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
1863
|
+
$mol_assert_equal(last, ['jin']);
|
|
1864
1864
|
},
|
|
1865
1865
|
});
|
|
1866
1866
|
})($ || ($ = {}));
|
|
@@ -2005,6 +2005,68 @@ var $;
|
|
|
2005
2005
|
});
|
|
2006
2006
|
})($ || ($ = {}));
|
|
2007
2007
|
|
|
2008
|
+
;
|
|
2009
|
+
"use strict";
|
|
2010
|
+
var $;
|
|
2011
|
+
(function ($) {
|
|
2012
|
+
class $mol_after_work extends $mol_object2 {
|
|
2013
|
+
delay;
|
|
2014
|
+
task;
|
|
2015
|
+
id;
|
|
2016
|
+
constructor(delay, task) {
|
|
2017
|
+
super();
|
|
2018
|
+
this.delay = delay;
|
|
2019
|
+
this.task = task;
|
|
2020
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
2021
|
+
}
|
|
2022
|
+
destructor() {
|
|
2023
|
+
cancelIdleCallback(this.id);
|
|
2024
|
+
}
|
|
2025
|
+
}
|
|
2026
|
+
$.$mol_after_work = $mol_after_work;
|
|
2027
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
2028
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
2029
|
+
}
|
|
2030
|
+
})($ || ($ = {}));
|
|
2031
|
+
|
|
2032
|
+
;
|
|
2033
|
+
"use strict";
|
|
2034
|
+
var $;
|
|
2035
|
+
(function ($_1) {
|
|
2036
|
+
$mol_test_mocks.push($ => {
|
|
2037
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
2038
|
+
});
|
|
2039
|
+
})($ || ($ = {}));
|
|
2040
|
+
|
|
2041
|
+
;
|
|
2042
|
+
"use strict";
|
|
2043
|
+
var $;
|
|
2044
|
+
(function ($) {
|
|
2045
|
+
function $mol_wait_rest_async() {
|
|
2046
|
+
return new Promise(done => {
|
|
2047
|
+
new this.$mol_after_work(16, () => done(null));
|
|
2048
|
+
});
|
|
2049
|
+
}
|
|
2050
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
2051
|
+
function $mol_wait_rest() {
|
|
2052
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
2053
|
+
}
|
|
2054
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
2055
|
+
})($ || ($ = {}));
|
|
2056
|
+
|
|
2057
|
+
;
|
|
2058
|
+
"use strict";
|
|
2059
|
+
var $;
|
|
2060
|
+
(function ($_1) {
|
|
2061
|
+
var $$;
|
|
2062
|
+
(function ($$) {
|
|
2063
|
+
$mol_test_mocks.push($ => {
|
|
2064
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
2065
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
2066
|
+
});
|
|
2067
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2068
|
+
})($ || ($ = {}));
|
|
2069
|
+
|
|
2008
2070
|
;
|
|
2009
2071
|
"use strict";
|
|
2010
2072
|
var $;
|
|
@@ -2023,6 +2085,19 @@ var $;
|
|
|
2023
2085
|
$.$mol_wait_timeout = $mol_wait_timeout;
|
|
2024
2086
|
})($ || ($ = {}));
|
|
2025
2087
|
|
|
2088
|
+
;
|
|
2089
|
+
"use strict";
|
|
2090
|
+
var $;
|
|
2091
|
+
(function ($_1) {
|
|
2092
|
+
var $$;
|
|
2093
|
+
(function ($$) {
|
|
2094
|
+
$mol_test_mocks.push($ => {
|
|
2095
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
2096
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
2097
|
+
});
|
|
2098
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
2099
|
+
})($ || ($ = {}));
|
|
2100
|
+
|
|
2026
2101
|
;
|
|
2027
2102
|
"use strict";
|
|
2028
2103
|
var $;
|