Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Treat Dart maps like maps, not (JavaScript) objects with field access #606

Closed
chalin opened this issue Feb 24, 2014 · 3 comments
Closed

Comments

@chalin
Copy link
Contributor

chalin commented Feb 24, 2014

This seems like a carry over from AngularJS: maps can be treated as objects, in particular, (simulated) field access is currently supported:

  • map.key is treated as a synonym for map[key]

and this for both reading and writing (as well as creating) map "fields".

While this is natural in JavaScript, it is at odds with Dart's clean separation of objects/classes from the Map datatype. IMHO, in designing AngularDart, every effort should be made to keep to a minimum differences in syntax and semantics between the AngularDart expression/statement language and the Dart language.

This JavaScript-ism is what prevented Map properties from being accessible, leading to, e.g., #397. While #605 offers a solution, it would not have been required in the first place if maps had been treated solely as maps (and hence without field access). I believe that a (full) proper solution is to remove the AngularJS "map field access" feature from AngularDart.

@chalin
Copy link
Contributor Author

chalin commented Feb 24, 2014

@mhevery comments? (FYI, if/when you agree, I would not mind attempting to address this now that I have spent the time to study that part of the code.)

@mhevery
Copy link
Contributor

mhevery commented Mar 19, 2014

See: #397 (comment)

@chalin
Copy link
Contributor Author

chalin commented Mar 20, 2014

Subsumed by issues covered by #397.

@chalin chalin closed this as completed Mar 20, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

2 participants