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

Comments

@apaleslimghost
Copy link
Contributor

Unexpected ','

@duralog
Copy link

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

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

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

@duralog
Copy link

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

Also, a[]b + c works.

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

6 participants