Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename root to state, and allow state to be used as context #511

Merged
merged 3 commits into from
Apr 19, 2017

Conversation

Rich-Harris
Copy link
Member

This scratches a long-standing itch (#507) and fixes a bug whereby this would fail:

{{#each roots as root}}
  {{root}}
{{/each}}

The state equivalent now works, as state is treated as a reserved word.

@Conduitry
Copy link
Member

I see that "can't use root as an import" error has been tightened up to just check for state as a component name, nice 👍

@@ -79,7 +79,7 @@ function create_each_block ( root, each_block_value, comment, i, component ) {
var text_2 = createText( text_2_value = comment.author );
appendNode( text_2, span );
appendNode( createText( " wrote " ), span );
var text_4 = createText( text_4_value = root.elapsed(comment.time, root.time) );
var text_4 = createText( text_4_value = state.elapsed(comment.time, root.time) );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this one root was missed in the merge.

@Rich-Harris Rich-Harris merged commit 1fd3c21 into master Apr 19, 2017
@Rich-Harris Rich-Harris deleted the gh-507 branch April 19, 2017 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants