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

a[]b ++ c fails to compile #542

Closed
apaleslimghost opened this issue Aug 12, 2014 · 5 comments
Closed

a[]b ++ c fails to compile #542

apaleslimghost opened this issue Aug 12, 2014 · 5 comments
Labels
bug

Comments

@apaleslimghost
Copy link
Contributor

@apaleslimghost apaleslimghost commented Aug 12, 2014

Unexpected ','

@duralog
Copy link

@duralog duralog commented Aug 14, 2014

can you explain what you expected the output to be? I'm pretty sure that's wrong... you have not said your index. a[0]b ++ c will compile

@normalser
Copy link

@normalser normalser commented Aug 14, 2014

There is nothing wrong with what @quarterto is trying to do.
It should compile to (a.b || (a.b = [])).concat(c)

@apaleslimghost
Copy link
Contributor Author

@apaleslimghost apaleslimghost commented Aug 14, 2014

Search for "semiautovivification" in the docs. a[]b ensures b exists as an array on a.

@duralog
Copy link

@duralog duralog commented Aug 16, 2014

wow! you are right... that should exist... however in my opinion it actually should not.. because it's one thong to say x instanceof MyObj and another thing to say typeoof x === 'object' -- so I would actually like this syntax to be kiiled for obvious reasons

@vendethiel
Copy link
Contributor

@vendethiel vendethiel commented Sep 14, 2014

Also, a[]b + c works.

@gkz gkz added the bug label Apr 17, 2015
@isiahmeadows isiahmeadows mentioned this issue Jun 5, 2016
0 of 8 tasks complete
@pepkin88 pepkin88 mentioned this issue Mar 26, 2018
@rhendric rhendric closed this Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants