Defines a method with name _id_ and a given _prototype_ in the
 interface.
974868
def define_method(id, prototype)
      m = Method.new(id)
      m.from_prototype(prototype)
      define(m)
    end
1112774
function prototypeize(fn, name = fn.name) {
  if (name) { // IE11 does not support name
    defineProperty(prototype, name, {
      get: function() { return fn(this); }
    });
  }
}
878137
function define (prop, prototype) {
  Object.defineProperty(prototype, prop, {
      enumerable: true
    , get: function ( ) { return this.get.call(this._scope || this, prop); }
    , set: function (v) { return this.set.call(this._scope || this, prop, v); }
  });
}
1336458
def define_methods_into(client)
      links.each do |link|
        @client.define_singleton_method(link.method_signature) do |params = {}, headers = {}|
          Request.call(client: client, headers: headers, link: link, params: params)
        end
      end
    end
655760
function (p, def) {
                // The prototype should be an instance of Template, that inheriths from BaseTemplate
                p.$BaseTemplate.constructor.classDefinition.$prototype.$init(p, def);

                // copy the prototype of ITemplate:
                var itf = ITemplate.prototype;
                for (var key in itf) {
                    if (itf.hasOwnProperty(key) && !p.hasOwnProperty(key)) {
                        // copy methods which are not already on this object (this avoids copying $classpath and
                        // $destructor)
                        p[key] = itf[key];
                    }
                }

                // get shortcuts to necessary functions in other classes,
                // so that templates work even in a sandbox
                p.$json = require('../utils/Json');
            }
442748
function(name, protocols, requiredInstanceMethodDefs, requiredClassMethodDefs)
{
    this.name = name;
    this.protocols = protocols;
    if (requiredInstanceMethodDefs)
        this.requiredInstanceMethods = requiredInstanceMethodDefs;
    if (requiredClassMethodDefs)
        this.requiredClassMethods = requiredClassMethodDefs;
}
265290
function extend(d, element) {
    var map = Object.keys(element.prototype).reduce(function (descriptors, key) {
        descriptors[key] = Object.getOwnPropertyDescriptor(element.prototype, key);
        return descriptors;
    }, {});
    Object.defineProperties(d, map);
}
984529
function _gpfDefineInterface(name, definition) {
        var interfaceDefinition = { $interface: "gpf.interfaces.I" + name };
        Object.keys(definition).forEach(function (methodName) {
            interfaceDefinition[methodName] = _gpfCreateAbstractFunction(definition[methodName]);
        });
        return _gpfDefine(interfaceDefinition);
    }
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];
	}
}
19638
function (name, params) {
                var newInstance = Object.create(BABYLON.Tools.Instantiate("BABYLON." + name).prototype);
                newInstance.constructor.apply(newInstance, params);
                return newInstance;
            }
815152
function (name) { var self = this

        //console.log ('callChainMethod', this.constructor.$meta.name, name)

        const methods = _.filter2 (this.constructor.$traits || [], function (Trait) {

                                                                        var method = Trait.prototype[name]

                                                                        // if (method) {
                                                                        //     return (...args) => {
                                                                        //         console.log ('Calling', Trait.$meta.name, name)
                                                                        //         return method.call (self, ...args)
                                                                        //     }
                                                                        // }

                                                                        return (method && method.bind (self)) || false })

        return __.seq (methods) }
808116
def create_id(self, prefix="guid"):
        
        if self.method == IDGenerator.METHOD_UUID:
            id_ = str(uuid.uuid4())
        elif self.method == IDGenerator.METHOD_INT:
            id_ = self.next_int
            self.next_int += 1
        else:
            raise InvalidMethodError(self.method)

        return "%s:%s-%s" % (self.namespace.prefix, prefix, id_)
207140
def init ( method )
      raise TypeError, error_message(method, __method__) unless method.instance_of? Method
      @init = method
    end
272425
function defineIteratorMethods(prototype) {                                                              // 92
    ["next", "throw", "return"].forEach(function(method) {                                                 // 93
      prototype[method] = function(arg) {                                                                  // 94
        return this._invoke(method, arg);                                                                  // 95
      };                                                                                                   // 96
    });                                                                                                    // 97
  }
915200
function(name,shim){
    var constructor = window[name];
    if (!constructor)
        constructor = window[name] = shim.interface;
    delete shim.interface;
    var proto = constructor && constructor.prototype;
    if (shim.prototype) {
        proto = constructor.prototype = shim.prototype;
        delete shim.prototype;
    }
    
    window.console&&console.log("adding interface ", name);
    
    if (shim.hasOwnProperty("constructor")) {
        window[name] = constructor = shim.constructor;
        proto && (shim.constructor.prototype = proto);
        delete shim.constructor;
    }
}
1267608
def create_unknown_with_method(name)
      definition = Definition::RubyObject.create_unknown

      definition.send("define_#{@method_type}", name)

      return definition
    end
732489
function () {

        var A = $prototype ({ toString: function () {} })
        var B = $extends (A)
        var C = $prototype ()

        $assert ([$prototype.defines (B, 'toString'),
                  $prototype.defines (C, 'toString')], [true, false]) }