Fixed: Removed extra spaces in code generation between 'else' and 'if' in 'else if' statements

This commit is contained in:
Martin Carlberg committed 2013-04-23 17:07:26 +02:00
1 parent e35bfaf96c
commit b6fd6a15f0
1 file changed
+9 -2
+9 -2
View File
@@ -564,7 +564,10 @@ IfStatement: function(node, st, c) {
buffer;
if (generate) {
buffer = compiler.jsBuffer;
CONCAT(buffer, indentation);
if (!st.superNodeIsElse)
CONCAT(buffer, indentation);
else
delete st.superNodeIsElse;
CONCAT(buffer, "if (");
}
c(node.test, st, "Expression");
@@ -579,7 +582,11 @@ IfStatement: function(node, st, c) {
CONCAT(buffer, indentation);
CONCAT(buffer, alternateNotIf ? "else\n" : "else ");
}
if (alternateNotIf) indentation += indentStep;
if (alternateNotIf)
indentation += indentStep;
else
st.superNodeIsElse = true;
c(alternate, st, "Statement");
if (alternateNotIf) indentation = indentation.substring(indentationSpaces);
}