Removes trailing comma logic and fixes default values

This commit is contained in:
Tingan Ho
2015-07-29 10:26:18 +08:00
parent 5daf3f1101
commit db6e46df12
7 changed files with 275 additions and 273 deletions

View File

@@ -386,49 +386,35 @@ namespace ts {
continue;
}
if(ch === CharacterCodes.slash) {
if (text.charCodeAt(pos + 1) === CharacterCodes.slash) {
pos += 2;
while (pos <= end) {
if (isLineBreak(text.charCodeAt(pos))) {
break;
}
pos++;
}
continue;
}
else if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) {
pos += 2;
while (pos <= end) {
ch = text.charCodeAt(pos);
if (ch === CharacterCodes.asterisk &&
text.charCodeAt(pos + 1) === CharacterCodes.slash) {
pos += 2;
break;
}
pos++;
}
continue;
}
}
if (pendingCommaInsertion) {
if (ch !== CharacterCodes.closeBracket &&
ch !== CharacterCodes.closeBrace) {
result += ',';
}
pendingCommaInsertion = false;
}
switch (ch) {
case CharacterCodes.comma:
pendingCommaInsertion = true;
break;
case CharacterCodes.slash:
if (text.charCodeAt(pos + 1) === CharacterCodes.slash) {
pos += 2;
while (pos <= end) {
if (isLineBreak(text.charCodeAt(pos))) {
break;
}
pos++;
}
break;
}
else if (text.charCodeAt(pos + 1) === CharacterCodes.asterisk) {
pos += 2;
while (pos <= end) {
ch = text.charCodeAt(pos);
if (ch === CharacterCodes.asterisk &&
text.charCodeAt(pos + 1) === CharacterCodes.slash) {
pos += 2;
break;
}
pos++;
}
break;
}
case CharacterCodes.doubleQuote:
result += text[pos];