Fixed: objjc didn't print some errors.

Before this fix, certain errors during compilation such as not being able to load a file, would cause the compilation to fail without stating what went wrong.

This fix prints such errors and avoids crashing later when the result of the compilation is undefined.
This commit is contained in:
Alexander Ljungberg committed 2013-01-21 01:08:28 +00:00
1 parent 806c7935c5
commit cc05df412e
1 file changed
+12 -5
@@ -101,7 +101,10 @@ function compileWithResolvedFlags(aFilePath, objjcFlags, gccFlags, asPlainJavasc
delete document;
}
catch (anException)
{}
{
print(anException);
return;
}
if (shouldCompress)
{
@@ -249,10 +252,14 @@ exports.main = function(args)
print("Statically Compiling " + filePath);
var output = compileWithResolvedFlags(filePath, objjcFlags, gccFlags, asPlainJavascript);
if (shouldPrintOutput)
print(output);
else
FILE.write(outputFilePaths[index], output, { charset: "UTF-8" });
// Only write the output if the compilation didn't fail.
if (output !== undefined)
{
if (shouldPrintOutput)
print(output);
else
FILE.write(outputFilePaths[index], output, { charset: "UTF-8" });
}
});
};