Skip to content

Commit

Permalink
Adds type information to AST nodes synthesized by `Es6RewriteSpreadAn…
Browse files Browse the repository at this point in the history
…dTest`.

Type information isn't perfect but is sufficient to pass validation checks. It could be tightened later if needed.

This change also updates some tests to add type information to give the validations more to work with.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197985766
  • Loading branch information
nreid260 authored and brad4d committed May 25, 2018
1 parent cc0c90c commit f3c722e
Show file tree
Hide file tree
Showing 6 changed files with 437 additions and 166 deletions.
3 changes: 2 additions & 1 deletion src/com/google/javascript/jscomp/AstValidator.java
Expand Up @@ -426,7 +426,8 @@ private void validateNameType(Node nameNode) {
private void validateCallType(Node callNode) {
// TODO(b/74537281): Shouldn't CALL nodes always have a type, even if it is unknown?
Node callee = callNode.getFirstChild();
JSType calleeTypeI = checkNotNull(callee.getJSType(), callNode);
JSType calleeTypeI =
checkNotNull(callee.getJSType(), "Callee of\n\n%s\nhas no type.", callNode.toStringTree());

if (calleeTypeI.isFunctionType()) {
FunctionType calleeFunctionTypeI = calleeTypeI.toMaybeFunctionType();
Expand Down

0 comments on commit f3c722e

Please sign in to comment.