Skip to content

Commit

Permalink
@deprecate the rest method that takes a string, and add another that …
Browse files Browse the repository at this point in the history
…takes a Node that is consistent with how the AST is built.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171883458
  • Loading branch information
concavelenz authored and Tyler Breisacher committed Oct 13, 2017
1 parent 97cf26f commit e674d6c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/com/google/javascript/rhino/IR.java
Expand Up @@ -595,8 +595,14 @@ public static Node stringKey(String s, Node value) {
return stringKey;
}

@Deprecated
public static Node rest(String name) {
return new Node(Token.REST, name(name));
return rest(name(name));
}

public static Node rest(Node target) {
checkState(target.isValidAssignmentTarget(), target);
return new Node(Token.REST, target);
}

public static Node spread(Node expr) {
Expand Down

0 comments on commit e674d6c

Please sign in to comment.