Provide second argument to validator.error with bind:checked errors

pull/529/head
Rich Harris 9 years ago committed by GitHub
parent 8e87c688ae
commit a2fd36f86c

@ -25,7 +25,7 @@ export default function validateElement ( validator, node ) {
} }
if ( getType( validator, node ) !== 'checkbox' ) { 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' ) { function list ( items, conjunction = 'or' ) {
if ( items.length === 1 ) return items[0]; if ( items.length === 1 ) return items[0];
return `${items.slice( 0, -1 ).join( ', ' )} ${conjunction} ${items[ items.length - 1 ]}`; return `${items.slice( 0, -1 ).join( ', ' )} ${conjunction} ${items[ items.length - 1 ]}`;
} }

Loading…
Cancel
Save