mol_wire_lib 1.0.967 → 1.0.968
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.js +11 -9
- package/node.js.map +1 -1
- package/node.mjs +11 -9
- package/node.test.js +11 -9
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.js +11 -9
- package/web.js.map +1 -1
- package/web.mjs +11 -9
package/web.mjs
CHANGED
|
@@ -760,16 +760,13 @@ var $;
|
|
|
760
760
|
result = this.task.call(this.host, ...this.args);
|
|
761
761
|
break;
|
|
762
762
|
}
|
|
763
|
-
if ($mol_promise_like(result)) {
|
|
763
|
+
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
764
764
|
const put = (res) => {
|
|
765
765
|
if (this.cache === result)
|
|
766
766
|
this.put(res);
|
|
767
767
|
return res;
|
|
768
768
|
};
|
|
769
|
-
result =
|
|
770
|
-
destructor: result['destructor'] ?? (() => { })
|
|
771
|
-
});
|
|
772
|
-
handled.add(result);
|
|
769
|
+
result = result.then(put, put);
|
|
773
770
|
}
|
|
774
771
|
}
|
|
775
772
|
catch (error) {
|
|
@@ -780,15 +777,20 @@ var $;
|
|
|
780
777
|
result = new Error(String(error), { cause: error });
|
|
781
778
|
}
|
|
782
779
|
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
783
|
-
result =
|
|
780
|
+
result = result.finally(() => {
|
|
784
781
|
if (this.cache === result)
|
|
785
782
|
this.absorb();
|
|
786
|
-
}), {
|
|
787
|
-
destructor: result['destructor'] ?? (() => { })
|
|
788
783
|
});
|
|
789
|
-
handled.add(result);
|
|
790
784
|
}
|
|
791
785
|
}
|
|
786
|
+
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
787
|
+
result = Object.assign(result, {
|
|
788
|
+
destructor: result['destructor'] ?? (() => { })
|
|
789
|
+
});
|
|
790
|
+
handled.add(result);
|
|
791
|
+
const error = new Error();
|
|
792
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
793
|
+
}
|
|
792
794
|
if (!$mol_promise_like(result)) {
|
|
793
795
|
this.track_cut();
|
|
794
796
|
}
|