https://xhr.spec.whatwg.org/#constructors
7772
function XMLHttpRequest() {
  EventTarget.call(this, events);

  this.readyState;

  if (support.xhr.timeout) {
    this.timeout = 0;
  }

  if (support.xhr.cors) {
    this.withCredentials = false;
  }

  this.upload;
  this.responseType = '';
  this.responseText = '';
  this.responseXML = null;
  this.readyState = states.UNSENT;

  if (support.xhr.response) {
    this.response = '';
  }

  if (support.xhr.responseURL) {
    this.responseURL = '';
  }

  this.status = 0;
  this.statusText = '';
}
460333
function(httpAdapter, options) {
  if (!this.constructor.name) {
    throw new Error('The Constructor must be named');
  }

  this.name = formatGeocoderName(this.constructor.name);

  if (!httpAdapter || httpAdapter == 'undefined') {
    throw new Error(this.constructor.name + ' need an httpAdapter');
  }
  this.httpAdapter = httpAdapter;

  if (!options || options == 'undefined') {
    options = {};
  }

  if (this.options) {
    this.options.forEach(function(option) {
      if (!options[option] || options[option] == 'undefined') {
        options[option] = null;
      }
    });
  }

  this.options = options;
}
157246
public function compile()
    {
        $indent    = '    ';
        $getters   = array();
        $instances = $this->dumper->getAllInjectedDefinitions();

        /* @var $instance GeneratorInstance */
        foreach ($instances as $name => $instance) {
            $constructor = $instance->getConstructor();
            $instantiatorParams = $this->buildParams($instance->getParams());

            if ('__construct' !== $constructor) {
                // Constructor callback
                if (is_callable($constructor)) {
                    $callback = $constructor;

                    if (is_array($callback)) {
                        $class = (is_object($callback[0])) ? get_class($callback[0]) : $callback[0];
                        $method = $callback[1];
                    } elseif (is_string($callback) && strpos($callback, '::') !== false) {
                        list($class, $method) = explode('::', $callback, 2);
                    }

                    $callback = var_export(array($class, $method), true);

                    if (count($instantiatorParams)) {
                        $creation = sprintf('$object = call_user_func(%s, %s);', $callback, implode(', ', $instantiatorParams));
                    } else {
                        $creation = sprintf('$object = call_user_func(%s);', $callback);
                    }
                } else if (is_string($constructor) && strpos($constructor, '->') !== false) {
                    list($class, $method) = explode('->', $constructor, 2);

                    if (!class_exists($class)) {
                        throw new InvalidArgumentException('No class found: ' . $class);
                    }

                    if (count($instantiatorParams)) {
                        $creation = sprintf(
                            '$object = $di->get(%s)->%s(%s);',
                            var_export($class, true),
                            $method,
                            implode(', ', $instantiatorParams)
                        );
                    } else {
                        $creation = sprintf('$object = $di->get(%s)->%s();', var_export($class, true), $method);
                    }
                } else {
                    throw new InvalidArgumentException('Invalid instantiator supplied for class: ' . $name);
                }
            } else {
                $className = '\\' . trim($this->reduceAlias($name), '\\');

                if (count($instantiatorParams)) {
                    $creation = sprintf('$object = new %s(%s);', $className, implode(', ', $instantiatorParams));
                } else {
                    $creation = sprintf('$object = new %s();', $className);
                }
            }


            // Create method call code
            if ($instance->isShared()) {
                $creation .= "\n\nif (\$isShared) {\n" . $indent
                    . '$di->instanceManager()->addSharedInstance($object, \'' . $instance->getName() . '\');'
                    . "\n}\n";
            }

            $methods = '';

            foreach ($instance->getMethods() as $methodData) {
                $methodName   = $methodData['method'];
                $methodParams = $methodData['params'];
                // Create method parameter representation
                $params = $this->buildParams($methodParams);

                if (count($params)) {
                    $methods .= sprintf("\$object->%s(%s);\n", $methodName, implode(', ', $params));
                }
            }

            // Start creating getter
            $getterBody = "function (\\Zend\\Di\\Di \$di, \$isShared) {\n";

            // Creation and method calls
            $getterBody .= $indent . str_replace("\n", "\n" . $indent, $creation) . "\n";
            $getterBody .= $indent . str_replace("\n", "\n" . $indent, $methods);

            // End getter body
            $getterBody .= "\n" . $indent . "return \$object;\n}";

            $getters[$name] = $getterBody;
        }

        $fileBody = "return array(\n";

        foreach ($getters as $name => $getterBody) {
            $fileBody .= $indent . var_export($name, true);
            $fileBody .= ' => ' . str_replace("\n", "\n" . $indent, $getterBody) . ",\n\n";
        }

        $fileBody .= ");\n";

        // Create PHP file code generation object
        $generator = $this->getFileGenerator();
        $generator->setBody($fileBody);

        return $generator;
    }
534038
function construct() {
      var args = Array.prototype.slice.call(arguments);
      function Fn() {
        return main.Type.apply(this, args);
      }
      Fn.prototype = main.Type.prototype;
      return new Fn();
    }
197837
private static Object[] makeStubForConstructor(final Class<?>[] constructorParamTypes) {
    if (constructorParamTypes.length == 0) {
      return EMPTY_OBJECT_ARRAY;
    }
    final Object[] result = new Object[constructorParamTypes.length];
    for (int i = 0; i < constructorParamTypes.length; i++) {
      final Class<?> arg = constructorParamTypes[i];
      final Object obj;
      if (arg.isArray()) {
        obj = null;
      } else {
        if (arg == byte.class) {
          obj = (byte) 0;
        } else if (arg == char.class) {
          obj = 'a';
        } else if (arg == short.class) {
          obj = (short) 0;
        } else if (arg == boolean.class) {
          obj = Boolean.FALSE;
        } else if (arg == int.class) {
          obj = 0;
        } else if (arg == long.class) {
          obj = 0L;
        } else if (arg == double.class) {
          obj = 0.0d;
        } else if (arg == float.class) {
          obj = 0.0f;
        } else {
          obj = null;
        }
      }
      result[i] = obj;
    }
    return result;
  }
692846
def describe_constructor(self, s):
        
        method = self.signatures.get(b"__constructor__")
        if not method:
            # constructor not available
            m = AbiMethod({"type": "constructor", "name": "", "inputs": [], "outputs": []})
            return m

        types_def = method["inputs"]
        types = [t["type"] for t in types_def]
        names = [t["name"] for t in types_def]

        if not len(s):
            values = len(types) * ["<nA>"]
        else:
            values = decode_abi(types, s)

        # (type, name, data)
        method.inputs = [{"type": t, "name": n, "data": v} for t, n, v in list(
            zip(types, names, values))]
        return method
730723
function (parent,config,modulePath,npmPath,classesSource)
	{
		this.e.log&&this.e.log('Constructing new `'+this.className+'`...','system');

		if (modulePath==undefined)
			modulePath = cwd;

		try {
			this.setParent(parent);
		} catch (e)
		{
			if (e)
				console.log(this);
		}

		this.setModulePath(path.resolve(path.resolve(parent.modulePath,modulePath))+'/');

		this.preinit.apply(this,arguments); 

		this.npmPath = npmPath || [];
		this.importClasses(classesSource);

		var defaultConfig = cwd+sourcePath+'config/'+className.split('_')[0]+'Config.json';
		if (fs.existsSync(defaultConfig))
			this.configureFromFile(defaultConfig);
		if (fs.existsSync(this.modulePath + this.configFile))
			this.configureFromFile(this.modulePath + this.configFile);
		if (config)
			this.setConfig(config);

		_debug = this.getConfig('debug')===true;

		this.importPackages();
		this.importFromConfig();

		Object.defineProperty(this,'c',{ value: this.getComponent('classBuilder').classes, enumerable:false, writable: false });
		this.c.module = self;

		this.preloadEvents();
		this.preloadComponents();

		this.setEvents({ 'ready': {} });
		var ready=this.getEvent('ready');
		ready.once(function (e) {
			self.startComponents();
			self.prepareModels();
			self.prepareScripts();

			self.init.apply(self,arguments);
			self.run.apply(self,arguments);
			_initialized=true;
		});
	}
228644
def multi_constructor(loader, tag_suffix, node):
    
    yaml_src = yaml.serialize(node)
    mapping = loader.construct_mapping(node)
    if '.' not in tag_suffix:
        classname = tag_suffix
        rval = ObjectProxy(classname, mapping, yaml_src)
    else:
        classname = try_to_import(tag_suffix)
        rval = ObjectProxy(classname, mapping, yaml_src)

    return rval
664361
function ___wrapConstructor(constructorInner, name) {

    var proto = constructorInner.prototype;
    var inner = (function(p) {
        function f() {};
        f.prototype = p.prototype;
        return new f;
    })(proto);

    function Outer() {
        constructorInner.apply(this, arguments);
        let that = this;

        var loop = function(key){
            if (proto.hasOwnProperty(key) && typeof proto[key] === 'function') {
                that[key] = function () { 
                    return ___call(proto[key], name + '.' + key, that, arguments); 
                }
            }
        };

        for (var key in proto) {
            loop(key);
        }
    }

    Outer.prototype = inner;
    return Outer;
}
613929
def intrinsics_multi_constructor(loader, tag_prefix, node):
    

    # Get the actual tag name excluding the first exclamation
    tag = node.tag[1:]

    # Some intrinsic functions doesn't support prefix "Fn::"
    prefix = "Fn::"
    if tag in ["Ref", "Condition"]:
        prefix = ""

    cfntag = prefix + tag

    if tag == "GetAtt" and isinstance(node.value, six.string_types):
        # ShortHand notation for !GetAtt accepts Resource.Attribute format
        # while the standard notation is to use an array
        # [Resource, Attribute]. Convert shorthand to standard format
        value = node.value.split(".", 1)

    elif isinstance(node, ScalarNode):
        # Value of this node is scalar
        value = loader.construct_scalar(node)

    elif isinstance(node, SequenceNode):
        # Value of this node is an array (Ex: [1,2])
        value = loader.construct_sequence(node)

    else:
        # Value of this node is an mapping (ex: {foo: bar})
        value = loader.construct_mapping(node)

    return {cfntag: value}
221215
private static Object[] buildConstructionData(Constructor<?> constructor) {
        Class<?>[] parameterTypes = constructor.getParameterTypes();
        Object[] args = new Object[parameterTypes.length];
        for (int i = 0; i < parameterTypes.length; i++) {
            if (parameterTypes[i] == boolean.class) {
                args[i] = false;
            } else if (parameterTypes[i] == int.class) {
                args[i] = (int) 0;
            } else if (parameterTypes[i] == long.class) {
                args[i] = (long) 0;
            } else if (parameterTypes[i] == short.class) {
                args[i] = (short) 0;
            } else if (parameterTypes[i] == byte.class) {
                args[i] = (byte) 0;
            } else if (parameterTypes[i] == float.class) {
                args[i] = (float) 0;
            } else if (parameterTypes[i] == double.class) {
                args[i] = (double) 0;
            } else if (parameterTypes[i] == char.class) {
                args[i] = (char) 0;
            }
        }
        return args;
    }
262560
function init() {
			/* jshint validthis: true */
			// All construction is actually done in the init method.
			if (!initializing) {
				//!steal-remove-start
				if(process.env.NODE_ENV !== 'production') {
					if(!this || (this.constructor !== Constructor) &&
					// We are being called without `new` or we are extending.
					arguments.length && Constructor.constructorExtends) {
						dev.warn('can/construct/construct.js: extending a Construct without calling extend');
					}
				}
				//!steal-remove-end

				return (!this || this.constructor !== Constructor) &&
				// We are being called without `new` or we are extending.
				arguments.length && Constructor.constructorExtends ? Constructor.extend.apply(Constructor, arguments) :
				// We are being called with `new`.
				Constructor.newInstance.apply(Constructor, arguments);
			}
		}
688749
@Override
    public void constructorFactory(Sink sink, String dataTypeName, String factoryName, List<String> typeParametrs, Constructor constructor) {
        if (constructor.args.isEmpty()) {
        	if (typeParametrs.isEmpty()) {
            	logger.finest("Generating no args, no types factory for " + constructor.name);
        	} else {
            	logger.finest("Generating no args, type arguments factory for " + constructor.name);
        		sink.write("   @SuppressWarnings(\"rawtypes\")\n");
        	}
            sink.write("   private static final " + dataTypeName + " _" + factoryName + " = new " + constructor.name + "();\n");
            sink.write(ASTPrinter.printComments("   ", commentProcessor.leftAlign(commentProcessor.javaDocOnly(constructor.comments))));
        	if (!typeParametrs.isEmpty()) {
        		sink.write("   @SuppressWarnings(\"unchecked\")\n");
        	}
        	sink.write("   public static final ");
        	emitParameterizedTypeName(sink, typeParametrs);
        	sink.write(" ");
        	sink.write(dataTypeName);
        	emitParameterizedTypeName(sink, typeParametrs);
        	sink.write(" _" + factoryName + "() { return _" + factoryName + "; }");
        } else {
        	logger.finest("Generating args factory for " + constructor.name);
            sink.write(ASTPrinter.printComments("   ", commentProcessor.leftAlign(constructor.comments)));
            sink.write("   public static final ");
            emitParameterizedTypeName(sink, typeParametrs);
        	sink.write(" ");
        	sink.write(dataTypeName);
            emitParameterizedTypeName(sink, typeParametrs);
            sink.write(" _" + factoryName + "(");
            constructorArgs(sink, constructor, true);
            sink.write(") { return new " + constructor.name);
            emitParameterizedTypeName(sink, typeParametrs);
            sink.write("("); 
            constructorArgs(sink, constructor, false);
            sink.write("); }");            
        }
    }
619316
function Emitter(constructor) {
  if("function" == typeof constructor) {
    constructor(emit)
  }else{
    constructor = null
  }
  
  var listeners = []

  // emitter(listener:Function) -> removeListener:Function
  // emitter() -> emitter:function
  var emitter = function (listener) {
    // emitter() -> emitter:function
    if(!listener) {
      return emitter
    }
    // emitter(listener:Function) -> removeListener:Function
    if("function" !== typeof listener) {
      throw new Error('Listener must be a function')
    }
    var newLength = listeners.push(listener)
      , index = newLength-1
      , removed = false
    
    return function removeListener() {
      if(removed) return
      removed = true
      listeners.splice(index, 1)
    }
  }
  
  if(!constructor) {
    // emitter.emit(args...)
    emitter.emit = emit
  }
  
  return emitter
  
  function emit() {
    var args = arguments
    listeners.forEach(function(listener) {
      listener.apply(null, args)
    })
  }
}
708035
function (/* [predicate, ] iterator */) { var iterator  = _.last (arguments),
                                                               predicate = (arguments.length === 1 ? _.constant (true) : arguments[0])
        var methods = []
        for (var k in this) {
            var def = this.constructor.$definition[k]
            if ($property.isNot (def)) { var fn = this[k]
                if (_.isFunction (fn) && !_.isPrototypeConstructor (fn) && predicate (def))  {
                    this[k] = iterator.call (this, fn, k, def) || fn } } } }
989271
@Deprecated
    private T build(Constructor<T> constructor, Object[] args) {
        try {
            return constructor.newInstance(args);

        } catch (IllegalArgumentException | IllegalAccessException | InstantiationException ex) {
            throw new IllegalArgumentException(
                    "Bean cannot be created: " + beanName() + " from " + Arrays.toString(args), ex);
        } catch (InvocationTargetException ex) {
            if (ex.getCause() instanceof RuntimeException) {
                throw (RuntimeException) ex.getCause();
            }
            throw new RuntimeException(ex);
        }
    }
109639
function(attrs, buffer){
    var res = compileAttrs(attrs, {
      terse: this.terse,
      format: buffer ? 'html' : 'object',
      runtime: this.runtime.bind(this)
    });
    return res;
  }