mol_jsx_lib 0.0.832 → 0.0.834
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
|
@@ -983,17 +983,13 @@ var $;
|
|
|
983
983
|
result = this.task.call(this.host, ...this.args);
|
|
984
984
|
break;
|
|
985
985
|
}
|
|
986
|
-
if ($mol_promise_like(result)) {
|
|
986
|
+
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
987
987
|
const put = (res) => {
|
|
988
988
|
if (this.cache === result)
|
|
989
989
|
this.put(res);
|
|
990
990
|
return res;
|
|
991
991
|
};
|
|
992
|
-
result =
|
|
993
|
-
destructor: result['destructor'] ?? (() => { })
|
|
994
|
-
});
|
|
995
|
-
Error.captureStackTrace(result);
|
|
996
|
-
handled.add(result);
|
|
992
|
+
result = result.then(put, put);
|
|
997
993
|
}
|
|
998
994
|
}
|
|
999
995
|
catch (error) {
|
|
@@ -1004,16 +1000,20 @@ var $;
|
|
|
1004
1000
|
result = new Error(String(error), { cause: error });
|
|
1005
1001
|
}
|
|
1006
1002
|
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
1007
|
-
result =
|
|
1003
|
+
result = result.finally(() => {
|
|
1008
1004
|
if (this.cache === result)
|
|
1009
1005
|
this.absorb();
|
|
1010
|
-
}), {
|
|
1011
|
-
destructor: result['destructor'] ?? (() => { })
|
|
1012
1006
|
});
|
|
1013
|
-
Error.captureStackTrace(result);
|
|
1014
|
-
handled.add(result);
|
|
1015
1007
|
}
|
|
1016
1008
|
}
|
|
1009
|
+
if ($mol_promise_like(result) && !handled.has(result)) {
|
|
1010
|
+
result = Object.assign(result, {
|
|
1011
|
+
destructor: result['destructor'] ?? (() => { })
|
|
1012
|
+
});
|
|
1013
|
+
handled.add(result);
|
|
1014
|
+
const error = new Error();
|
|
1015
|
+
Object.defineProperty(result, 'stack', { get: () => error.stack });
|
|
1016
|
+
}
|
|
1017
1017
|
if (!$mol_promise_like(result)) {
|
|
1018
1018
|
this.track_cut();
|
|
1019
1019
|
}
|