Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was 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

@chalin

Description

@chalin

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions