benchmarks/scenarios/ember.js
function Mixin(args, properties) {
    this.properties = properties;

    var length = args && args.length;

    if (length > 0) {
      var m = new Array(length);

      for (var i = 0; i < length; i++) {
        var x = args[i];
        if (x instanceof Mixin) {
          m[i] = x;
        } else {
          m[i] = new Mixin(undefined, x);
        }
      }

      this.mixins = m;
    } else {
      this.mixins = undefined;
    }
    this.ownerConstructor = undefined;
    this._without = undefined;
    this[_emberMetalUtils.GUID_KEY] = null;
    this[_emberMetalUtils.GUID_KEY + '_name'] = null;
    _emberMetalDebug.debugSeal(this);
  }
function Mixin(args, properties) {
    this.properties = properties;

    var length = args && args.length;

    if (length > 0) {
      var m = new Array(length);

      for (var i = 0; i < length; i++) {
        var x = args[i];
        if (x instanceof Mixin) {
          m[i] = x;
        } else {
          m[i] = new Mixin(undefined, x);
        }
      }

      this.mixins = m;
    } else {
      this.mixins = undefined;
    }
    this.ownerConstructor = undefined;
    this._without = undefined;
    this[_emberMetalUtils.GUID_KEY] = null;
    this[_emberMetalUtils.GUID_KEY + '_name'] = null;
    _emberMetalDebug.debugSeal(this);
  }
function Mixin ( args , properties ) { this . properties = properties ; var length = args && args . length ; if ( length > 0 ) { var m = new Array ( length ) ; for ( var i = 0 ; i < length ; i ++ ) { var x = args [ i ] ; if ( x instanceof Mixin ) { m [ i ] = x ; } else { m [ i ] = new Mixin ( undefined , x ) ; } } this . mixins = m ; } else { this . mixins = undefined ; } this . ownerConstructor = undefined ; this . _without = undefined ; this [ _emberMetalUtils . GUID_KEY ] = null ; this [ _emberMetalUtils . GUID_KEY + '_name' ] = null ; _emberMetalDebug . debugSeal ( this ) ; }
The `Ember.Mixin` class allows you to create mixins, whose properties can be
added to other classes. For instance,

```javascript
App.Editable = Ember.Mixin.create({
edit: function() {
console.log('starting to edit');
this.set('isEditing', true);
},
isEditing: false
});

Mix mixins into classes by passing them as the first arguments to
.extend.
App.CommentView = Ember.View.extend(App.Editable, {
template: Ember.Handlebars.compile('{{#if view.isEditing}}...{{else}}...{{/if}}')
});

commentView = App.CommentView.create();
commentView.edit(); // outputs 'starting to edit'
```

Note that Mixins are created with `Ember.Mixin.create`, not
`Ember.Mixin.extend`.

Note that mixins extend a constructor's prototype so arrays and object literals
defined as properties will be shared amongst objects that implement the mixin.
If you want to define a property in a mixin that is not shared, you can define
it either as a computed property or have it be created on initialization of the object.

```javascript
filters array will be shared amongst any object implementing mixin
App.Filterable = Ember.Mixin.create({
filters: Ember.A()
});

filters will be a separate  array for every object implementing the mixin
App.Filterable = Ember.Mixin.create({
filters: Ember.computed(function() {return Ember.A();})
});

filters will be created as a separate array during the object's initialization
App.Filterable = Ember.Mixin.create({
init: function() {
this._super(...arguments);
this.set("filters", Ember.A());
}
});
```

@class Mixin
@namespace Ember
@public
The Ember . Mixin class allows you to create mixins whose properties can be added to other classes . For instance