feat(parser): support === and !== operators

Closes #1496

Closes #1500
This commit is contained in:
Pawel Kozlowski
2015-04-22 11:45:33 +02:00
parent 2e3e41ba64
commit afe0e45453
5 changed files with 32 additions and 5 deletions
+5 -1
View File
@@ -277,13 +277,17 @@ class _ParseAST {
}
parseEquality() {
// '==','!='
// '==','!=','===','!=='
var result = this.parseRelational();
while (true) {
if (this.optionalOperator('==')) {
result = new Binary('==', result, this.parseRelational());
} else if (this.optionalOperator('===')) {
result = new Binary('===', result, this.parseRelational());
} else if (this.optionalOperator('!=')) {
result = new Binary('!=', result, this.parseRelational());
} else if (this.optionalOperator('!==')) {
result = new Binary('!==', result, this.parseRelational());
} else {
return result;
}