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/web.mjs
CHANGED
|
@@ -977,15 +977,20 @@ var $;
|
|
|
977
977
|
break;
|
|
978
978
|
}
|
|
979
979
|
if ($mol_promise_like(result)) {
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
980
|
+
if (wrappers.has(result)) {
|
|
981
|
+
result = wrappers.get(result).then(a => a);
|
|
982
|
+
}
|
|
983
|
+
else {
|
|
984
|
+
const put = (res) => {
|
|
985
|
+
if (this.cache === result)
|
|
986
|
+
this.put(res);
|
|
987
|
+
return res;
|
|
988
|
+
};
|
|
989
|
+
wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
|
|
990
|
+
wrappers.set(result, result);
|
|
991
|
+
const error = new Error(`Promise in ${this}`);
|
|
992
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
993
|
+
}
|
|
989
994
|
}
|
|
990
995
|
}
|
|
991
996
|
catch (error) {
|
|
@@ -996,12 +1001,17 @@ var $;
|
|
|
996
1001
|
result = new Error(String(error), { cause: error });
|
|
997
1002
|
}
|
|
998
1003
|
if ($mol_promise_like(result)) {
|
|
999
|
-
wrappers.
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1004
|
+
if (wrappers.has(result)) {
|
|
1005
|
+
result = wrappers.get(result);
|
|
1006
|
+
}
|
|
1007
|
+
else {
|
|
1008
|
+
wrappers.set(result, result = Object.assign(result.finally(() => {
|
|
1009
|
+
if (this.cache === result)
|
|
1010
|
+
this.absorb();
|
|
1011
|
+
}), { destructor: result.destructor || (() => { }) }));
|
|
1012
|
+
const error = new Error(`Promise in ${this}`);
|
|
1013
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
1014
|
+
}
|
|
1005
1015
|
}
|
|
1006
1016
|
}
|
|
1007
1017
|
if (!$mol_promise_like(result)) {
|
|
@@ -1087,6 +1097,7 @@ var $;
|
|
|
1087
1097
|
var $;
|
|
1088
1098
|
(function ($) {
|
|
1089
1099
|
$.$mol_key_store = new WeakMap();
|
|
1100
|
+
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
|
1090
1101
|
function $mol_key(value) {
|
|
1091
1102
|
if (typeof value === 'bigint')
|
|
1092
1103
|
return value.toString() + 'n';
|
|
@@ -1116,7 +1127,7 @@ var $;
|
|
|
1116
1127
|
return value;
|
|
1117
1128
|
if (value instanceof RegExp)
|
|
1118
1129
|
return value.toString();
|
|
1119
|
-
if (value instanceof
|
|
1130
|
+
if (value instanceof TypedArray)
|
|
1120
1131
|
return [...value];
|
|
1121
1132
|
let key = $.$mol_key_store.get(value);
|
|
1122
1133
|
if (key)
|