adds methods to a constructor prototype
@method
@memberof Kinetic.Util.prototype
@param {Function} constructor
@param {Object} methods
549569
function(constructor, methods) {
            var key;

            for (key in methods) {
                constructor.prototype[key] = methods[key];
            }
        }
209554
function(Constructor, args) {
        var instance,
            Wrapper = function() {
                return Constructor.apply(this, args || []);
            };

        Wrapper.prototype = Constructor.prototype;
        instance = new Wrapper();
        instance.constructor = Constructor;

        return instance;
    }
1030507
function optimizeConstructor(constructor) {
        var tmp = constructor[$class],
            canOptimizeConst,
            newConstructor,
            parentInitialize;

        // Check if we can optimize the constructor
        if (tmp.efficient) {
            canOptimizeConst = constructor.$canOptimizeConst;
            delete constructor.$canOptimizeConst;

            if (canOptimizeConst && !tmp.properties.length && !tmp.binds.length) {
                if (hasOwn(constructor.prototype, 'initialize'))  {
                    newConstructor = constructor.prototype.initialize;
                } else {
                    parentInitialize = constructor.prototype.initialize;

                    // Optimize common use cases
                    // Default to the slower apply..
                    switch (parentInitialize.length) {
                    case 0:
                        newConstructor = function () { parentInitialize.call(this); };
                        break;
                    case 1:
                        newConstructor = function (a) { parentInitialize.call(this, a); };
                        break;
                    case 2:
                        newConstructor = function (a, b) { parentInitialize.call(this, a, b); };
                        break;
                    case 3:
                        newConstructor = function (a, b, c) { parentInitialize.call(this, a, b, c); };
                        break;
                    case 4:
                        newConstructor = function (a, b, c, d) { parentInitialize.call(this, a, b, c, d); };
                        break;
                    default:
                        newConstructor = function () { parentInitialize.apply(this, arguments); };
                    }
                }

                if (constructor.$parent) {
                    inheritPrototype(newConstructor, constructor);
                    newConstructor.$parent = constructor.$parent;
                }

                mixIn(newConstructor.prototype, constructor.prototype);
                mixIn(newConstructor, constructor);
                obfuscateProperty(newConstructor, $class, constructor[$class]);

                return newConstructor;
            }
        }

        return constructor;
    }
1015130
function (def) {
                var classpath = def.$classpath;
                // Initialize the prototype
                var proto; // prototype being created
                var superInterface = null;
                if (def.$extends) {
                    // the prototype must be created from the super interface
                    superInterface = Aria.getClassRef(def.$extends);
                    if (!superInterface) {
                        this.$logError(this.BASE_INTERFACE_UNDEFINED, [classpath, def.$extends]);
                        throw new Error(this.BASE_INTERFACE_UNDEFINED);
                    }
                    var parentCstr = superInterface ? superInterface.interfaceDefinition : null;
                    parentCstr = parentCstr ? parentCstr.$noargConstructor : null;
                    if (!parentCstr) {
                        this.$logError(this.WRONG_BASE_INTERFACE, [classpath, def.$extends]);
                        throw new Error(this.WRONG_BASE_INTERFACE);
                    }
                    proto = new parentCstr();
                    proto.$interfaces = __copyMap(superInterface.prototype.$interfaces);
                } else {
                    proto = new __superInterfaceConstructor();
                    proto.$interfaces = {};
                }
                proto.$classpath = classpath; // classpath of the interface
                // Look into the members of the interface, and divide them into functions or properties
                var itf = def.$interface;
                var methods = []; // builds the string containing the methods of the interface
                var initProperties = []; // builds the string to initialize properties of the interface (objects and
                // arrays)
                var deleteProperties = []; // builds the string to delete properties of the interface (in $destructor)
                for (var member in itf) {
                    if (itf.hasOwnProperty(member)) {
                        if (!Aria.checkJsVarName(member) || __superInterfacePrototype[member]) {
                            this.$logError(this.INVALID_INTERFACE_MEMBER, [classpath, member]);
                            // remove and ignore that member:
                            itf[member] = null;
                            delete itf[member];
                            continue;
                        }
                        var memberValue = __normalizeMember.call(this, itf[member], classpath, member);
                        itf[member] = memberValue;
                        if (memberValue != null) {
                            if (memberValue.$type == "Function") {
                                var asyncParam = memberValue.$callbackParam;
                                if (asyncParam == null) {
                                    asyncParam = "null";
                                }
                                methods.push("p.", member, "=function(){\nreturn i.get(this.__$me).$call('", classpath, "','", member, "',arguments,", asyncParam, ");\n}\n");
                            } else if (memberValue.$type == "Interface") {
                                initProperties.push("this.", member, "=obj.", member, "?obj.", member, ".$interface('", memberValue.$classpath, "'):null;\n");
                                deleteProperties.push("this.", member, "=null;\n");
                            } else if (memberValue.$type == "Object") {
                                initProperties.push("this.", member, "=obj.", member, ";\n");
                                deleteProperties.push("this.", member, "=null;\n");
                            }
                        } else {
                            this.$logError(this.INVALID_INTERFACE_MEMBER_DEF, [classpath, member]);
                            delete itf[member];
                        }
                    }
                }
                // management of events
                // events in the prototype of the interface
                proto.$events = {};
                var parentEvents = false;
                if (superInterface) {
                    parentEvents = __mergeEvents(proto.$events, superInterface.prototype.$events, classpath);
                } else {
                    methods.push("p.$interface=function(a){\nreturn aria.core.Interfaces.getInterface(i.get(this.__$me),a,this);\n};\n");
                }
                if (__mergeEvents(proto.$events, def.$events, classpath) && !parentEvents) {
                    // The parent interface has no event but this interface has events!
                    // We have to add special wrappers for event handling
                    methods.push("p.$addListeners=function(a){\nreturn i.get(this.__$me).$addListeners(a,this);\n};\n");
                    methods.push("p.$onOnce=function(a){\nreturn i.get(this.__$me).$onOnce(a,this);\n};\n");
                    methods.push("p.$removeListeners=function(a){\nreturn i.get(this.__$me).$removeListeners(a,this);\n};\n");
                    methods.push("p.$unregisterListeners=function(a){\nreturn i.get(this.__$me).$unregisterListeners(a,this);\n};\n");
                    methods.push("p.$on=p.$addListeners;\n");
                }
                methods.push("p.$destructor=function(){\n", deleteProperties.join(''), "if(this.__$me){\ni['delete'](this.__$me);\n}\nthis.__$me=null;\n", superInterface
                        ? "e.prototype.$destructor.call(this);\n" /* call super interface at the end of the destructor */
                        : "", "};\n");
                var srcContent = [];
                var evalContext = {
                    i : new __weakMap(),
                    p : proto, // prototype
                    c : null, // constructor (will be set by the evaluated code)
                    e : superInterface
                };
                Aria.nspace(classpath, true);
                srcContent.push("var evalContext=arguments[2];\nvar i=evalContext.i;\nvar p=evalContext.p;\nvar e=evalContext.e;\nevalContext.c=function(obj){\n", (superInterface
                        ? 'e.call(this,obj);\n'
                        : ''), 'this.__$me=this.__$me||this;\ni.set(this.__$me,obj);\n', initProperties.join(''), '};\n', methods.join(''), 'Aria.$global.', classpath, '=evalContext.c;\n', 'p=null;\nevalContext=null;\n');
                srcContent = srcContent.join('');

                // Get original sourceURL of the interface
                var interfaceSrcURL = downloadMgr.resolveURL( Aria.getLogicalPath(classpath, ".js"), true );
                // Remove extension and add wrapper extension
                var indexOfExtension = interfaceSrcURL.lastIndexOf(".");
                var srcURL = interfaceSrcURL.substring(0,indexOfExtension) + "-wrapper.js";
                // Generate the interface wrapper
                Aria["eval"](srcContent, srcURL, evalContext);
                var constructor = evalContext.c;
                proto.$interfaces[classpath] = constructor;
                constructor.prototype = proto;
                constructor.interfaceDefinition = def;
                constructor.superInterface = superInterface;
                def.$noargConstructor = new Function();
                def.$noargConstructor.prototype = proto;
                Aria.$classes.push(constructor);
                return constructor;
            }
112712
function callMethod(target, parseArgs, args) {

    // The first argument should be a function or an array.
    var func = args[0],
        funcArgs = [],
        modifiedArgs = [];

    // Handles [func, arg1, arg2, arg3], ...
    if (isArray(func) && isFunction(func[0])) {
        funcArgs = func.splice(1);
        func = func[0];
        modifiedArgs = args.splice(1);

    } else if (isFunction(func)) {
        funcArgs = args.splice(1);

    } else {
        errorManager.illegalArgument(args,
            'first argument must be a function');
    }

    // The source properties will be added here.
    var Scope = function() {};

    // Ensure the function has access to the target's current properties,
    // so that it can make function calls for example.
    Scope.prototype = target;

    // Apply with scope.
    var scope = new Scope();
    fastApply(func, scope, funcArgs);

    // Copy the non-prototype properties to source.
    var source = {};
    for (var key in scope) {
        if (scope.hasOwnProperty(key)) {
            source[key] = scope[key];
        }
    }

    // Reconstruct the method args with the new source object.
    modifiedArgs.unshift(source);

    return parseArgs(modifiedArgs);
}
278325
function addMethod(name, method) {
        if (method !== undefined) {
            methods[name] = method;
        }
        return methods[name];
    }
464940
function applyModelMethods (model, definition) {
	for (var i in definition.methods) {
		if (i === 'definition') {
			throw new Error('Invalid model definition provided. "definition" is a reserved word');
		}

		model.prototype[i] = definition.methods[i];
	}
}
211651
function prototypeMethodOrNull(className, method) {
  var ctor = goog.global[className];
  return (ctor && ctor.prototype && ctor.prototype[method]) || null;
}
1367501
function defineMethods(svc) {
    AWS.util.each(svc.prototype.api.operations, function iterator(method) {
      if (svc.prototype[method]) return;
      var operation = svc.prototype.api.operations[method];
      if (operation.authtype === 'none') {
        svc.prototype[method] = function (params, callback) {
          return this.makeUnauthenticatedRequest(method, params, callback);
        };
      } else {
        svc.prototype[method] = function (params, callback) {
          return this.makeRequest(method, params, callback);
        };
      }
    });
  }
70138
function addMethod(key) {
  Cacher.prototype[key] = function() {
    if (!this.md) {
      return Promise.reject(new Error('Model not set'));
    }
    this.method = key;
    return this.run.apply(this, arguments);
  };
}
1300668
function(object, method) {
      if (object == null) return void 0;
      var func = object[method];
      var args = slice.call(arguments, 2);
      return _.isFunction(func) ? func.apply(object, args) : void 0;
    }
990300
function (methods) {
    this.lazyLoaders();
    var loaders = this.loaders;
    var self = this;

    utils.arrayify(methods).forEach(function (method) {
      self.define(method, function() {
        return loaders[method].apply(loaders, arguments);
      });
    });
  }
1045251
function constructor( context ) {

    var request, handler, target, parent, bounds, index, suffix, clock, node, copy, type, key, val, min, max, w, h;

    var counter = 0;
    var touches = [];
    var resized = false;
    var setup = false;
    var ratio = win.devicePixelRatio || 1;
    var isDiv = context.type == DOM;
    var is2D = context.type == CANVAS;

    var mouse = {
      x:  0.0, y:  0.0,
      ox: 0.0, oy: 0.0,
      dx: 0.0, dy: 0.0
    };

    var eventMap = [

      context.eventTarget || context.element,

        pointer, 'mousedown', 'touchstart',
        pointer, 'mousemove', 'touchmove',
        pointer, 'mouseup', 'touchend',
        pointer, 'click',
        pointer, 'mouseout',
        pointer, 'mouseover',

      doc,

        keypress, 'keydown', 'keyup',

      win,

        active, 'focus', 'blur',
        resize, 'resize'
    ];

    var keys = {}; for ( key in keyMap ) keys[ keyMap[ key ] ] = false;

    function trigger( method ) {

      if ( isFunction( method ) )

        method.apply( context, [].splice.call( arguments, 1 ) );
    }

    function bind( on ) {

      for ( index = 0; index < eventMap.length; index++ ) {

        node = eventMap[ index ];

        if ( isString( node ) )

          target[ ( on ? 'add' : 'remove' ) + 'EventListener' ].call( target, node, handler, false );

        else if ( isFunction( node ) )

          handler = node;

        else target = node;
      }
    }

    function update() {

      cAF( request );
      request = rAF( update );

      if ( !setup ) {

        trigger( context.setup );
        setup = isFunction( context.setup );
      }

      if ( !resized ) {
        trigger( context.resize );
        resized = isFunction( context.resize );
      }

      if ( context.running && !counter ) {

        context.dt = ( clock = +new Date() ) - context.now;
        context.millis += context.dt;
        context.now = clock;

        trigger( context.update );

        // Pre draw

        if ( is2D ) {

          if ( context.retina ) {

            context.save();
            
            if (context.autoclear) {
              context.scale( ratio, ratio );
            }
          }

          if ( context.autoclear )

            context.clear();
        }

        // Draw

        trigger( context.draw );

        // Post draw

        if ( is2D && context.retina )

          context.restore();
      }

      counter = ++counter % context.interval;
    }

    function resize() {

      target = isDiv ? context.style : context.canvas;
      suffix = isDiv ? 'px' : '';

      w = context.width;
      h = context.height;

      if ( context.fullscreen ) {

        h = context.height = win.innerHeight;
        w = context.width = win.innerWidth;
      }

      if ( context.retina && is2D && ratio ) {

        target.style.height = h + 'px';
        target.style.width = w + 'px';

        w *= ratio;
        h *= ratio;
      }

      if ( target.height !== h )

        target.height = h + suffix;

      if ( target.width !== w )

        target.width = w + suffix;

      if ( is2D && !context.autoclear && context.retina )

        context.scale( ratio, ratio );

      if ( setup ) trigger( context.resize );
    }

    function align( touch, target ) {

      bounds = target.getBoundingClientRect();

      touch.x = touch.pageX - bounds.left - (win.scrollX || win.pageXOffset);
      touch.y = touch.pageY - bounds.top - (win.scrollY || win.pageYOffset);

      return touch;
    }

    function augment( touch, target ) {

      align( touch, context.element );

      target = target || {};

      target.ox = target.x || touch.x;
      target.oy = target.y || touch.y;

      target.x = touch.x;
      target.y = touch.y;

      target.dx = target.x - target.ox;
      target.dy = target.y - target.oy;

      return target;
    }

    function process( event ) {

      event.preventDefault();

      copy = clone( event );
      copy.originalEvent = event;

      if ( copy.touches ) {

        touches.length = copy.touches.length;

        for ( index = 0; index < copy.touches.length; index++ )

          touches[ index ] = augment( copy.touches[ index ], touches[ index ] );

      } else {

        touches.length = 0;
        touches[0] = augment( copy, mouse );
      }

      extend( mouse, touches[0], true );

      return copy;
    }

    function pointer( event ) {

      event = process( event );

      min = ( max = eventMap.indexOf( type = event.type ) ) - 1;

      context.dragging =

        /down|start/.test( type ) ? true :

        /up|end/.test( type ) ? false :

        context.dragging;

      while( min )

        isString( eventMap[ min ] ) ?

          trigger( context[ eventMap[ min-- ] ], event ) :

        isString( eventMap[ max ] ) ?

          trigger( context[ eventMap[ max++ ] ], event ) :

        min = 0;
    }

    function keypress( event ) {

      key = event.keyCode;
      val = event.type == 'keyup';
      keys[ key ] = keys[ keyName( key ) ] = !val;

      trigger( context[ event.type ], event );
    }

    function active( event ) {

      if ( context.autopause )

        ( event.type == 'blur' ? stop : start )();

      trigger( context[ event.type ], event );
    }

    // Public API

    function start() {

      context.now = +new Date();
      context.running = true;
    }

    function stop() {

      context.running = false;
    }

    function toggle() {

      ( context.running ? stop : start )();
    }

    function clear() {

      if ( is2D )

        context.clearRect( 0, 0, context.width * ratio, context.height * ratio );
    }

    function destroy() {

      parent = context.element.parentNode;
      index = instances.indexOf( context );

      if ( parent ) parent.removeChild( context.element );
      if ( ~index ) instances.splice( index, 1 );

      bind( false );
      stop();
    }

    extend( context, {

      touches: touches,
      mouse: mouse,
      keys: keys,

      dragging: false,
      running: false,
      millis: 0,
      now: NaN,
      dt: NaN,

      destroy: destroy,
      toggle: toggle,
      clear: clear,
      start: start,
      stop: stop
    });

    instances.push( context );

    return ( context.autostart && start(), bind( true ), resize(), update(), context );
  }
9261
function(method, args){
      _.each(this._elements, function(elem){
        if (_.isFunction(elem[method])){
          elem[method].apply(elem, args || []);
        }
      });
    }
1113896
def define_method(methodname, prototype)
      m = Method.new(methodname)
      m.from_prototype(prototype)
      define(m)
    end
817045
function onceConnected( error, methods ) {

  if( !error ) {
    console.log( 'Connected to %s. There are %d methods available.', this.get( 'url' ), this.get( 'methods' ).length );
  }

  if( error ) {
    console.error( error.message );
  }

}
353293
function(parent, protoProps, staticProps) {
  var child;

  // The constructor function for the new subclass is either defined by you
  // (the "constructor" property in your extend definition), or defaulted
  // by us to simply call the parent's constructor.
  if (protoProps && protoProps.hasOwnProperty('constructor')) {
    child = protoProps.constructor;
  } else {
    child = function(){ parent.apply(this, arguments); };
  }

  // Inherit class (static) properties from parent.
  copyProps(child, parent);

  // Set the prototype chain to inherit from parent, without calling
  // parent's constructor function.
  ctor.prototype = parent.prototype;
  child.prototype = new ctor();

  // Add prototype properties (instance properties) to the subclass,
  // if supplied.
  if (protoProps) copyProps(child.prototype, protoProps);

  // Add static properties to the constructor function, if supplied.
  if (staticProps) copyProps(child, staticProps);

  // Correctly set child's 'prototype.constructor'.
  child.prototype.constructor = child;

  // Set a convenience property in case the parent's prototype is needed later.
  child.__super__ = parent.prototype;

  return child;
}