Skip to content

Commit 988d296

Browse files
committed
Disallow trailing object literal commas when ecmaVersion < 5
Closes #866
1 parent aedbc56 commit 988d296

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

acorn/src/expression.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ pp.parseObj = function(isPattern, refDestructuringErrors) {
623623
while (!this.eat(tt.braceR)) {
624624
if (!first) {
625625
this.expect(tt.comma)
626-
if (this.afterTrailingComma(tt.braceR)) break
626+
if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(tt.braceR)) break
627627
} else first = false
628628

629629
const prop = this.parseProperty(isPattern, refDestructuringErrors)

0 commit comments

Comments
 (0)