Skip to content

Commit

Permalink
fix(parser): Skips one validation - Token.IsLogical will not "exist" …
Browse files Browse the repository at this point in the history
…unless "next" option enabled
  • Loading branch information
KFlash committed Aug 2, 2019
1 parent 83cbdd5 commit 6941da7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3265,10 +3265,7 @@ export function parseBinaryExpression(
t = parser.token;
prec = t & Token.Precedence;

if (
(context & Context.OptionsNext && (t & Token.IsLogical && operator & Token.IsCoalesc)) ||
(operator & Token.IsLogical && t & Token.IsCoalesc)
) {
if ((t & Token.IsLogical && operator & Token.IsCoalesc) || (operator & Token.IsLogical && t & Token.IsCoalesc)) {
report(parser, Errors.InvalidCoalescing);
}

Expand Down

0 comments on commit 6941da7

Please sign in to comment.