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

Remove the blacklisted keys #2

Open
aghassemi opened this issue Nov 18, 2014 · 2 comments
Open

Remove the blacklisted keys #2

aghassemi opened this issue Nov 18, 2014 · 2 comments

Comments

@aghassemi
Copy link

I found it strange that I can not use 'delete' or other reserved words as keys to a map. I can see the technical reason behind this decision but it is causing hard to reproduce/debug runtime errors in situations where the map is used in a dynamic way. I got lucky that one of the words that I happened to load dynamically into map was 'delete' purely by chance otherwise I would not have caught this error and now my work around is to always prefix the keys just because of a few reserved keywords.

It would be really nice to allow arbitrary keys.

@nrw
Copy link
Owner

nrw commented Nov 18, 2014

there has been some discussion about this regarding the other observ-* modules. if we go for an api change, this is possible. comments on the subject are welcome.

@aghassemi
Copy link
Author

I am thinking it may make sense for map and struct be to different. I don't have an issue with observ-struct but for something that's a map, I am thinking the observed immutable value can just be an immutable map, with only a get(key) and values are not accessible as object properties. ES6 map works this way and potentially when ES6 map is more widely implemented, this can also use it to allow non-string keys as well.

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

No branches or pull requests

2 participants