src/com/google/javascript/jscomp/Es6RewriteClass.java
/**
   * Handles transpilation of a standard class member function. Getters, setters, and the
   * constructor are not handled here.
   */
Handles transpilation of a standard class member function. Getters, setters, and the
constructor are not handled here.
Handles transpilation of a standard class member function . Getters setters and the constructor are not handled here .
private void visitMethod(Node member, ClassDeclarationMetadata metadata) {
    Node qualifiedMemberAccess = getQualifiedMemberAccess(member, metadata);
    Node method = member.getLastChild().detach();
    Node assign =
        astFactory.createAssign(qualifiedMemberAccess, method).useSourceInfoIfMissingFrom(method);
    JSDocInfo info = member.getJSDocInfo();
    if (member.isStaticMember() && NodeUtil.referencesThis(assign.getLastChild())) {
      JSDocInfoBuilder memberDoc = JSDocInfoBuilder.maybeCopyFrom(info);
      memberDoc.recordThisType(
          new JSTypeExpression(new Node(Token.BANG, new Node(Token.QMARK)),
          member.getSourceFileName()));
      info = memberDoc.build();
    }
    if (info != null) {
      assign.setJSDocInfo(info);
    }
    Node newNode = NodeUtil.newExpr(assign);
    metadata.insertNodeAndAdvance(newNode);
  }
private void visitMethod ( Node member , ClassDeclarationMetadata metadata ) { Node qualifiedMemberAccess = getQualifiedMemberAccess ( member , metadata ) ; Node method = member . getLastChild ( ) . detach ( ) ; Node assign = astFactory . createAssign ( qualifiedMemberAccess , method ) . useSourceInfoIfMissingFrom ( method ) ; JSDocInfo info = member . getJSDocInfo ( ) ; if ( member . isStaticMember ( ) && NodeUtil . referencesThis ( assign . getLastChild ( ) ) ) { JSDocInfoBuilder memberDoc = JSDocInfoBuilder . maybeCopyFrom ( info ) ; memberDoc . recordThisType ( new JSTypeExpression ( new Node ( Token . BANG , new Node ( Token . QMARK ) ) , member . getSourceFileName ( ) ) ) ; info = memberDoc . build ( ) ; } if ( info != null ) { assign . setJSDocInfo ( info ) ; } Node newNode = NodeUtil . newExpr ( assign ) ; metadata . insertNodeAndAdvance ( newNode ) ; }
Handles transpilation of a standard class member function.
Handles transpilation of a standard class member function .
// Use the source info from the method (a FUNCTION) not the MEMBER_FUNCTION_DEF // because the MEMBER_FUNCTION_DEf source info only corresponds to the identifier