How to: Fix “assertion failed: Ember.Object.create no longer supports defining methods that call _super.” - Byron Salau

Posted by | March 04, 2013 | javascript | No Comments

In previous versions of Ember the Ember.Object.create and Ember.Object.extend would behave very similar. You could pass in your overrides/mixins and methods that call _super. However supporting this is very expensive and usually an unnecessary overhead. During normal run-time we need very few extends, actually mostly only during set up, but we do lots of creates which must incur the penalty of supporting these unnecessary features.

So how do we get around this?

There is a new method you are probably not aware of since your here. Let me introduce you to Ember.Object.createWithMixins. Using this method instead of create will give you back the feature rich create that your used to.

The result of all this is that the create method now runs 2x faster while still giving you the slower full featured createWithMixins option for your setups.