Skip to content

Commit

Permalink
fix(parser): handle trailing comma in object literals (#249)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre authored Feb 19, 2020
1 parent 686d17a commit 92a63b2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions boa/src/syntax/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ impl Parser {
let name = match tk.data {
TokenData::Identifier(ref id) => id.clone(),
TokenData::StringLiteral(ref str) => str.clone(),
TokenData::Punctuator(Punctuator::CloseBlock) => {
self.pos += 1;
break;
}
_ => {
return Err(ParseError::Expected(
vec![
Expand Down

0 comments on commit 92a63b2

Please sign in to comment.