ember-estree 0.6.4 → 0.6.5
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/package.json +1 -1
- package/src/print.js +9 -2
package/package.json
CHANGED
package/src/print.js
CHANGED
|
@@ -83,6 +83,9 @@ export function print(node) {
|
|
|
83
83
|
case "ChainExpression":
|
|
84
84
|
return print(node.expression);
|
|
85
85
|
|
|
86
|
+
case "ParenthesizedExpression":
|
|
87
|
+
return `(${print(node.expression)})`;
|
|
88
|
+
|
|
86
89
|
case "ArrowFunctionExpression": {
|
|
87
90
|
const typeParams = node.typeParameters ? print(node.typeParameters) : "";
|
|
88
91
|
const params = (node.params ?? []).map(print).join(", ");
|
|
@@ -772,11 +775,13 @@ export function print(node) {
|
|
|
772
775
|
const attrs = (node.attributes ?? []).map(print).join(" ");
|
|
773
776
|
const modifiers = (node.modifiers ?? []).map(print).join(" ");
|
|
774
777
|
const children = (node.children ?? []).map(print).join("");
|
|
778
|
+
const blockParams = node.blockParams ?? [];
|
|
779
|
+
const asParams = blockParams.length ? ` as |${blockParams.join(" ")}|` : "";
|
|
775
780
|
const parts = [tag];
|
|
776
781
|
if (attrs) parts.push(attrs);
|
|
777
782
|
if (modifiers) parts.push(modifiers);
|
|
778
783
|
if (node.selfClosing) return `<${parts.join(" ")} />`;
|
|
779
|
-
return `<${parts.join(" ")}>${children}</${tag}>`;
|
|
784
|
+
return `<${parts.join(" ")}${asParams}>${children}</${tag}>`;
|
|
780
785
|
}
|
|
781
786
|
|
|
782
787
|
case "GlimmerElementNodePart":
|
|
@@ -799,6 +804,8 @@ export function print(node) {
|
|
|
799
804
|
const path = print(node.path);
|
|
800
805
|
const params = (node.params ?? []).map(print).join(" ");
|
|
801
806
|
const hash = node.hash ? print(node.hash) : "";
|
|
807
|
+
const blockParams = node.program?.blockParams ?? [];
|
|
808
|
+
const asParams = blockParams.length ? ` as |${blockParams.join(" ")}|` : "";
|
|
802
809
|
const body = (node.body ?? node.program?.body ?? []).map(print).join("");
|
|
803
810
|
const inverse = node.inverse
|
|
804
811
|
? `{{else}}${(node.inverse.body ?? []).map(print).join("")}`
|
|
@@ -806,7 +813,7 @@ export function print(node) {
|
|
|
806
813
|
const parts = [path];
|
|
807
814
|
if (params) parts.push(params);
|
|
808
815
|
if (hash) parts.push(hash);
|
|
809
|
-
return `{{#${parts.join(" ")}}}${body}${inverse}{{/${print(node.path)}}}`;
|
|
816
|
+
return `{{#${parts.join(" ")}${asParams}}}${body}${inverse}{{/${print(node.path)}}}`;
|
|
810
817
|
}
|
|
811
818
|
|
|
812
819
|
case "GlimmerPathExpression":
|