better error for bind:value="{{foo}}" - fixes #437

pull/439/head
Rich-Harris 8 years ago
parent a3ecb67977
commit 75e8d6205e

@ -77,6 +77,17 @@ export function readBindingDirective ( parser, start, name ) {
const a = parser.index;
if ( parser.eat( '{{' ) ) {
let message = 'bound values should not be wrapped';
const b = parser.template.indexOf( '}}', a );
if ( b !== -1 ) {
const value = parser.template.slice( parser.index, b );
message += ` — use '${value}', not '{{${value}}}'`;
}
parser.error( message, a );
}
// this is a bit of a hack so that we can give Acorn something parseable
let b;
if ( quoteMark ) {

@ -0,0 +1,8 @@
{
"message": "bound values should not be wrapped — use 'foo', not '{{foo}}'",
"loc": {
"line": 1,
"column": 19
},
"pos": 19
}
Loading…
Cancel
Save