feat(ExpressionParser): add support for this

This commit is contained in:
Victor Berchet
2016-08-04 10:14:44 -07:00
committed by Alex Rickabaugh
parent 26c9e1dc70
commit 0ca05eee45
9 changed files with 75 additions and 23 deletions

View File

@ -67,6 +67,12 @@ export function main() {
expectIdentifierToken(tokens[0], 0, 'j');
});
it('should tokenize "this"', () => {
var tokens: number[] = lex('this');
expect(tokens.length).toEqual(1);
expectKeywordToken(tokens[0], 0, 'this');
});
it('should tokenize a dotted identifier', () => {
var tokens: number[] = lex('j.k');
expect(tokens.length).toEqual(3);

View File

@ -163,6 +163,7 @@ export function main() {
describe('member access', () => {
it('should parse field access', () => {
checkAction('a');
checkAction('this.a', 'a');
checkAction('a.a');
});