Skip to content

Commit

Permalink
Near complete rewrite of the ProcessCommonJsModules pass.
Browse files Browse the repository at this point in the history
Avoids creating aliases for imports and exports thus removing the dependency on the early inlining pass.
Only traverses the AST twice.

Closes #2085

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=136504299
  • Loading branch information
ChadKillingsworth authored and blickly committed Oct 18, 2016
1 parent 2b9ec7b commit d43e6c4
Show file tree
Hide file tree
Showing 7 changed files with 1,464 additions and 879 deletions.
3 changes: 2 additions & 1 deletion src/com/google/javascript/jscomp/DiagnosticGroups.java
Expand Up @@ -536,7 +536,8 @@ public DiagnosticGroup forName(String name) {
CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR, CheckSuspiciousCode.SUSPICIOUS_IN_OPERATOR,
CheckSuspiciousCode.SUSPICIOUS_INSTANCEOF_LEFT_OPERAND, CheckSuspiciousCode.SUSPICIOUS_INSTANCEOF_LEFT_OPERAND,
CheckSuspiciousCode.SUSPICIOUS_NEGATED_LEFT_OPERAND_OF_IN_OPERATOR, CheckSuspiciousCode.SUSPICIOUS_NEGATED_LEFT_OPERAND_OF_IN_OPERATOR,
TypeCheck.DETERMINISTIC_TEST); TypeCheck.DETERMINISTIC_TEST,
ProcessCommonJSModules.SUSPICIOUS_EXPORTS_ASSIGNMENT);


public static final DiagnosticGroup FUNCTION_PARAMS = public static final DiagnosticGroup FUNCTION_PARAMS =
DiagnosticGroups.registerGroup( DiagnosticGroups.registerGroup(
Expand Down
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/NodeTraversal.java
Expand Up @@ -694,7 +694,7 @@ private void traverseClass(Node n, Node parent) {
traverseBranch(className, n); traverseBranch(className, n);
} }


final Node extendsClause = className.getNext(); final Node extendsClause = n.getSecondChild();
final Node body = extendsClause.getNext(); final Node body = extendsClause.getNext();


// Extends // Extends
Expand Down

0 comments on commit d43e6c4

Please sign in to comment.