On Tue, Apr 24, 2012 at 1:03 PM, Tab Atkins Jr. <[email protected]>wrote:
> On Tue, Apr 24, 2012 at 9:51 AM, Rick Waldron <[email protected]> > wrote: > > When I read this, I assumed it was a reference to > > this: > http://wiki.ecmascript.org/doku.php?id=harmony:object_literals#object_literal_property_shorthands > > > > Which would produce a method named "set" on "box" > > > >> box.set(42) > >> box.get() > > > > 42 > > > > > > The example is easily confused. > > Ah, that makes sense. Okay. > > In that case, I don't see why one wouldn't just use the same syntax > for both methods: > > let box = { > _value: 0, > get() { return this._value; }, > set(v) { this._value = v; } > }; > > There doesn't seem to be a need there for thin-arrow (dynamic this) > functions. > I think the colon was just a typo Rick [snip]
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

