Skip to content

Commit

Permalink
Fix child tag expressions being pushed to parent expressions, fixes #392
Browse files Browse the repository at this point in the history
  • Loading branch information
tipiirai committed Feb 21, 2015
1 parent 9ce0d71 commit 2eecb48
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/tag/parse.js
Expand Up @@ -50,7 +50,11 @@ function parseLayout(root, tag, expressions) {

// child tag
var impl = tag_impl[dom.tagName.toLowerCase()]
if (impl) impl = new Tag(impl, { root: dom, parent: tag })

if (impl) {
impl = new Tag(impl, { root: dom, parent: tag })
return false
}

})

Expand Down
9 changes: 9 additions & 0 deletions test/tag/pass-expr.tag
@@ -0,0 +1,9 @@

<expr-parent>
<expr-child code={ code }></expr-child>
this.code = 'foo { bar }'
</expr-parent>

<expr-child>
<pre>{ opts.code } == foo \{ bar \}</pre>
</expr-child>

0 comments on commit 2eecb48

Please sign in to comment.