mol_jsx_lib 0.0.1096 → 0.0.1097
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.deps.json +1 -1
- package/node.js +27 -16
- package/node.js.map +1 -1
- package/node.mjs +27 -16
- package/node.test.js +27 -16
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.deps.json +1 -1
- package/web.js +27 -16
- package/web.js.map +1 -1
- package/web.mjs +27 -16
package/node.mjs
CHANGED
|
@@ -1412,15 +1412,20 @@ var $;
|
|
|
1412
1412
|
break;
|
|
1413
1413
|
}
|
|
1414
1414
|
if ($mol_promise_like(result)) {
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1415
|
+
if (wrappers.has(result)) {
|
|
1416
|
+
result = wrappers.get(result).then(a => a);
|
|
1417
|
+
}
|
|
1418
|
+
else {
|
|
1419
|
+
const put = (res) => {
|
|
1420
|
+
if (this.cache === result)
|
|
1421
|
+
this.put(res);
|
|
1422
|
+
return res;
|
|
1423
|
+
};
|
|
1424
|
+
wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
|
|
1425
|
+
wrappers.set(result, result);
|
|
1426
|
+
const error = new Error(`Promise in ${this}`);
|
|
1427
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
1428
|
+
}
|
|
1424
1429
|
}
|
|
1425
1430
|
}
|
|
1426
1431
|
catch (error) {
|
|
@@ -1431,12 +1436,17 @@ var $;
|
|
|
1431
1436
|
result = new Error(String(error), { cause: error });
|
|
1432
1437
|
}
|
|
1433
1438
|
if ($mol_promise_like(result)) {
|
|
1434
|
-
wrappers.
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1439
|
+
if (wrappers.has(result)) {
|
|
1440
|
+
result = wrappers.get(result);
|
|
1441
|
+
}
|
|
1442
|
+
else {
|
|
1443
|
+
wrappers.set(result, result = Object.assign(result.finally(() => {
|
|
1444
|
+
if (this.cache === result)
|
|
1445
|
+
this.absorb();
|
|
1446
|
+
}), { destructor: result.destructor || (() => { }) }));
|
|
1447
|
+
const error = new Error(`Promise in ${this}`);
|
|
1448
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
1449
|
+
}
|
|
1440
1450
|
}
|
|
1441
1451
|
}
|
|
1442
1452
|
if (!$mol_promise_like(result)) {
|
|
@@ -2091,6 +2101,7 @@ var $;
|
|
|
2091
2101
|
var $;
|
|
2092
2102
|
(function ($) {
|
|
2093
2103
|
$.$mol_key_store = new WeakMap();
|
|
2104
|
+
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
|
2094
2105
|
function $mol_key(value) {
|
|
2095
2106
|
if (typeof value === 'bigint')
|
|
2096
2107
|
return value.toString() + 'n';
|
|
@@ -2120,7 +2131,7 @@ var $;
|
|
|
2120
2131
|
return value;
|
|
2121
2132
|
if (value instanceof RegExp)
|
|
2122
2133
|
return value.toString();
|
|
2123
|
-
if (value instanceof
|
|
2134
|
+
if (value instanceof TypedArray)
|
|
2124
2135
|
return [...value];
|
|
2125
2136
|
let key = $.$mol_key_store.get(value);
|
|
2126
2137
|
if (key)
|
package/node.test.js
CHANGED
|
@@ -1403,15 +1403,20 @@ var $;
|
|
|
1403
1403
|
break;
|
|
1404
1404
|
}
|
|
1405
1405
|
if ($mol_promise_like(result)) {
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1406
|
+
if (wrappers.has(result)) {
|
|
1407
|
+
result = wrappers.get(result).then(a => a);
|
|
1408
|
+
}
|
|
1409
|
+
else {
|
|
1410
|
+
const put = (res) => {
|
|
1411
|
+
if (this.cache === result)
|
|
1412
|
+
this.put(res);
|
|
1413
|
+
return res;
|
|
1414
|
+
};
|
|
1415
|
+
wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
|
|
1416
|
+
wrappers.set(result, result);
|
|
1417
|
+
const error = new Error(`Promise in ${this}`);
|
|
1418
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
1419
|
+
}
|
|
1415
1420
|
}
|
|
1416
1421
|
}
|
|
1417
1422
|
catch (error) {
|
|
@@ -1422,12 +1427,17 @@ var $;
|
|
|
1422
1427
|
result = new Error(String(error), { cause: error });
|
|
1423
1428
|
}
|
|
1424
1429
|
if ($mol_promise_like(result)) {
|
|
1425
|
-
wrappers.
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1430
|
+
if (wrappers.has(result)) {
|
|
1431
|
+
result = wrappers.get(result);
|
|
1432
|
+
}
|
|
1433
|
+
else {
|
|
1434
|
+
wrappers.set(result, result = Object.assign(result.finally(() => {
|
|
1435
|
+
if (this.cache === result)
|
|
1436
|
+
this.absorb();
|
|
1437
|
+
}), { destructor: result.destructor || (() => { }) }));
|
|
1438
|
+
const error = new Error(`Promise in ${this}`);
|
|
1439
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
1440
|
+
}
|
|
1431
1441
|
}
|
|
1432
1442
|
}
|
|
1433
1443
|
if (!$mol_promise_like(result)) {
|
|
@@ -2082,6 +2092,7 @@ var $;
|
|
|
2082
2092
|
var $;
|
|
2083
2093
|
(function ($) {
|
|
2084
2094
|
$.$mol_key_store = new WeakMap();
|
|
2095
|
+
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
|
2085
2096
|
function $mol_key(value) {
|
|
2086
2097
|
if (typeof value === 'bigint')
|
|
2087
2098
|
return value.toString() + 'n';
|
|
@@ -2111,7 +2122,7 @@ var $;
|
|
|
2111
2122
|
return value;
|
|
2112
2123
|
if (value instanceof RegExp)
|
|
2113
2124
|
return value.toString();
|
|
2114
|
-
if (value instanceof
|
|
2125
|
+
if (value instanceof TypedArray)
|
|
2115
2126
|
return [...value];
|
|
2116
2127
|
let key = $.$mol_key_store.get(value);
|
|
2117
2128
|
if (key)
|