fix(parser): detect empty expression in strings to interpolate

Fixes #3412

Closes #3451
This commit is contained in:
Pawel Kozlowski
2015-08-03 12:05:45 +02:00
parent 6eaa09ac20
commit 4422819754
2 changed files with 27 additions and 4 deletions

View File

@ -624,6 +624,16 @@ export function main() {
var ast = parseInterpolation(originalExp).ast;
expect(new Unparser().unparse(ast)).toEqual(originalExp);
});
it("should throw on empty interpolation expressions", () => {
expect(() => parseInterpolation("{{}}"))
.toThrowError(new RegExp(
"Parser Error: Blank expressions are not allowed in interpolated strings"));
expect(() => parseInterpolation("foo {{ }}"))
.toThrowError(new RegExp(
"Parser Error: Blank expressions are not allowed in interpolated strings"));
});
});
describe("parseSimpleBinding", () => {