lib/mixin.js
function _createProxyMethod(proxyMethodName, mixinMethodName, hostObject) {
    hostObject = hostObject || this._hostObject;

    // Mixin class does not allow shadowing methods that exist on the host object
    if (hostObject[proxyMethodName])
        throw new Error('method ' + proxyMethodName +
                        ' already defined in host object');

    var method = this[mixinMethodName];
    check(method, Function);

    // Bind proxied Mixin's method to Mixin instance
    var boundMethod = method.bind(this);

    Object.defineProperty(hostObject, proxyMethodName, {
        value: boundMethod,
        enumerable: false,
        configurable: false,
        writable: true
    });
}
function _createProxyMethod(proxyMethodName, mixinMethodName, hostObject) {
    hostObject = hostObject || this._hostObject;

    // Mixin class does not allow shadowing methods that exist on the host object
    if (hostObject[proxyMethodName])
        throw new Error('method ' + proxyMethodName +
                        ' already defined in host object');

    var method = this[mixinMethodName];
    check(method, Function);

    // Bind proxied Mixin's method to Mixin instance
    var boundMethod = method.bind(this);

    Object.defineProperty(hostObject, proxyMethodName, {
        value: boundMethod,
        enumerable: false,
        configurable: false,
        writable: true
    });
}
function _createProxyMethod ( proxyMethodName , mixinMethodName , hostObject ) { hostObject = hostObject || this . _hostObject ; // Mixin class does not allow shadowing methods that exist on the host object if ( hostObject [ proxyMethodName ] ) throw new Error ( 'method ' + proxyMethodName + ' already defined in host object' ) ; var method = this [ mixinMethodName ] ; check ( method , Function ) ; // Bind proxied Mixin's method to Mixin instance var boundMethod = method . bind ( this ) ; Object . defineProperty ( hostObject , proxyMethodName , { value : boundMethod , enumerable : false , configurable : false , writable : true } ) ; }
Creates a proxied method of Mixin subclass on host object.

@param {String} mixinMethodName name of method in Mixin subclass
@param {String} proxyMethodName name of created proxy method on host object
@param {Object} hostObject Optional reference to the host object; if not specified the host object passed to constructor wil be used. It allows to use the same instance of Mixin on two host objects.
Creates a proxied method of Mixin subclass on host object .