visitConstruct()

in lib/common_generator.js [354:368]


  visitConstruct(ast, level) {
    assert.equal(ast.type, 'construct');
    this.emit('new ');
    let className = this.ctx.imports[ast.inferred.name].className;
    let pathName = this.ctx.imports[ast.inferred.name].package;
    if (this.ctx.conflictModels.get(className) && this.ctx.conflictModels.get(className) !== pathName) {
      this.emit(`${pathName}.${className}`);
    } else {
      if (!this.ctx.conflictModels.get(className)) {
        this.ctx.conflictModels.set(className, pathName);
      }
      this.emit(className);
    }
    this.visitArgs(ast.args, level);
  }