src/com/google/javascript/jscomp/Es6RewriteClass.java
/**
   * @param member A getter or setter, or a computed property that is a getter/setter.
   */
@param member A getter or setter, or a computed property that is a getter/setter.
@param member A getter or setter or a computed property that is a getter / setter .
private void addToDefinePropertiesObject(ClassDeclarationMetadata metadata, Node member) {
    Node obj =
        member.isStaticMember()
            ? metadata.getDefinePropertiesObjForClass()
            : metadata.getDefinePropertiesObjForPrototype();
    Node prop =
        member.isComputedProp()
            ? NodeUtil.getFirstComputedPropMatchingKey(obj, member.getFirstChild())
            : NodeUtil.getFirstPropMatchingKey(obj, member.getString());
    if (prop == null) {
      prop = createPropertyDescriptor();
      if (member.isComputedProp()) {
        obj.addChildToBack(
            astFactory.createComputedProperty(member.getFirstChild().cloneTree(), prop));
      } else {
        obj.addChildToBack(astFactory.createStringKey(member.getString(), prop));
      }
    }
    Node function = member.getLastChild();
    JSDocInfoBuilder info = JSDocInfoBuilder.maybeCopyFrom(
        NodeUtil.getBestJSDocInfo(function));
    info.recordThisType(
        new JSTypeExpression(
            new Node(Token.BANG, IR.string(metadata.getFullClassNameNode().getQualifiedName())),
            member.getSourceFileName()));
    Node stringKey =
        astFactory.createStringKey(
            (member.isGetterDef() || member.getBooleanProp(Node.COMPUTED_PROP_GETTER))
                ? "get"
                : "set",
            function.detach());
    stringKey.setJSDocInfo(info.build());
    prop.addChildToBack(stringKey);
    prop.useSourceInfoIfMissingFromForTree(member);
  }
private void addToDefinePropertiesObject ( ClassDeclarationMetadata metadata , Node member ) { Node obj = member . isStaticMember ( ) ? metadata . getDefinePropertiesObjForClass ( ) : metadata . getDefinePropertiesObjForPrototype ( ) ; Node prop = member . isComputedProp ( ) ? NodeUtil . getFirstComputedPropMatchingKey ( obj , member . getFirstChild ( ) ) : NodeUtil . getFirstPropMatchingKey ( obj , member . getString ( ) ) ; if ( prop == null ) { prop = createPropertyDescriptor ( ) ; if ( member . isComputedProp ( ) ) { obj . addChildToBack ( astFactory . createComputedProperty ( member . getFirstChild ( ) . cloneTree ( ) , prop ) ) ; } else { obj . addChildToBack ( astFactory . createStringKey ( member . getString ( ) , prop ) ) ; } } Node function = member . getLastChild ( ) ; JSDocInfoBuilder info = JSDocInfoBuilder . maybeCopyFrom ( NodeUtil . getBestJSDocInfo ( function ) ) ; info . recordThisType ( new JSTypeExpression ( new Node ( Token . BANG , IR . string ( metadata . getFullClassNameNode ( ) . getQualifiedName ( ) ) ) , member . getSourceFileName ( ) ) ) ; Node stringKey = astFactory . createStringKey ( ( member . isGetterDef ( ) || member . getBooleanProp ( Node . COMPUTED_PROP_GETTER ) ) ? "get" : "set" , function . detach ( ) ) ; stringKey . setJSDocInfo ( info . build ( ) ) ; prop . addChildToBack ( stringKey ) ; prop . useSourceInfoIfMissingFromForTree ( member ) ; }
@param member A getter or setter, or a computed property that is a getter/setter.
@param member A getter or setter or a computed property that is a getter / setter .