Skip to content

Commit

Permalink
Automated rollback
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

Broke project

*** Original change description ***

Deletes redundant `NodeTraversal::makeError` methods.

This change also cleans up the many unnecessary parameters/args that were used to call these methods.

***

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=233635502
  • Loading branch information
domnit authored and EatingW committed Feb 13, 2019
1 parent bf6d133 commit 04dde5a
Show file tree
Hide file tree
Showing 32 changed files with 535 additions and 427 deletions.
14 changes: 7 additions & 7 deletions src/com/google/javascript/jscomp/AngularPass.java
Expand Up @@ -200,19 +200,19 @@ private List<Node> createStringsFromParamList(Node params) {
}

@Override
public void visit(NodeTraversal unused, Node n, Node parent) {
public void visit(NodeTraversal t, Node n, Node parent) {
JSDocInfo docInfo = n.getJSDocInfo();
if (docInfo != null && docInfo.isNgInject()) {
addNode(n);
addNode(n, t);
}
}

/**
* Add node to the list of injectables.
*
* @param n node to add.
* @param t node traversal instance.
*/
private void addNode(Node n) {
private void addNode(Node n, NodeTraversal t) {
Node target = null;
Node fn = null;
String name = null;
Expand All @@ -223,7 +223,7 @@ private void addNode(Node n) {
// a = b = c = function() {}
case ASSIGN:
if (!n.getFirstChild().isQualifiedName()) {
compiler.report(JSError.make(n, INJECTED_FUNCTION_ON_NON_QNAME));
compiler.report(t.makeError(n, INJECTED_FUNCTION_ON_NON_QNAME));
return;
}
name = n.getFirstChild().getQualifiedName();
Expand Down Expand Up @@ -289,14 +289,14 @@ private void addNode(Node n) {
}

if (fn == null || !fn.isFunction()) {
compiler.report(JSError.make(n, INJECT_NON_FUNCTION_ERROR));
compiler.report(t.makeError(n, INJECT_NON_FUNCTION_ERROR));
return;
}
// report an error if the function declaration did not take place in a block or global scope
if (!target.getParent().isScript()
&& !target.getParent().isBlock()
&& !target.getParent().isModuleBody()) {
compiler.report(JSError.make(n, INJECT_IN_NON_GLOBAL_OR_BLOCK_ERROR));
compiler.report(t.makeError(n, INJECT_IN_NON_GLOBAL_OR_BLOCK_ERROR));
return;
}
// checks that name is present, which must always be the case unless the
Expand Down

0 comments on commit 04dde5a

Please sign in to comment.