fix(parser): detect empty expression in strings to interpolate
Fixes #3412 Closes #3451
This commit is contained in:
@ -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", () => {
|
||||
|
Reference in New Issue
Block a user