Herby Vojčík wrote:
Couldn't all this be solved by allowing = also for object literals and
promoting its use? People get used to the fact that = is the "normal"
way and : is the "special" way plus they are told JSON only has : for
both historical and security reasons.
Because I feel the main problem felt here is "don't help developers do
[[DefineProperty]] all over". I say : should definitelybe there
(consistency, I value it very highly, so no = only), but by saying
"using = is the right style" people can move away from using : in
literal, so they will also not use it in mustache.
Mark Miller and I advocated this in last week's meeting, but the
counter-argument (Oliver, IIRC) was that people would use = in JSON by
accident, *not test their JSON*, and we'd rerun the JSON theft exploit show.
I don't buy this either. People test or they deserve what they get. =
not : in JSON? Never saw it, don't expect any JS support would cause it
to arise. I could be wrong, but we're speculating here. No proofs.
Anyway, the more I think about it, the more I believe we should leave
object literals alone, but consider my A/B from last post:
A. obj.{prop: val, ...} as safe mustache, with : for define not assign.
B. obj.[prop = val; ...] with meta... of course, for fluent-style
chained assignments of obj's props.
Note that B could support method calls too, as Dave has proposed under
curlier syntax.
/be
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss