Bug 1045848 - MUST_MATCH_TOKEN should not report error when token is TOK_ERROR. r=jorendorff

This commit is contained in:
Guptha Rajagopal 2014-08-13 11:01:00 -04:00
Родитель 2edcef48ed
Коммит 84ba2c2da1
1 изменённых файлов: 5 добавлений и 6 удалений

Просмотреть файл

@ -56,14 +56,13 @@ typedef Rooted<NestedScopeObject*> RootedNestedScopeObject;
typedef Handle<NestedScopeObject*> HandleNestedScopeObject;
/*
* Insist that the next token be of type tt, or report errno and return null.
* NB: this macro uses cx and ts from its lexical environment.
*/
/* Read a token. Report an error and return null() if that token isn't of type tt. */
#define MUST_MATCH_TOKEN(tt, errno) \
JS_BEGIN_MACRO \
if (tokenStream.getToken() != tt) { \
report(ParseError, false, null(), errno); \
TokenKind token = tokenStream.getToken(); \
if (token != tt) { \
if (token != TOK_ERROR) \
report(ParseError, false, null(), errno); \
return null(); \
} \
JS_END_MACRO