@@ -13109,12 +13109,16 @@ Clazz.new = function(c, args, cl) {
1310913109
1311013110 // an inner class will attach arguments to the arguments returned
1311113111 // Integer will be passed as is here, without c.exClazz, or cl
13112+ var clInner = cl;
1311213113 cl = cl || c.exClazz || c;
1311313114 cl.$clinit$ && cl.$clinit$();
1311413115 var f = new (Function.prototype.bind.apply(cl, arguments));
13115- if (haveArgs && args[2] != inheritArgs) {
13116- cl.$init0$ && cl.$init0$.apply(f);
13117- c.apply(f, args);
13116+ if (args[2] != inheritArgs) {
13117+ // cl.$init0$ && cl.$init0$.apply(f);
13118+ if (haveArgs) {
13119+ c.apply(f, args);
13120+ }
13121+ clInner && clInner.$init$.apply(f);
1311813122 }
1311913123
1312013124 _profileNew && addProfileNew(myclass, window.performance.now() - t0);
@@ -13143,7 +13147,7 @@ Clazz.super = function(cl, obj, andInit) {
1314313147 }
1314413148}
1314513149
13146- Clazz.newInstance$ = function (objThis, args, isInner) {
13150+ Clazz.newInstance$ = function (objThis, args, isInner, clazz ) {
1314713151 if (args && (
1314813152 args[0] == inheritArgs
1314913153 || args[1] == inheritArgs
@@ -13164,6 +13168,8 @@ Clazz.newInstance$ = function (objThis, args, isInner) {
1316413168
1316513169 objThis.__JSID__ = ++_jsid;
1316613170
13171+ clazz && clazz.$init0$ && clazz.$init0$.apply(objThis);
13172+
1316713173 if (!isInner) {
1316813174 if ((!args || args.length == 0) && objThis.c$) {
1316913175 // allow for direct default call "new foo()" to run with its default constructor
@@ -13234,7 +13240,7 @@ Clazz.defineStatics$ = function(cl, a) {
1323413240
1323513241Clazz.newMethod$ = function (clazzThis, funName, funBody, isStatic) {
1323613242 if (arguments.length == 1) {
13237- return Clazz.newMethod$(clazzThis, 'c$', function(){Clazz.super(clazzThis, this,1);}, 1);
13243+ return Clazz.newMethod$(clazzThis, 'c$', function(){Clazz.super(clazzThis, this,1);clazzThis.$init$.apply(this) }, 1);
1323813244 }
1323913245 if (funName.constructor == Array) {
1324013246 // If funName is an array, we are setting aliases for generic calls.
@@ -13618,7 +13624,7 @@ Clazz.newClass$ = function (prefix, name, clazz, clazzSuper, interfacez, type) {
1361813624 var qualifiedName = (prefix ? (prefix.__PKG_NAME__ || prefix.__CLASS_NAME__) + "." : "") + name;
1361913625 checkDeclared(qualifiedName, type);
1362013626 }
13621- clazz || (clazz = function () {Clazz.newInstance$(this,arguments)});
13627+ clazz || (clazz = function () {Clazz.newInstance$(this,arguments,0,clazz )});
1362213628 clazz.__NAME__ = name;
1362313629 clazz.$load$ = [clazzSuper, interfacez];
1362413630
@@ -14037,6 +14043,7 @@ var extendObject = function(clazz, exclude) {
1403714043var excludeSuper = function(o) {
1403814044 return o == "b$"
1403914045 || o == "$init$"
14046+ || o == "$init0$"
1404014047 || o == "$clinit$"
1404114048 || o == "$load$"
1404214049 || o == "c$"
@@ -14066,9 +14073,8 @@ var finalizeClazz = function(clazz, qname, bname, type, isNumber) {
1406614073 (type == 1) && (clazz.__ANON = clazz.prototype.__ANON = 1);
1406714074 (type == 2) && (clazz.__LOCAL = clazz.prototype.__LOCAL = 1);
1406814075
14069- if (!isNumber && type != 0) {
14076+ if (!isNumber && type != 0)
1407014077 Clazz.newMethod$(clazz, '$init0$', function(){var c;if ((c=clazz.superClazz) && (c = c.$init0$))c.apply(this);}, 1);
14071- }
1407214078 extendPrototype(clazz);
1407314079
1407414080};
0 commit comments