On Apr 15, 2011, at 9:32 PM, Garrett Smith wrote: > On 4/14/11, Brendan Eich <[email protected]> wrote: > >> There is no ambiguity problem with ? followed by . and then (with whitespace >> allowed, of course) an IdentifierName. We need the lookahead to an >> identifier-name starting-character to avoid this: >> >> var tolerance = big ?.1:.01; >> >> So we can't simply maximum-munch '?.'. > What about square-bracket property accessors? Is [propertyName] an > Array or is it the new conditional property access with > square-brackets? > var p = o.v ? [propertyName];
Same as the ?() case: x = a ? [ b ] : c; y = d ? [ e ]; (or equivalent expressions where ) instead of ; stops the ? expression from being a ?: expression). The fact that ? and the bracket are separate tokens here makes me think twice about treating ?. as one token with a lookahead restriction on identifer-name start-character following the dot. My hunch is TC39 members won't agree on this but again, hearing from them would be better, and a worked-out proposal that doesn't make anyone too sick, even better. /be _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

