@@ -41,7 +41,7 @@ public final class TypeConversionPass implements CompilerPass {
41
41
42
42
private Map <String , String > typesToFilename ;
43
43
44
- public TypeConversionPass (
44
+ TypeConversionPass (
45
45
AbstractCompiler compiler , CollectModuleMetadata modulePrepass , NodeComments nodeComments ) {
46
46
this .compiler = compiler ;
47
47
this .modulePrepass = modulePrepass ;
@@ -514,7 +514,7 @@ private void convertTypeAlias() {
514
514
}
515
515
516
516
/** Converts @constructor annotated functions into class definitions. */
517
- void convertConstructorToClass (Node n , JSDocInfo jsDoc ) {
517
+ private void convertConstructorToClass (Node n , JSDocInfo jsDoc ) {
518
518
Preconditions .checkState (n .isFunction ());
519
519
Preconditions .checkState (n .getFirstChild ().isName ());
520
520
Preconditions .checkState (n .getSecondChild ().isParamList ());
@@ -580,7 +580,7 @@ void convertConstructorToClass(Node n, JSDocInfo jsDoc) {
580
580
}
581
581
582
582
/** Converts goog.defineClass calls into class definitions. */
583
- void convertDefineClassToClass (Node n ) {
583
+ private void convertDefineClassToClass (Node n ) {
584
584
Preconditions .checkState (n .isCall ());
585
585
Node superClass = n .getSecondChild ();
586
586
if (superClass .isNull ()) {
@@ -614,7 +614,7 @@ void convertDefineClassToClass(Node n) {
614
614
}
615
615
616
616
/** return if node n is a @constructor annotated function inside goog.defineClass */
617
- boolean isConstructorInGoogDefineClass (Node n ) {
617
+ private boolean isConstructorInGoogDefineClass (Node n ) {
618
618
// CALL
619
619
// GETPROP
620
620
// NAME goog
@@ -650,7 +650,7 @@ boolean isConstructorInGoogDefineClass(Node n) {
650
650
* Converts functions and variables declared in object literals into member method and field
651
651
* definitions
652
652
*/
653
- void convertObjectLiteral (Node classMembers , Node objectLiteralMember , boolean isStatic ) {
653
+ private void convertObjectLiteral (Node classMembers , Node objectLiteralMember , boolean isStatic ) {
654
654
Preconditions .checkState (
655
655
objectLiteralMember .isStringKey () || objectLiteralMember .isMemberFunctionDef ());
656
656
@@ -679,7 +679,7 @@ void convertObjectLiteral(Node classMembers, Node objectLiteralMember, boolean i
679
679
* Attempts to move a method declaration into a class definition. This generates a new
680
680
* MEMBER_FUNCTION_DEF Node while removing the old function node from the AST.
681
681
*/
682
- void moveMethodsIntoClasses (ClassMemberDeclaration declaration ) {
682
+ private void moveMethodsIntoClasses (ClassMemberDeclaration declaration ) {
683
683
Node classMembers = declaration .classNode .getLastChild ();
684
684
String fieldName = declaration .memberName ;
685
685
@@ -709,7 +709,7 @@ void moveMethodsIntoClasses(ClassMemberDeclaration declaration) {
709
709
compiler .reportChangeToEnclosingScope (memberFunc );
710
710
}
711
711
712
- Node createMemberVariableDef (ClassMemberDeclaration declaration ) {
712
+ private Node createMemberVariableDef (ClassMemberDeclaration declaration ) {
713
713
Node fieldNode = Node .newString (Token .MEMBER_VARIABLE_DEF , declaration .memberName );
714
714
fieldNode .setJSDocInfo (declaration .jsDoc );
715
715
fieldNode .setStaticMember (declaration .isStatic );
@@ -721,7 +721,7 @@ Node createMemberVariableDef(ClassMemberDeclaration declaration) {
721
721
* Attempts to move a field declaration into a class definition. This generates a new
722
722
* MEMBER_VARIABLE_DEF Node while persisting the old node in the AST.
723
723
*/
724
- void moveFieldsIntoClasses (ClassMemberDeclaration declaration ) {
724
+ private void moveFieldsIntoClasses (ClassMemberDeclaration declaration ) {
725
725
Node classMembers = declaration .classNode .getLastChild ();
726
726
727
727
Node fieldNode = createMemberVariableDef (declaration );
@@ -766,7 +766,7 @@ private boolean canPromoteFieldInitializer(ClassMemberDeclaration declaration) {
766
766
* <p>This returns without any modification if the node is not an inheritance statement. This
767
767
* fails by reporting an error when the node is an invalid inheritance statement.
768
768
*/
769
- void maybeRemoveInherits (Node exprNode ) {
769
+ private void maybeRemoveInherits (Node exprNode ) {
770
770
Preconditions .checkState (exprNode .isExprResult ());
771
771
if (exprNode .getFirstChild ().isCall ()) {
772
772
Node callNode = exprNode .getFirstChild ();
@@ -831,7 +831,7 @@ void maybeRemoveInherits(Node exprNode) {
831
831
*
832
832
* <p>This returns without any modification if the node is not an superclass call statement.
833
833
*/
834
- void maybeReplaceSuperCall (Node callNode ) {
834
+ private void maybeReplaceSuperCall (Node callNode ) {
835
835
Preconditions .checkState (callNode .isCall ());
836
836
String callName = callNode .getFirstChild ().getQualifiedName ();
837
837
@@ -903,7 +903,7 @@ void maybeReplaceSuperCall(Node callNode) {
903
903
}
904
904
905
905
/** Adds a field node before the first method node in classMembers */
906
- void addFieldToClassMembers (Node classMembers , Node field ) {
906
+ private void addFieldToClassMembers (Node classMembers , Node field ) {
907
907
for (Node n : classMembers .children ()) {
908
908
if (n .isMemberFunctionDef ()) {
909
909
classMembers .addChildBefore (field , n );
@@ -918,7 +918,7 @@ void addFieldToClassMembers(Node classMembers, Node field) {
918
918
*
919
919
* <p>This determines the classname using the nearest available name node.
920
920
*/
921
- void addClassToScope (Node n ) {
921
+ private void addClassToScope (Node n ) {
922
922
Preconditions .checkState (n .isClass ());
923
923
String className = NodeUtil .getName (n );
924
924
if (className == null ) {
0 commit comments