code: function chainedConstructor(bases, ctorSpecial) {
          return function () {
              var a = arguments, args = a, a0 = a[0], f, i, m,
                  l = bases.length, preArgs;
  
              if (!(this instanceof a.callee)) {
                  // not called via new, so force it
                  return applyNew(a);
              }
  
              //this._inherited = {};
              // perform the shaman's rituals of the original dojo.declare()
              // 1) call two types of the preamble
              if (ctorSpecial && (a0 && a0.preamble || this.preamble)) {
                  // full blown ritual
                  preArgs = new Array(bases.length);
                  // prepare parameters
                  preArgs[0] = a;
                  for (i = 0; ;) {
                      // process the preamble of the 1st argument
                      a0 = a[0];
                      if (a0) {
                          f = a0.preamble;
                          if (f) {
                              a = f.apply(this, a) || a;
                          }
                      }
                      // process the preamble of this class
                      f = bases[i].prototype;
                      f = f.hasOwnProperty("preamble") && f.preamble;
                      if (f) {
                          a = f.apply(this, a) || a;
                      }
                      // one peculiarity of the preamble:
                      // it is called if it is not needed,
                      // e.g., there is no constructor to call
                      // let's watch for the last constructor
                      // (see ticket #9795)
                      if ((i += 1) === l) {
                          break;
                      }
                      preArgs[i] = a;
                  }
              }
              // 2) call all non-trivial constructors using prepared arguments
              for (i = l - 1; i >= 0; i -= 1) {
                  f = bases[i];
                  m = f._meta;
                  f = m ? m.ctor : f;
                  if (f) {
                      f.apply(this, preArgs ? preArgs[i] : a);
                  }
              }
              // 3) continue the original ritual: call the postscript
              f = this.postscript;
              if (f) {
                  f.apply(this, args);
              }
          };
      }
docs: chained constructor compatible with the legacy dojo.declare()