Skip to content

Commit

Permalink
Disallow trailing object literal commas when ecmaVersion < 5
Browse files Browse the repository at this point in the history
Closes #866
  • Loading branch information
marijnh committed Aug 21, 2019
1 parent aedbc56 commit 988d296
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion acorn/src/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ pp.parseObj = function(isPattern, refDestructuringErrors) {
while (!this.eat(tt.braceR)) {
if (!first) {
this.expect(tt.comma)
if (this.afterTrailingComma(tt.braceR)) break
if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(tt.braceR)) break
} else first = false

const prop = this.parseProperty(isPattern, refDestructuringErrors)
Expand Down

0 comments on commit 988d296

Please sign in to comment.