fix(glimmer): do not strip block params on <Component> (#4889)

master
Paul Chavard 2018-07-25 00:07:49 +02:00 committed by Lucas Duailibe
parent e35e13c38a
commit 5d254ce310
3 changed files with 24 additions and 0 deletions

View File

@ -82,6 +82,7 @@ function print(path, options, print) {
"<",
n.tag,
getParams(path, print),
n.blockParams.length ? ` as |${n.blockParams.join(" ")}|` : "",
ifBreak(softline, ""),
closeTag
])

View File

@ -29,6 +29,14 @@ exports[`block-statement.hbs - glimmer-verify 1`] = `
hello
{{/block}}
{{/block}}
<MyComponent as |firstName|>
{{firstName}}
</MyComponent>
<MyComponent as |firstName lastName|>
{{firstName}} {{lastName}}
</MyComponent>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
{{#block param hashKey=hashValue as |blockParam|}}
Hello
@ -90,6 +98,13 @@ exports[`block-statement.hbs - glimmer-verify 1`] = `
Hello
{{/block}}
{{#block}}{{#block}}hello{{/block}}{{/block}}
<MyComponent as |firstName|>
{{firstName}}
</MyComponent>
<MyComponent as |firstName lastName|>
{{firstName}}
{{lastName}}
</MyComponent>
`;
exports[`component.hbs - glimmer-verify 1`] = `

View File

@ -26,3 +26,11 @@
hello
{{/block}}
{{/block}}
<MyComponent as |firstName|>
{{firstName}}
</MyComponent>
<MyComponent as |firstName lastName|>
{{firstName}} {{lastName}}
</MyComponent>