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/web.test.js
CHANGED
|
@@ -1178,7 +1178,7 @@ var $;
|
|
|
1178
1178
|
static last = [];
|
|
1179
1179
|
static send(next) {
|
|
1180
1180
|
$mol_wire_sync(this.first).push(next);
|
|
1181
|
-
|
|
1181
|
+
$$.$mol_wait_timeout(0);
|
|
1182
1182
|
this.last.push(next);
|
|
1183
1183
|
}
|
|
1184
1184
|
}
|
|
@@ -1187,15 +1187,15 @@ var $;
|
|
|
1187
1187
|
const promise = name('jin');
|
|
1188
1188
|
$.$mol_after_mock_warp();
|
|
1189
1189
|
await promise;
|
|
1190
|
-
$
|
|
1191
|
-
$
|
|
1190
|
+
$mol_assert_equal(NameLogger.first, ['john', 'jin']);
|
|
1191
|
+
$mol_assert_equal(NameLogger.last, ['jin']);
|
|
1192
1192
|
},
|
|
1193
1193
|
async 'Latest function calls wins'($) {
|
|
1194
1194
|
const first = [];
|
|
1195
1195
|
const last = [];
|
|
1196
1196
|
function send_name(next) {
|
|
1197
1197
|
$mol_wire_sync(first).push(next);
|
|
1198
|
-
|
|
1198
|
+
$$.$mol_wait_timeout(0);
|
|
1199
1199
|
last.push(next);
|
|
1200
1200
|
}
|
|
1201
1201
|
const name = $mol_wire_async(send_name);
|
|
@@ -1203,8 +1203,8 @@ var $;
|
|
|
1203
1203
|
const promise = name('jin');
|
|
1204
1204
|
$.$mol_after_mock_warp();
|
|
1205
1205
|
await promise;
|
|
1206
|
-
$
|
|
1207
|
-
$
|
|
1206
|
+
$mol_assert_equal(first, ['john', 'jin']);
|
|
1207
|
+
$mol_assert_equal(last, ['jin']);
|
|
1208
1208
|
},
|
|
1209
1209
|
});
|
|
1210
1210
|
})($ || ($ = {}));
|
|
@@ -1262,6 +1262,81 @@ var $;
|
|
|
1262
1262
|
});
|
|
1263
1263
|
})($ || ($ = {}));
|
|
1264
1264
|
|
|
1265
|
+
;
|
|
1266
|
+
"use strict";
|
|
1267
|
+
var $;
|
|
1268
|
+
(function ($) {
|
|
1269
|
+
class $mol_after_work extends $mol_object2 {
|
|
1270
|
+
delay;
|
|
1271
|
+
task;
|
|
1272
|
+
id;
|
|
1273
|
+
constructor(delay, task) {
|
|
1274
|
+
super();
|
|
1275
|
+
this.delay = delay;
|
|
1276
|
+
this.task = task;
|
|
1277
|
+
this.id = requestIdleCallback(task, { timeout: delay });
|
|
1278
|
+
}
|
|
1279
|
+
destructor() {
|
|
1280
|
+
cancelIdleCallback(this.id);
|
|
1281
|
+
}
|
|
1282
|
+
}
|
|
1283
|
+
$.$mol_after_work = $mol_after_work;
|
|
1284
|
+
if (typeof requestIdleCallback !== 'function') {
|
|
1285
|
+
$.$mol_after_work = $mol_after_timeout;
|
|
1286
|
+
}
|
|
1287
|
+
})($ || ($ = {}));
|
|
1288
|
+
|
|
1289
|
+
;
|
|
1290
|
+
"use strict";
|
|
1291
|
+
var $;
|
|
1292
|
+
(function ($_1) {
|
|
1293
|
+
$mol_test_mocks.push($ => {
|
|
1294
|
+
$.$mol_after_work = $mol_after_mock_timeout;
|
|
1295
|
+
});
|
|
1296
|
+
})($ || ($ = {}));
|
|
1297
|
+
|
|
1298
|
+
;
|
|
1299
|
+
"use strict";
|
|
1300
|
+
var $;
|
|
1301
|
+
(function ($) {
|
|
1302
|
+
function $mol_wait_rest_async() {
|
|
1303
|
+
return new Promise(done => {
|
|
1304
|
+
new this.$mol_after_work(16, () => done(null));
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
$.$mol_wait_rest_async = $mol_wait_rest_async;
|
|
1308
|
+
function $mol_wait_rest() {
|
|
1309
|
+
return this.$mol_wire_sync(this).$mol_wait_rest_async();
|
|
1310
|
+
}
|
|
1311
|
+
$.$mol_wait_rest = $mol_wait_rest;
|
|
1312
|
+
})($ || ($ = {}));
|
|
1313
|
+
|
|
1314
|
+
;
|
|
1315
|
+
"use strict";
|
|
1316
|
+
var $;
|
|
1317
|
+
(function ($_1) {
|
|
1318
|
+
var $$;
|
|
1319
|
+
(function ($$) {
|
|
1320
|
+
$mol_test_mocks.push($ => {
|
|
1321
|
+
$.$mol_wait_timeout = function $mol_wait_timeout_mock(timeout) { };
|
|
1322
|
+
$.$mol_wait_timeout_async = async function $mol_wait_timeout_async_mock(timeout) { };
|
|
1323
|
+
});
|
|
1324
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
1325
|
+
})($ || ($ = {}));
|
|
1326
|
+
|
|
1327
|
+
;
|
|
1328
|
+
"use strict";
|
|
1329
|
+
var $;
|
|
1330
|
+
(function ($_1) {
|
|
1331
|
+
var $$;
|
|
1332
|
+
(function ($$) {
|
|
1333
|
+
$mol_test_mocks.push($ => {
|
|
1334
|
+
$.$mol_wait_rest = function $mol_wait_rest_mock() { };
|
|
1335
|
+
$.$mol_wait_rest_async = async function $mol_wait_rest_async_mock() { };
|
|
1336
|
+
});
|
|
1337
|
+
})($$ = $_1.$$ || ($_1.$$ = {}));
|
|
1338
|
+
})($ || ($ = {}));
|
|
1339
|
+
|
|
1265
1340
|
;
|
|
1266
1341
|
"use strict";
|
|
1267
1342
|
var $;
|