[loose parser] Take brace-line indentation into account for objlit closing heuristic

This commit is contained in:
Marijn Haverbeke 2014-09-22 15:15:12 +02:00
parent 39fa62e90f
commit 49680b1c60

View File

@ -696,9 +696,10 @@
var node = startNode();
node.properties = [];
pushCx();
var indent = curIndent + 1, line = curLineStart;
next();
var propIndent = curIndent, line = curLineStart;
while (!closes(tt.braceR, propIndent + 1, line)) {
if (curIndent + 1 < indent) { indent = curIndent; line = curLineStart; }
while (!closes(tt.braceR, indent, line)) {
var name = parsePropertyName();
if (!name) { if (isDummy(parseExpression(true))) next(); eat(tt.comma); continue; }
var prop = startNode();