fix(Parser): Parse pipes in arguments

fixes #1680
This commit is contained in:
Victor Berchet
2015-06-04 19:06:09 +02:00
parent 659adf83dc
commit f9745327e6
4 changed files with 67 additions and 72 deletions

View File

@ -64,7 +64,7 @@ export function main() {
it('should support Conditional', () => { check('a ? b : c', Conditional); });
it('should support Pipe', () => {
var originalExp = 'a | b';
var originalExp = '(a | b)';
var ast = parseBinding(originalExp).ast;
expect(ast).toBeAnInstanceOf(Pipe);
expect(unparser.unparse(ast)).toEqual(originalExp);
@ -94,7 +94,7 @@ export function main() {
it('should support SafeMethodCall', () => { check('a?.b(c, d)', SafeMethodCall); });
it('should support complex expression', () => {
var originalExp = 'a + 3 * fn([c + d | e.f], {a: 3})[g].h && i';
var originalExp = 'a + 3 * fn([(c + d | e).f], {a: 3})[g].h && i';
var ast = parseBinding(originalExp).ast;
expect(unparser.unparse(ast)).toEqual(originalExp);
});