brendan at mozilla.com
Thu May 10 15:02:05 PDT 2012
Allen Wirfs-Brock wrote:
> Note that in this and many other similar situations the isFoo method is actually redundant. You would get the same effect by saying:
> if (obj1.doFooishThings) obj1.doFooishThings();
> this suggests that a useful operator might be a conditional property access, perhaps something like:
> which parses as
> CallExpression :
> ?? MemberExpression Arguments
> If conditionally calls the value of the MemberExpression if it is not undefined.
CoffeeScript has foo?.bar ... and foo.baz?(...) in lieu of
if (foo != null) foo.bar ...
if (foo.baz != null) foo.baz(...)
where all ... are meta. We've talked about these a bit in TC39 but I
don't recall any definite outcome.
More information about the es-discuss