lib/namespace.js
function (namespace, names){
    if (names){
      for (let i = 0, n = names.length; i < n; ++i){
        let typeName = names[i];
        if (namespace.names.hasOwnProperty(typeName)){
          this.names[typeName] = namespace.names[typeName];
        }
        else {
          throw new ReferenceError('import error: undefined type \'' + typeName + '\'');
        }
      }
    }
    else {
      // import *
      for (let typeName in namespace.names){
        if (namespace.names.hasOwnProperty(typeName)){
          this.names[typeName] = namespace.names[typeName];
        }
      }
    }
    return this;
  }
function (namespace, names){
    if (names){
      for (let i = 0, n = names.length; i < n; ++i){
        let typeName = names[i];
        if (namespace.names.hasOwnProperty(typeName)){
          this.names[typeName] = namespace.names[typeName];
        }
        else {
          throw new ReferenceError('import error: undefined type \'' + typeName + '\'');
        }
      }
    }
    else {
      // import *
      for (let typeName in namespace.names){
        if (namespace.names.hasOwnProperty(typeName)){
          this.names[typeName] = namespace.names[typeName];
        }
      }
    }
    return this;
  }
function ( namespace , names ) { if ( names ) { for ( let i = 0 , n = names . length ; i < n ; ++ i ) { let typeName = names [ i ] ; if ( namespace . names . hasOwnProperty ( typeName ) ) { this . names [ typeName ] = namespace . names [ typeName ] ; } else { throw new ReferenceError ( 'import error: undefined type \'' + typeName + '\'' ) ; } } } else { // import * for ( let typeName in namespace . names ) { if ( namespace . names . hasOwnProperty ( typeName ) ) { this . names [ typeName ] = namespace . names [ typeName ] ; } } } return this ; }
Import type names from another namespace.
@param {TemplateNamespace} namespace
@param {Array<String>} [names] - names to import
@returns {TemplateNamespace}
Import type names from another namespace .