Update JSBaker.cpp

This commit is contained in:
utkarshgautamnyu 2017-09-26 12:04:03 -07:00 committed by GitHub
parent 258c32f9aa
commit 4fd0452694

View file

@ -76,7 +76,9 @@ void JSBaker::bakeJS(QFile* inputFile) {
} else if (nextCharacter == '*') { } else if (nextCharacter == '*') {
// Check if multi line comment i.e. /* // Check if multi line comment i.e. /*
handleMultiLineComments(&in); handleMultiLineComments(&in);
if (hasErrors()) {
return;
}
//Start fresh after handling comments //Start fresh after handling comments
previousCharacter = '\n'; previousCharacter = '\n';
in >> currentCharacter; in >> currentCharacter;
@ -147,13 +149,9 @@ void JSBaker::bakeJS(QFile* inputFile) {
// Reading done. Closing the inputFile // Reading done. Closing the inputFile
inputFile->close(); inputFile->close();
if (hasErrors()) { // Bake successful, Export the compressed outputFile
return; exportJS(&outputFile);
} else {
// Bake successful, Export the compressed outputFile
exportJS(&outputFile);
}
} }
void JSBaker::exportJS(QFile* bakedFile) { void JSBaker::exportJS(QFile* bakedFile) {