On Sat, Apr 28, 2012 at 11:13 AM, Angus Croll <[email protected]> wrote: > 1) Kevin et al suggested YAGN call/apply on (non-method) functions. Here's a > pretty neat example where call/apply is a perfect fit for standalone > functions - and would break if replaced with fat arrows. > > https://gist.github.com/2520731 > > It's a simplified version of a a localStorage function (itself a mixin BTW) > which defines standard encoding methods and then mixes in whatever storage > technique isĀ available to the browser. (An added bonus of having functions > here, aside from privacy, is that we can employ hoisting to move the > implementation nitty-gritty to the bottom, so as not to obscure the core > process)
This is a mixin, which means that it needs methods, not functions. Fat arrows aren't meant for methods. This should rightly use 'function' (which is meant for methods), or eventually use a mixin syntax. (We should keep this in mind as an example of mixins, so we don't accidentally forbid the ability to choose which mixin to use dynamically, like this does.) ~TJ _______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

