diff --git a/src/parse/read/directives.ts b/src/parse/read/directives.ts index 7f1a77d669..f4bc5d4f60 100644 --- a/src/parse/read/directives.ts +++ b/src/parse/read/directives.ts @@ -104,7 +104,7 @@ export function readBindingDirective ( parser: Parser, start: number, name: stri value = parseExpressionAt( source, a ); if ( value.type !== 'Identifier' && value.type !== 'MemberExpression' ) { - parser.error( `Expected valid property name` ); + parser.error( `Cannot bind to rvalue`, value.start ); } parser.allowWhitespace(); diff --git a/test/parser/samples/error-binding-rvalue/error.json b/test/parser/samples/error-binding-rvalue/error.json new file mode 100644 index 0000000000..85b4a6f9ac --- /dev/null +++ b/test/parser/samples/error-binding-rvalue/error.json @@ -0,0 +1,8 @@ +{ + "message": "Cannot bind to rvalue", + "pos": 19, + "loc": { + "line": 1, + "column": 19 + } +} \ No newline at end of file diff --git a/test/parser/samples/error-binding-rvalue/input.html b/test/parser/samples/error-binding-rvalue/input.html new file mode 100644 index 0000000000..0b1f716c23 --- /dev/null +++ b/test/parser/samples/error-binding-rvalue/input.html @@ -0,0 +1 @@ + \ No newline at end of file