[loose parser] Improve autoclosing of expression lists

This commit is contained in:
Marijn Haverbeke 2014-12-15 17:32:38 +01:00
parent 6915519498
commit 75b58c07d4

View File

@ -1135,10 +1135,9 @@
} }
function parseExprList(close, allowEmpty) { function parseExprList(close, allowEmpty) {
var indent = curIndent, line = curLineStart, elts = [], continuedLine = nextLineStart; var indent = curIndent, line = curLineStart, elts = [];
next(); // Opening bracket next(); // Opening bracket
if (curLineStart > continuedLine) continuedLine = curLineStart; while (!closes(close, indent + 1, line)) {
while (!closes(close, indent + (curLineStart <= continuedLine ? 1 : 0), line)) {
if (eat(tt.comma)) { if (eat(tt.comma)) {
elts.push(allowEmpty ? null : dummyIdent()); elts.push(allowEmpty ? null : dummyIdent());
continue; continue;