fix(ExpressionParser): undefined is undefined (was null)

This commit is contained in:
Victor Berchet
2016-08-04 17:04:30 -07:00
committed by Alex Rickabaugh
parent 0ca05eee45
commit b4613ab2d2
2 changed files with 8 additions and 1 deletions

View File

@ -511,10 +511,15 @@ export class _ParseAST {
this.rparensExpected--;
this.expectCharacter(chars.$RPAREN);
return result;
} else if (this.next.isKeywordNull() || this.next.isKeywordUndefined()) {
} else if (this.next.isKeywordNull()) {
this.advance();
return new LiteralPrimitive(this.span(start), null);
} else if (this.next.isKeywordUndefined()) {
this.advance();
return new LiteralPrimitive(this.span(start), void 0);
} else if (this.next.isKeywordTrue()) {
this.advance();
return new LiteralPrimitive(this.span(start), true);