private static string GetOutputFileName(string[] args)
{
string filename = null;
foreach (string arg in args)
if (arg.EndsWith(".js"))
{
if (filename != null)
{
throw new ArgumentException("Only one .js file should be specified as parameter");
}
filename = arg;
}
if (filename == null)
return "Program.js";
return filename;
}