Fix for an NPE for cases where the native keyword on a class is not followed by a string identifier.

Review URL: http://codereview.chromium.org//9109019

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@3011 260f80e4-7a28-3924-810f-c04153c831b5
This commit is contained in:
devoncarew@google.com 2012-01-05 21:08:30 +00:00
parent ff8a1713e4
commit e7469aa059

View file

@ -606,8 +606,9 @@ public class DartParser extends CompletionHooksParserBase {
DartStringLiteral nativeName = null;
if (!isParsingInterface && optionalPseudoKeyword(NATIVE_KEYWORD)) {
beginLiteral();
expect(Token.STRING);
nativeName = done(DartStringLiteral.get(ctx.getTokenString()));
if (expect(Token.STRING)) {
nativeName = done(DartStringLiteral.get(ctx.getTokenString()));
}
if (superType != null) {
reportError(position(), ParserErrorCode.EXTENDED_NATIVE_CLASS);
}