Merge pull request #529 from sveltejs/bind-checked

Provide second argument to validator.error with bind:checked errors
pull/542/head
Rich Harris 8 years ago committed by GitHub
commit e80edf8386

@ -25,7 +25,7 @@ export default function validateElement ( validator, node ) {
}
if ( getType( validator, node ) !== 'checkbox' ) {
validator.error( `'checked' binding can only be used with <input type="checkbox">` );
validator.error( `'checked' binding can only be used with <input type="checkbox">`, attribute.start );
}
}
@ -99,4 +99,4 @@ function getType ( validator, node ) {
function list ( items, conjunction = 'or' ) {
if ( items.length === 1 ) return items[0];
return `${items.slice( 0, -1 ).join( ', ' )} ${conjunction} ${items[ items.length - 1 ]}`;
}
}

@ -0,0 +1,8 @@
[{
"message": "'checked' binding can only be used with <input type=\"checkbox\">",
"loc": {
"line": 1,
"column": 7
},
"pos": 7
}]
Loading…
Cancel
Save