marko 6.0.0-3.8 → 6.0.0-3.9

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.
@@ -7329,9 +7329,7 @@ var script_default = {
7329
7329
  const { node } = tag;
7330
7330
  const { body } = node.body;
7331
7331
  if (body.length) {
7332
- const codePrefix = "async ()=>{";
7333
- const codeSuffix = "}";
7334
- let code = codePrefix;
7332
+ let code = "";
7335
7333
  for (const child of body) {
7336
7334
  if (child.type !== "MarkoText") {
7337
7335
  throw tag.hub.file.hub.buildError(
@@ -7342,22 +7340,15 @@ var script_default = {
7342
7340
  }
7343
7341
  code += child.value;
7344
7342
  }
7345
- code += codeSuffix;
7346
7343
  const start = body[0]?.start;
7347
7344
  const end = body[body.length - 1]?.end;
7348
- const bodyExpression = (0, import_babel_utils30.parseExpression)(
7349
- tag.hub.file,
7350
- code,
7351
- start,
7352
- end,
7353
- codePrefix.length
7354
- );
7355
- bodyExpression.async = traverseContains(
7356
- bodyExpression.body,
7357
- isAwaitExpression
7345
+ const bodyStatements = (0, import_babel_utils30.parseStatements)(tag.hub.file, code, start, end);
7346
+ const valueFn = import_compiler41.types.arrowFunctionExpression(
7347
+ [],
7348
+ import_compiler41.types.blockStatement(bodyStatements),
7349
+ traverseContains(bodyStatements, isAwaitExpression)
7358
7350
  );
7359
- bodyExpression.fromBody = true;
7360
- node.attributes.push(import_compiler41.types.markoAttribute("value", bodyExpression));
7351
+ node.attributes.push(import_compiler41.types.markoAttribute("value", valueFn));
7361
7352
  node.body.body = [];
7362
7353
  }
7363
7354
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "marko",
3
- "version": "6.0.0-3.8",
3
+ "version": "6.0.0-3.9",
4
4
  "description": "Optimized runtime for Marko templates.",
5
5
  "keywords": [
6
6
  "api",