diff --git a/index.js b/index.js index cba70eb..ed8779f 100644 --- a/index.js +++ b/index.js @@ -140,11 +140,8 @@ function plugin(options, Parser) { case 125: // '}' this.raise( this.pos, - `Unexpected token \`${ - this.input[this.pos] - }\`. Did you mean \`${ch === 125 ? "}" : ">"}\`, or \`{"${ - this.input[this.pos] - }"}\`?`, + "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" + + (ch === 125 ? "}" : ">") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?" ); default: diff --git a/test/tests-jsx.js b/test/tests-jsx.js index 1ac02e2..06ea016 100644 --- a/test/tests-jsx.js +++ b/test/tests-jsx.js @@ -3881,11 +3881,11 @@ for (var ns in fbTestFixture) { } } -testFail(" right=monkeys /> gorillas />", 'Unexpected token `>`. Did you mean `>`, or `{">"}`? (1:40)') +testFail(" right=monkeys /> gorillas />", 'Unexpected token `>`. Did you mean `>` or `{">"}`? (1:40)') testFail("foo{", "Unexpected token (1:8)") testFail("foo<", "Unexpected token (1:7)") -testFail("foo}", 'Unexpected token `}`. Did you mean `}`, or `{"}"}`? (1:6)') -testFail("foo>", 'Unexpected token `>`. Did you mean `>`, or `{">"}`? (1:6)') +testFail("foo}", 'Unexpected token `}`. Did you mean `}` or `{"}"}`? (1:6)') +testFail("foo>", 'Unexpected token `>`. Did you mean `>` or `{">"}`? (1:6)') test('foo{"{"}', { "type": "Program", "start": 0,