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

View File

@ -1,4 +1,4 @@
import {describe, it, expect} from 'angular2/test_lib';
import {ddescribe, describe, it, expect} from 'angular2/test_lib';
import {Lexer, Token} from 'angular2/src/change_detection/parser/lexer';
@ -150,7 +150,7 @@ export function main() {
});
it('should tokenize relation', function() {
var tokens:List<Token> = lex("! == != < > <= >=");
var tokens:List<Token> = lex("! == != < > <= >= === !==");
expectOperatorToken(tokens[0], 0, '!');
expectOperatorToken(tokens[1], 2, '==');
expectOperatorToken(tokens[2], 5, '!=');
@ -158,6 +158,8 @@ export function main() {
expectOperatorToken(tokens[4], 10, '>');
expectOperatorToken(tokens[5], 12, '<=');
expectOperatorToken(tokens[6], 15, '>=');
expectOperatorToken(tokens[7], 18, '===');
expectOperatorToken(tokens[8], 22, '!==');
});
it('should tokenize statements', function() {