joubertnel/ember.js — comment on commit 771a003a8e0fd109b7678dcd624a22f0e5184117
File: packages/ember-states/lib/view_state.js line 23
By joubertnel:

Yes, I know :-)

However, I specifically took this route because I suspect it will perform better. Here's my reasoning:

- using a closure to access view and StateManager means that Google Closure Compiler cannot inline the function - see this GCC output: https://gist.github.com/1605809
- contrast it with the output when you use variable passing - then GCC can inline the calls, obviating the need for another function call: https://gist.github.com/1605803

Perhaps this only has marginal impact (even on mobile), but that's the reason I chose this route.

That, by the way, is also why I specifically chose to do the Ember.$.isReady if/then logic instead of always $(document).ready(), since, as I understand, it is more performant.

Feedback welcome!