src/com/google/javascript/jscomp/Es6RewriteClass.java
/**
   * Visits class members other than simple methods: Getters, setters, and computed properties.
   */
Visits class members other than simple methods: Getters, setters, and computed properties.
Visits class members other than simple methods : Getters setters and computed properties .
private void visitNonMethodMember(Node member, ClassDeclarationMetadata metadata) {
    if (member.isComputedProp() && member.isStaticMember()) {
      cannotConvertYet(member, "Static computed property");
      return;
    }
    if (member.isComputedProp() && !member.getFirstChild().isQualifiedName()) {
      cannotConvert(member.getFirstChild(), "Computed property with non-qualified-name key");
      return;
    }
    JSTypeExpression typeExpr = getTypeFromGetterOrSetter(member);
    addToDefinePropertiesObject(metadata, member);
    Map<String, JSDocInfo> membersToDeclare;
    String memberName;
    if (member.isComputedProp()) {
      checkState(!member.isStaticMember());
      membersToDeclare = metadata.getPrototypeComputedPropsToDeclare();
      memberName = member.getFirstChild().getQualifiedName();
    } else {
      membersToDeclare =
          member.isStaticMember()
              ? metadata.getClassMembersToDeclare()
              : metadata.getPrototypeMembersToDeclare();
      memberName = member.getString();
    }
    JSDocInfo existingJSDoc = membersToDeclare.get(memberName);
    JSTypeExpression existingType = existingJSDoc == null ? null : existingJSDoc.getType();
    if (existingType != null && typeExpr != null && !existingType.equals(typeExpr)) {
      compiler.report(JSError.make(member, CONFLICTING_GETTER_SETTER_TYPE, memberName));
    } else {
      JSDocInfoBuilder jsDoc = new JSDocInfoBuilder(false);
      if (member.getJSDocInfo() != null && member.getJSDocInfo().isExport()) {
        jsDoc.recordExport();
        jsDoc.recordVisibility(Visibility.PUBLIC);
      }
      if (member.getJSDocInfo() != null && member.getJSDocInfo().isOverride()) {
        jsDoc.recordOverride();
      } else if (typeExpr == null) {
        typeExpr = new JSTypeExpression(new Node(Token.QMARK), member.getSourceFileName());
      }
      if (typeExpr != null) {
        jsDoc.recordType(typeExpr.copy());
      }
      if (member.isStaticMember() && !member.isComputedProp()) {
        jsDoc.recordNoCollapse();
      }
      membersToDeclare.put(memberName, jsDoc.build());
    }
  }
private void visitNonMethodMember ( Node member , ClassDeclarationMetadata metadata ) { if ( member . isComputedProp ( ) && member . isStaticMember ( ) ) { cannotConvertYet ( member , "Static computed property" ) ; return ; } if ( member . isComputedProp ( ) && ! member . getFirstChild ( ) . isQualifiedName ( ) ) { cannotConvert ( member . getFirstChild ( ) , "Computed property with non-qualified-name key" ) ; return ; } JSTypeExpression typeExpr = getTypeFromGetterOrSetter ( member ) ; addToDefinePropertiesObject ( metadata , member ) ; Map < String , JSDocInfo > membersToDeclare ; String memberName ; if ( member . isComputedProp ( ) ) { checkState ( ! member . isStaticMember ( ) ) ; membersToDeclare = metadata . getPrototypeComputedPropsToDeclare ( ) ; memberName = member . getFirstChild ( ) . getQualifiedName ( ) ; } else { membersToDeclare = member . isStaticMember ( ) ? metadata . getClassMembersToDeclare ( ) : metadata . getPrototypeMembersToDeclare ( ) ; memberName = member . getString ( ) ; } JSDocInfo existingJSDoc = membersToDeclare . get ( memberName ) ; JSTypeExpression existingType = existingJSDoc == null ? null : existingJSDoc . getType ( ) ; if ( existingType != null && typeExpr != null && ! existingType . equals ( typeExpr ) ) { compiler . report ( JSError . make ( member , CONFLICTING_GETTER_SETTER_TYPE , memberName ) ) ; } else { JSDocInfoBuilder jsDoc = new JSDocInfoBuilder ( false ) ; if ( member . getJSDocInfo ( ) != null && member . getJSDocInfo ( ) . isExport ( ) ) { jsDoc . recordExport ( ) ; jsDoc . recordVisibility ( Visibility . PUBLIC ) ; } if ( member . getJSDocInfo ( ) != null && member . getJSDocInfo ( ) . isOverride ( ) ) { jsDoc . recordOverride ( ) ; } else if ( typeExpr == null ) { typeExpr = new JSTypeExpression ( new Node ( Token . QMARK ) , member . getSourceFileName ( ) ) ; } if ( typeExpr != null ) { jsDoc . recordType ( typeExpr . copy ( ) ) ; } if ( member . isStaticMember ( ) && ! member . isComputedProp ( ) ) { jsDoc . recordNoCollapse ( ) ; } membersToDeclare . put ( memberName , jsDoc . build ( ) ) ; } }
Visits class members other than simple methods: Getters, setters, and computed properties.
Visits class members other than simple methods : Getters setters and computed properties .