Skip to content

Commit

Permalink
Fix Node <8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Jan 26, 2020
1 parent a5ebc8e commit b09b210
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 2 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ? "&rbrace;" : "&gt;"}\`, or \`{"${
this.input[this.pos]
}"}\`?`,
"Unexpected token `" + this.input[this.pos] + "`. Did you mean `" +
(ch === 125 ? "&rbrace;" : "&gt;") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?"
);

default:
Expand Down
6 changes: 3 additions & 3 deletions test/tests-jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3881,11 +3881,11 @@ for (var ns in fbTestFixture) {
}
}

testFail("<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />", 'Unexpected token `>`. Did you mean `&gt;`, or `{">"}`? (1:40)')
testFail("<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />", 'Unexpected token `>`. Did you mean `&gt;` or `{">"}`? (1:40)')
testFail("<A>foo{</A>", "Unexpected token (1:8)")
testFail("<A>foo<</A>", "Unexpected token (1:7)")
testFail("<A>foo}</A>", 'Unexpected token `}`. Did you mean `&rbrace;`, or `{"}"}`? (1:6)')
testFail("<A>foo></A>", 'Unexpected token `>`. Did you mean `&gt;`, or `{">"}`? (1:6)')
testFail("<A>foo}</A>", 'Unexpected token `}`. Did you mean `&rbrace;` or `{"}"}`? (1:6)')
testFail("<A>foo></A>", 'Unexpected token `>`. Did you mean `&gt;` or `{">"}`? (1:6)')
test('<A>foo{"{"}</A>', {
"type": "Program",
"start": 0,
Expand Down

0 comments on commit b09b210

Please sign in to comment.