mol_wire_lib 1.0.1230 → 1.0.1231
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
|
@@ -754,15 +754,20 @@ var $;
|
|
|
754
754
|
break;
|
|
755
755
|
}
|
|
756
756
|
if ($mol_promise_like(result)) {
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
757
|
+
if (wrappers.has(result)) {
|
|
758
|
+
result = wrappers.get(result).then(a => a);
|
|
759
|
+
}
|
|
760
|
+
else {
|
|
761
|
+
const put = (res) => {
|
|
762
|
+
if (this.cache === result)
|
|
763
|
+
this.put(res);
|
|
764
|
+
return res;
|
|
765
|
+
};
|
|
766
|
+
wrappers.set(result, result = Object.assign(result.then(put, put), { destructor: result.destructor || (() => { }) }));
|
|
767
|
+
wrappers.set(result, result);
|
|
768
|
+
const error = new Error(`Promise in ${this}`);
|
|
769
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
770
|
+
}
|
|
766
771
|
}
|
|
767
772
|
}
|
|
768
773
|
catch (error) {
|
|
@@ -773,12 +778,17 @@ var $;
|
|
|
773
778
|
result = new Error(String(error), { cause: error });
|
|
774
779
|
}
|
|
775
780
|
if ($mol_promise_like(result)) {
|
|
776
|
-
wrappers.
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
781
|
+
if (wrappers.has(result)) {
|
|
782
|
+
result = wrappers.get(result);
|
|
783
|
+
}
|
|
784
|
+
else {
|
|
785
|
+
wrappers.set(result, result = Object.assign(result.finally(() => {
|
|
786
|
+
if (this.cache === result)
|
|
787
|
+
this.absorb();
|
|
788
|
+
}), { destructor: result.destructor || (() => { }) }));
|
|
789
|
+
const error = new Error(`Promise in ${this}`);
|
|
790
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
791
|
+
}
|
|
782
792
|
}
|
|
783
793
|
}
|
|
784
794
|
if (!$mol_promise_like(result)) {
|
|
@@ -1122,6 +1132,7 @@ var $;
|
|
|
1122
1132
|
var $;
|
|
1123
1133
|
(function ($) {
|
|
1124
1134
|
$.$mol_key_store = new WeakMap();
|
|
1135
|
+
const TypedArray = Object.getPrototypeOf(Uint8Array);
|
|
1125
1136
|
function $mol_key(value) {
|
|
1126
1137
|
if (typeof value === 'bigint')
|
|
1127
1138
|
return value.toString() + 'n';
|
|
@@ -1151,7 +1162,7 @@ var $;
|
|
|
1151
1162
|
return value;
|
|
1152
1163
|
if (value instanceof RegExp)
|
|
1153
1164
|
return value.toString();
|
|
1154
|
-
if (value instanceof
|
|
1165
|
+
if (value instanceof TypedArray)
|
|
1155
1166
|
return [...value];
|
|
1156
1167
|
let key = $.$mol_key_store.get(value);
|
|
1157
1168
|
if (key)
|