diff --git a/compiler/parse/index.js b/compiler/parse/index.js index 06c288e833..03b02e3697 100644 --- a/compiler/parse/index.js +++ b/compiler/parse/index.js @@ -51,7 +51,7 @@ export default function parse ( template ) { }, acornError ( err ) { - parser.error( err.message.replace( /\(\d+:\d+\)$/, '' ), err.pos ); + parser.error( err.message.replace( / \(\d+:\d+\)$/, '' ), err.pos ); }, error ( message, index = this.index ) { diff --git a/test/parser/error-illegal-expression/error.json b/test/parser/error-illegal-expression/error.json new file mode 100644 index 0000000000..30993d29e7 --- /dev/null +++ b/test/parser/error-illegal-expression/error.json @@ -0,0 +1,8 @@ +{ + "message": "Assigning to rvalue", + "loc": { + "line": 1, + "column": 2 + }, + "pos": 2 +} diff --git a/test/parser/error-illegal-expression/input.html b/test/parser/error-illegal-expression/input.html new file mode 100644 index 0000000000..8b020c7526 --- /dev/null +++ b/test/parser/error-illegal-expression/input.html @@ -0,0 +1 @@ +{{42 = nope}} diff --git a/test/parser/error-unexpected-end-of-input/error.json b/test/parser/error-unexpected-end-of-input/error.json index e171d2a2e8..bfd44de077 100644 --- a/test/parser/error-unexpected-end-of-input/error.json +++ b/test/parser/error-unexpected-end-of-input/error.json @@ -1,8 +1,8 @@ { "message": "Unexpected end of input", "loc": { - "line": 1, - "column": 5 + "line": 2, + "column": 0 }, - "pos": 5 + "pos": 6 }