feat: emit compiler error for invalid JavaScript expressions

This commit is contained in:
Evan You
2019-10-16 16:33:23 -04:00
parent 0ca4896a38
commit e97951dd2e
3 changed files with 9 additions and 2 deletions

View File

@@ -379,6 +379,8 @@ describe('compiler: expression transform', () => {
test('should handle parse error', () => {
const onError = jest.fn()
parseWithExpressionTransform(`{{ a( }}`, { onError })
expect(onError.mock.calls[0][0].message).toMatch(`Unexpected token (1:4)`)
expect(onError.mock.calls[0][0].message).toMatch(
`Invalid JavaScript expression. (1:4)`
)
})
})