Skip to content

Commit

Permalink
Added link to if which points to the else if it has any (under this.ast)
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdz committed Oct 6, 2011
1 parent ee4c3c6 commit ce6fe97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ZeParser.js
Expand Up @@ -1079,6 +1079,7 @@ ZeParser.prototype = {
// )
// statement
// [else statement]
var ifKeyword = match;
match = this.tokenizer.storeCurrentAndFetchNextToken(false, match, stack);
if (match.value != '(') match = this.failsafe('ExpectedStatementHeaderOpen', match);
if (this.ast) { //#ifdef FULL_AST
Expand All @@ -1104,6 +1105,9 @@ ZeParser.prototype = {

// match might be null here... (if the if-statement was end part of the source)
if (match && match.value == 'else') {
if (this.ast) { //#ifdef FULL_AST
ifKeyword.hasElse = match;
} //#endif
match = this.eatElse(match, stack);
}

Expand Down

0 comments on commit ce6fe97

Please sign in to comment.