marko 6.0.72 → 6.0.73

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.
@@ -1043,7 +1043,9 @@ function writePromise(state, val, ref) {
1043
1043
  if (!boundary) return false;
1044
1044
  const pId = nextRefAccess(state);
1045
1045
  const pRef = new Reference(ref, null, state.flush, null, pId);
1046
- state.buf.push("new Promise((f,r)=>" + pId + "={f,r})");
1046
+ state.buf.push(
1047
+ "(p=>p=new Promise((f,r)=>" + pId + "={f,r(e){p.catch(_=>0);r(e)}}))()"
1048
+ );
1047
1049
  val.then(
1048
1050
  (v) => writeAsyncCall(state, boundary, pRef, "f", v, pId),
1049
1051
  (v) => writeAsyncCall(state, boundary, pRef, "r", v, pId)
@@ -957,7 +957,9 @@ function writePromise(state, val, ref) {
957
957
  if (!boundary) return false;
958
958
  const pId = nextRefAccess(state);
959
959
  const pRef = new Reference(ref, null, state.flush, null, pId);
960
- state.buf.push("new Promise((f,r)=>" + pId + "={f,r})");
960
+ state.buf.push(
961
+ "(p=>p=new Promise((f,r)=>" + pId + "={f,r(e){p.catch(_=>0);r(e)}}))()"
962
+ );
961
963
  val.then(
962
964
  (v) => writeAsyncCall(state, boundary, pRef, "f", v, pId),
963
965
  (v) => writeAsyncCall(state, boundary, pRef, "r", v, pId)
package/dist/html.js CHANGED
@@ -736,7 +736,9 @@ function writePromise(state, val, ref) {
736
736
  let { boundary } = state;
737
737
  if (!boundary) return !1;
738
738
  let pId = nextRefAccess(state), pRef = new Reference(ref, null, state.flush, null, pId);
739
- return state.buf.push("new Promise((f,r)=>" + pId + "={f,r})"), val.then(
739
+ return state.buf.push(
740
+ "(p=>p=new Promise((f,r)=>" + pId + "={f,r(e){p.catch(_=>0);r(e)}}))()"
741
+ ), val.then(
740
742
  (v) => writeAsyncCall(state, boundary, pRef, "f", v, pId),
741
743
  (v) => writeAsyncCall(state, boundary, pRef, "r", v, pId)
742
744
  ), boundary.startAsync(), !0;
package/dist/html.mjs CHANGED
@@ -653,7 +653,9 @@ function writePromise(state, val, ref) {
653
653
  let { boundary } = state;
654
654
  if (!boundary) return !1;
655
655
  let pId = nextRefAccess(state), pRef = new Reference(ref, null, state.flush, null, pId);
656
- return state.buf.push("new Promise((f,r)=>" + pId + "={f,r})"), val.then(
656
+ return state.buf.push(
657
+ "(p=>p=new Promise((f,r)=>" + pId + "={f,r(e){p.catch(_=>0);r(e)}}))()"
658
+ ), val.then(
657
659
  (v) => writeAsyncCall(state, boundary, pRef, "f", v, pId),
658
660
  (v) => writeAsyncCall(state, boundary, pRef, "r", v, pId)
659
661
  ), boundary.startAsync(), !0;
@@ -10163,7 +10163,10 @@ var try_default = {
10163
10163
  "The [`<try>` tag](https://markojs.com/docs/reference/core-tag#try) requires [body content](https://markojs.com/docs/reference/language#tag-content)."
10164
10164
  );
10165
10165
  }
10166
- startSection(tag.get("body"));
10166
+ const bodySection = startSection(tag.get("body"));
10167
+ if (bodySection) {
10168
+ bodySection.upstreamExpression = tagExtra;
10169
+ }
10167
10170
  },
10168
10171
  translate: translateByTarget({
10169
10172
  html: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.72",
3
+ "version": "6.0.73",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",