mol_wire_lib 1.0.966 → 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 -11
- package/node.js.map +1 -1
- package/node.mjs +11 -11
- package/node.test.js +11 -11
- package/node.test.js.map +1 -1
- package/package.json +1 -1
- package/web.js +11 -11
- package/web.js.map +1 -1
- package/web.mjs +11 -11
package/web.mjs
CHANGED
|
@@ -760,17 +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
|
-
Error.captureStackTrace(result);
|
|
773
|
-
handled.add(result);
|
|
769
|
+
result = result.then(put, put);
|
|
774
770
|
}
|
|
775
771
|
}
|
|
776
772
|
catch (error) {
|
|
@@ -781,16 +777,20 @@ var $;
|
|
|
781
777
|
result = new Error(String(error), { cause: error });
|
|
782
778
|
}
|
|
783
779
|
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
784
|
-
result =
|
|
780
|
+
result = result.finally(() => {
|
|
785
781
|
if (this.cache === result)
|
|
786
782
|
this.absorb();
|
|
787
|
-
}), {
|
|
788
|
-
destructor: result['destructor'] ?? (() => { })
|
|
789
783
|
});
|
|
790
|
-
Error.captureStackTrace(result);
|
|
791
|
-
handled.add(result);
|
|
792
784
|
}
|
|
793
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
|
+
}
|
|
794
794
|
if (!$mol_promise_like(result)) {
|
|
795
795
|
this.track_cut();
|
|
796
796
|
}
|