Skip to content

Commit b8654eb

Browse files
author
Kai Cataldo
committed
Fix Node <8 compatibility
1 parent a5ebc8e commit b8654eb

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,8 @@ function plugin(options, Parser) {
140140
case 125: // '}'
141141
this.raise(
142142
this.pos,
143-
`Unexpected token \`${
144-
this.input[this.pos]
145-
}\`. Did you mean \`${ch === 125 ? "&rbrace;" : "&gt;"}\`, or \`{"${
146-
this.input[this.pos]
147-
}"}\`?`,
143+
"Unexpected token `" + this.input[this.pos] + "`. Did you mean `" +
144+
(ch === 62 ? "&gt;" : "&rbrace;") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?"
148145
);
149146

150147
default:

test/tests-jsx.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3881,11 +3881,11 @@ for (var ns in fbTestFixture) {
38813881
}
38823882
}
38833883

3884-
testFail("<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />", 'Unexpected token `>`. Did you mean `&gt;`, or `{">"}`? (1:40)')
3884+
testFail("<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />", 'Unexpected token `>`. Did you mean `&gt;` or `{">"}`? (1:40)')
38853885
testFail("<A>foo{</A>", "Unexpected token (1:8)")
38863886
testFail("<A>foo<</A>", "Unexpected token (1:7)")
3887-
testFail("<A>foo}</A>", 'Unexpected token `}`. Did you mean `&rbrace;`, or `{"}"}`? (1:6)')
3888-
testFail("<A>foo></A>", 'Unexpected token `>`. Did you mean `&gt;`, or `{">"}`? (1:6)')
3887+
testFail("<A>foo}</A>", 'Unexpected token `}`. Did you mean `&rbrace;` or `{"}"}`? (1:6)')
3888+
testFail("<A>foo></A>", 'Unexpected token `>`. Did you mean `&gt;` or `{">"}`? (1:6)')
38893889
test('<A>foo{"{"}</A>', {
38903890
"type": "Program",
38913891
"start": 0,

0 commit comments

Comments
 (0)