src/basis/dom/wrapper.js
function(){
    // this -> {
    //   owner: owner,
    //   name: satelliteName,
    //   config: satelliteConfig,
    //   instance: satelliteInstance or null,
    //   instanceRA_: ResolveAdapter or null,
    //   existsRA_: ResolveAdapter or null
    //   factoryType: 'value' or 'class'
    //   factory: class or any
    // }
    var name = this.name;
    var config = this.config;
    var owner = this.owner;

    var exists = ('existsIf' in config == false) || config.existsIf(owner);

    if (resolveValue(this, SATELLITE_UPDATE, exists, 'existsRA_'))
    {
      var satellite = this.instance || config.instance;

      if (!satellite || this.factoryType == 'value')
      {
        if (!this.factoryType)
        {
          var instanceValue = config.getInstance;
          var instanceClass = config.instanceClass;

          if (typeof instanceValue == 'function')
          {
            instanceValue = instanceValue.call(owner, owner);
            if (Class.isClass(instanceValue))
              instanceClass = processInstanceClass(instanceValue);
          }

          this.factoryType = instanceClass ? 'class' : 'value';
          this.factory = instanceClass || instanceValue;
        }

        if (this.factoryType == 'class')
        {
          var satelliteConfig = {
            destroy: warnOnAutoSatelliteDestoy // auto-create satellite marker, lock destroy method invocation
          };

          if (config.delegate)
          {
            satelliteConfig.autoDelegate = false;
            satelliteConfig.delegate = config.delegate(owner);
          }

          if (config.dataSource)
            satelliteConfig.dataSource = config.dataSource(owner);

          if (config.config)
            basis.object.complete(satelliteConfig, typeof config.config == 'function'
              ? config.config(owner)
              : config.config
            );

          this.instance = new this.factory(satelliteConfig);
          owner.setSatellite(name, this.instance, true);

          /** @cut */ var loc = basis.dev.getInfo(config, 'loc');
          /** @cut */ if (loc)
          /** @cut */   basis.dev.setInfo(this.instance, 'loc', loc);

          return;
        }

        // factoryType == 'value'
        satellite = resolveAbstractNode(this, SATELLITE_UPDATE, this.factory, 'instanceRA_');
      }

      if (this.instance !== satellite)
      {
        this.instance = satellite || null;
        owner.setSatellite(name, this.instance, true);
      }

      if (satellite && satellite.owner === owner)
      {
        if (config.delegate)
          satellite.setDelegate(config.delegate(owner));

        if (config.dataSource)
          satellite.setDataSource(config.dataSource(owner));
      }
    }
    else
    {
      var satellite = this.instance;
      if (satellite)
      {
        if (config.instance)
        {
          if (config.delegate)
            satellite.setDelegate();

          if (config.dataSource)
            satellite.setDataSource();
        }

        this.instance = null;
        owner.setSatellite(name, null, true);
      }
    }
  }
function(){
    // this -> {
    //   owner: owner,
    //   name: satelliteName,
    //   config: satelliteConfig,
    //   instance: satelliteInstance or null,
    //   instanceRA_: ResolveAdapter or null,
    //   existsRA_: ResolveAdapter or null
    //   factoryType: 'value' or 'class'
    //   factory: class or any
    // }
    var name = this.name;
    var config = this.config;
    var owner = this.owner;

    var exists = ('existsIf' in config == false) || config.existsIf(owner);

    if (resolveValue(this, SATELLITE_UPDATE, exists, 'existsRA_'))
    {
      var satellite = this.instance || config.instance;

      if (!satellite || this.factoryType == 'value')
      {
        if (!this.factoryType)
        {
          var instanceValue = config.getInstance;
          var instanceClass = config.instanceClass;

          if (typeof instanceValue == 'function')
          {
            instanceValue = instanceValue.call(owner, owner);
            if (Class.isClass(instanceValue))
              instanceClass = processInstanceClass(instanceValue);
          }

          this.factoryType = instanceClass ? 'class' : 'value';
          this.factory = instanceClass || instanceValue;
        }

        if (this.factoryType == 'class')
        {
          var satelliteConfig = {
            destroy: warnOnAutoSatelliteDestoy // auto-create satellite marker, lock destroy method invocation
          };

          if (config.delegate)
          {
            satelliteConfig.autoDelegate = false;
            satelliteConfig.delegate = config.delegate(owner);
          }

          if (config.dataSource)
            satelliteConfig.dataSource = config.dataSource(owner);

          if (config.config)
            basis.object.complete(satelliteConfig, typeof config.config == 'function'
              ? config.config(owner)
              : config.config
            );

          this.instance = new this.factory(satelliteConfig);
          owner.setSatellite(name, this.instance, true);

          /** @cut */ var loc = basis.dev.getInfo(config, 'loc');
          /** @cut */ if (loc)
          /** @cut */   basis.dev.setInfo(this.instance, 'loc', loc);

          return;
        }

        // factoryType == 'value'
        satellite = resolveAbstractNode(this, SATELLITE_UPDATE, this.factory, 'instanceRA_');
      }

      if (this.instance !== satellite)
      {
        this.instance = satellite || null;
        owner.setSatellite(name, this.instance, true);
      }

      if (satellite && satellite.owner === owner)
      {
        if (config.delegate)
          satellite.setDelegate(config.delegate(owner));

        if (config.dataSource)
          satellite.setDataSource(config.dataSource(owner));
      }
    }
    else
    {
      var satellite = this.instance;
      if (satellite)
      {
        if (config.instance)
        {
          if (config.delegate)
            satellite.setDelegate();

          if (config.dataSource)
            satellite.setDataSource();
        }

        this.instance = null;
        owner.setSatellite(name, null, true);
      }
    }
  }
function ( ) { // this -> { //   owner: owner, //   name: satelliteName, //   config: satelliteConfig, //   instance: satelliteInstance or null, //   instanceRA_: ResolveAdapter or null, //   existsRA_: ResolveAdapter or null //   factoryType: 'value' or 'class' //   factory: class or any // } var name = this . name ; var config = this . config ; var owner = this . owner ; var exists = ( 'existsIf' in config == false ) || config . existsIf ( owner ) ; if ( resolveValue ( this , SATELLITE_UPDATE , exists , 'existsRA_' ) ) { var satellite = this . instance || config . instance ; if ( ! satellite || this . factoryType == 'value' ) { if ( ! this . factoryType ) { var instanceValue = config . getInstance ; var instanceClass = config . instanceClass ; if ( typeof instanceValue == 'function' ) { instanceValue = instanceValue . call ( owner , owner ) ; if ( Class . isClass ( instanceValue ) ) instanceClass = processInstanceClass ( instanceValue ) ; } this . factoryType = instanceClass ? 'class' : 'value' ; this . factory = instanceClass || instanceValue ; } if ( this . factoryType == 'class' ) { var satelliteConfig = { destroy : warnOnAutoSatelliteDestoy // auto-create satellite marker, lock destroy method invocation } ; if ( config . delegate ) { satelliteConfig . autoDelegate = false ; satelliteConfig . delegate = config . delegate ( owner ) ; } if ( config . dataSource ) satelliteConfig . dataSource = config . dataSource ( owner ) ; if ( config . config ) basis . object . complete ( satelliteConfig , typeof config . config == 'function' ? config . config ( owner ) : config . config ) ; this . instance = new this . factory ( satelliteConfig ) ; owner . setSatellite ( name , this . instance , true ) ; /** @cut */ var loc = basis . dev . getInfo ( config , 'loc' ) ; /** @cut */ if ( loc ) /** @cut */ basis . dev . setInfo ( this . instance , 'loc' , loc ) ; return ; } // factoryType == 'value' satellite = resolveAbstractNode ( this , SATELLITE_UPDATE , this . factory , 'instanceRA_' ) ; } if ( this . instance !== satellite ) { this . instance = satellite || null ; owner . setSatellite ( name , this . instance , true ) ; } if ( satellite && satellite . owner === owner ) { if ( config . delegate ) satellite . setDelegate ( config . delegate ( owner ) ) ; if ( config . dataSource ) satellite . setDataSource ( config . dataSource ( owner ) ) ; } } else { var satellite = this . instance ; if ( satellite ) { if ( config . instance ) { if ( config . delegate ) satellite . setDelegate ( ) ; if ( config . dataSource ) satellite . setDataSource ( ) ; } this . instance = null ; owner . setSatellite ( name , null , true ) ; } } }
satellite update handler
satellite update handler