Skip to content

Commit 41dee02

Browse files
committed
prettier/plugin-php#246 : let trailling commas pass
1 parent c18b945 commit 41dee02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/parser/array.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ module.exports = {
3333
items = this.read_array_pair_list(shortForm);
3434
}
3535
// check non empty entries
36-
items.forEach(function(item) {
37-
if (item === null) {
36+
for(let i = 0, size = items.length - 1; i < size; i++) {
37+
if (items[i] === null) {
3838
this.raiseError(
3939
"Cannot use empty array elements in arrays"
4040
);
4141
}
42-
}.bind(this));
42+
}
4343
this.expect(expect);
4444
this.next();
4545
return result(shortForm, items);

0 commit comments

Comments
 (0)