feat(ExpressionParser): add support for this
This commit is contained in:

committed by
Alex Rickabaugh

parent
26c9e1dc70
commit
0ca05eee45
@ -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);
|
||||
|
@ -163,6 +163,7 @@ export function main() {
|
||||
describe('member access', () => {
|
||||
it('should parse field access', () => {
|
||||
checkAction('a');
|
||||
checkAction('this.a', 'a');
|
||||
checkAction('a.a');
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user