Fixes #1871, close implicit objects in implicit returns

This commit is contained in:
xixixao
2014-01-23 20:52:26 +00:00
parent b00962db1a
commit 8b976acac1
4 changed files with 21 additions and 3 deletions

View File

@@ -386,7 +386,6 @@
moveOut -= dent;
}
}
this.indent = decreasedIndent;
if (dent) {
this.outdebt -= moveOut;
}
@@ -396,6 +395,7 @@
if (!(this.tag() === 'TERMINATOR' || noNewlines)) {
this.token('TERMINATOR', '\n', outdentLength, 0);
}
this.indent = decreasedIndent;
return this;
};

View File

@@ -305,7 +305,7 @@
_ref4 = stackTop(), stackTag = _ref4[0], stackIdx = _ref4[1], (_ref5 = _ref4[2], sameLine = _ref5.sameLine, startsLine = _ref5.startsLine);
if (inImplicitCall() && prevTag !== ',') {
endImplicitCall();
} else if (inImplicitObject() && sameLine && !startsLine) {
} else if (inImplicitObject() && sameLine && tag !== 'TERMINATOR' && prevTag !== ':') {
endImplicitObject();
} else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) {
endImplicitObject();