Guard against an AST node with no end token (issue 30089)

R=scheglov@google.com

Review-Url: https://codereview.chromium.org/2974533002 .
This commit is contained in:
Brian Wilkerson 2017-07-06 12:51:21 -07:00
parent ee4a09faea
commit 0c775ae412

View file

@ -451,6 +451,9 @@ class CompletionTarget {
* [CompletionTarget] associated with the given [offset].
*/
static bool _isCandidateToken(Token token, int offset) {
if (token == null) {
return false;
}
// A token is considered a candidate entity if the cursor offset is (a)
// before the start of the token, (b) within the token, (c) at the end of
// the token and the token is a keyword or identifier, or (d) at the