Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Commit

Permalink
Better error message for anonymous class declarations (#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
rattrayalex authored and danez committed May 10, 2017
1 parent 7f9eb50 commit 4e776bf
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/parser/statement.js
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ export default class StatementParser extends ExpressionParser {
if (optionalId || !isStatement) {
node.id = null;
} else {
this.unexpected();
this.unexpected(null, "A class name is required");
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/es2015/uncategorised/263/options.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:6)"
}
"throws": "A class name is required (1:6)"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:5)"
}
"throws": "A class name is required (1:5)"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:5)"
}
"throws": "A class name is required (1:5)"
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"throws": "Unexpected token (1:5)"
}
"throws": "A class name is required (1:5)"
}

0 comments on commit 4e776bf

Please sign in to comment.