emberjs/ember.js — pull request #5430 by mixonic (2014-08-19 04:35:12+00:00)
Title: [BUGFIX beta] Move __nextSuper onto meta

Properties cannot be modified on a frozen object, which means even if the functions to not alter the context, the super implementation itself will raise an exception when a wrapped method calls (and changes `__nextSuper`).

Part of the challenge here is that Ember wraps functions defensively- it has no insight into if super will be called by a function and no tools for hinting about non-super-calling functions. Ember also follows a pattern of using hooks, so many methods are intended to be overridden even if the override will never call super. Unfortunately this pattern costs us. With either hinting or a new internals-only super syntax, we can improve the performance regardless.

But putting super on the meta we kill two birds with one stone. The property does not need to use slow defineProperty (it is already not enumerable on the object) and it can still be set regardless of an object being frozen.

This is not expected to have an impact on performance. The number of meta objects created during a run of the tests remains steady at about 22000 objects, and the number of requests for meta triples from 30k to 90k.

Fixes #4970, Fixes #5324, Fixes #5374