the new constructor behaviour
543194
function () {
                    var args = [];
                    for (var _i = 0; _i < arguments.length; _i++) {
                        args[_i] = arguments[_i];
                    }
                    this.testCategory = name;
                    return construct(original, args);
                }
8651
private function checkCallConstraints(): void
    {
        if ($this->alreadyConstructed) {
            throw new ImmutabilityViolationException(\sprintf(
                'Class %s constructor was already called',
                static::class
            ));
        }

        $stack = \debug_backtrace();
        while (\count($stack) > 0 && $stack[0]['function'] !== 'checkImmutability') {
            \array_shift($stack);
        }

        if (!isset($stack[1]) || $stack[1]['function'] !== '__construct') {
            throw new ImmutabilityViolationException(\sprintf(
                'Immutability check can only be called from constructor, called from %s::%s',
                static::class,
                $stack[1]['function']
            ));
        }

        $this->alreadyConstructed = true;
    }
224994
public static void newObj(
			Object created,
			String createdClass,
			String callerClass,
			String callerMethod,
			int callerValKind,
			Object caller) {
		System.err.println("newObj("+
				"created="+created+", "+
				"createdClass="+createdClass+", "+
				"callerClass="+callerClass+", "+
				"callerMethod="+callerMethod+", "+
				"callerValKind="+valKindToString(callerValKind)+", "+
				"caller="+caller+", "+
				")");
	}
349763
function construct(constructor) {
            // Create constructor
            var c = function () {
                return constructor.apply(this);
            };
            // Assign prototype
            c.prototype = constructor.prototype;
            // Create new instance
            return service_factory_1.ServiceFactory.export(c, name, context);
        }
59683
function construct(constructor, args) {
            var c = function () {
                return constructor.apply(this, args);
            };
            c.prototype = constructor.prototype;
            return new c();
        }
671738
function at_method(isConstructor) {
  if (isConstructor) {
    match(/@constructor\b/);
    add_tag("method");
    add_tag("Constructor");
    skip_white();
  }
  else {
    match(/@method/);
    add_tag("method");
    maybe_name();
    skip_white();
  }
}
499010
function init(entry) {  // {{{2
/**
 * Class constructor
 *
 * @param entry {Object} Entry instance
 *
 * @method constructor
 */

//  console.log('ENTRY SLAVE CONSTRUCTOR', entry.id);

  this.entry = entry;

  if (entry.slaves) {
    this.slaveId = ++entry.slaveId;
  } else {
    entry.slaves = {};
    this.slaveId = entry.slaveId = 1;
  }

  entry.slaves[this.slaveId] = this;
}
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;
		});
	}
1213442
function (name) {
        if (JOII.Config.constructors.indexOf(name) !== -1) {
            return;
        }

        JOII.Config.constructors.push(name);
    }
352304
@Override
    public void initialise()
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "initialise", this);

        createInputHandlersForPtoP();

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "initialise");
    }
784551
function(constructor, desc){
        var name = constructor.name;
        this.assert(
            this.obj instanceof constructor
            , function(){ return 'expected ' + this.inspect + ' to be an instance of ' + name + (desc ? " | " + desc : "") }
            , function(){ return 'expected ' + this.inspect + ' not to be an instance of ' + name + (desc ? " | " + desc : "") });
        return this;
    }
1169929
function applyNew(args) {
        // create an object with ctor's prototype but without
        // calling ctor on it.
        var ctor = args.callee, t = forceNew(ctor);
        // execute the real constructor on the new object
        ctor.apply(t, args);
        return t;
    }
531999
def patch_constructor(model):
    
    old_init = model.__init__

    def new_init(self, *args, **kwargs):
        self._mt_init = True
        populate_translation_fields(self.__class__, kwargs)
        for key, val in list(kwargs.items()):
            new_key = rewrite_lookup_key(model, key)
            # Old key is intentionally left in case old_init wants to play with it
            kwargs.setdefault(new_key, val)
        old_init(self, *args, **kwargs)
    model.__init__ = new_init
1225196
def new(cls, ver_key: VerKey, sign_key: SignKey) -> 'ProofOfPossession':
        
        logger = logging.getLogger(__name__)
        logger.debug("ProofOfPossession::new: >>>")

        c_instance = c_void_p()
        do_call(cls.new_handler, ver_key.c_instance, sign_key.c_instance, byref(c_instance))

        res = cls(c_instance)

        logger.debug("ProofOfPossession::new: <<< res: %r", res)
        return res
970100
function newInstance(extend) {
  return (initialValues = {}) => {
    const model = {};
    const publicAPI = {};
    extend(publicAPI, model, initialValues);
    return Object.freeze(publicAPI);
  };
}
893037
function(constructorFunction) {
    if(!constructorFunction) throw new Error('Constructor function argument must be non-null function');

    var Structure = function() {
      if(!(this instanceof Structure)) {
        var instance = new Structure();
        constructorFunction.apply(instance, arguments);
        return instance;
      }
      constructorFunction.apply(this, arguments);
    };

    return Structure;
  }
1133095
function constructas(Type, o) {
		if (!gui.debug || edb.Type.isConstructor(Type)) {
			if (edb.Type.is(o)) {
				if (Type.is(o)) {
					return o;
				} else {
					fail(Type, o);
				}
			} else {
				return new Type(o);
			}
		} else {
			fail('edb.Type', Type);
		}
	}