marko 6.0.0-3.7 → 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.
- package/dist/translator/index.js +7 -16
- package/package.json +2 -1
- package/tag-types/const.d.marko +7 -0
- package/tag-types/debug.d.marko +5 -0
- package/tag-types/define.d.marko +5 -0
- package/tag-types/do.d.marko +5 -0
- package/tag-types/effect.d.marko +5 -0
- package/tag-types/id.d.marko +3 -0
- package/tag-types/let.d.marko +8 -0
- package/tag-types/lifecycle.d.marko +7 -0
- package/tag-types/log.d.marko +5 -0
- package/tag-types/script.d.marko +5 -0
package/dist/translator/index.js
CHANGED
@@ -7329,9 +7329,7 @@ var script_default = {
|
|
7329
7329
|
const { node } = tag;
|
7330
7330
|
const { body } = node.body;
|
7331
7331
|
if (body.length) {
|
7332
|
-
|
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
|
7349
|
-
|
7350
|
-
|
7351
|
-
|
7352
|
-
|
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
|
-
|
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.
|
3
|
+
"version": "6.0.0-3.9",
|
4
4
|
"description": "Optimized runtime for Marko templates.",
|
5
5
|
"keywords": [
|
6
6
|
"api",
|
@@ -33,6 +33,7 @@
|
|
33
33
|
},
|
34
34
|
"files": [
|
35
35
|
"dist",
|
36
|
+
"tag-types",
|
36
37
|
"!**/meta.*.json",
|
37
38
|
"!**/__tests__",
|
38
39
|
"!**/*.tsbuildinfo"
|