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

true and false are treated as names #424

Closed
Rich-Harris opened this issue Mar 29, 2017 · 2 comments
Closed

true and false are treated as names #424

Rich-Harris opened this issue Mar 29, 2017 · 2 comments
Labels

Comments

@Rich-Harris
Copy link
Member

REPL — this template...

<label>
  <input type='radio' bind:group='foo' value='{{false}}'> input
</label>

<label>
  <input type='radio' bind:group='foo' value='{{true}}'> output
</label> 

...ends up like this:

var last_input_value = root.false;

This was probably introduced by #385. I'd argue that true, false, null and maybe undefined should not get the same treatment as class et al.

@Rich-Harris
Copy link
Member Author

Note: you can workaround this by adding 'false': false, 'true': true to your data....

@Conduitry
Copy link
Member

Yeah this is definitely from #385. If we want to keep that behavior, instead of having special cases for certain names (true, `false, etc), maybe we could first try parsing, and then if that failed and we were a single all-lowercase word do the special case for the identifier ... otherwise report the parse failure.

Conduitry added a commit that referenced this issue Mar 29, 2017
Rich-Harris added a commit that referenced this issue Apr 2, 2017
Rich-Harris added a commit that referenced this issue Apr 2, 2017
Treat literals as special cases when parsing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants