condition the use of locale on the exitance of JSON

This commit is contained in:
Mohamed Hegazy 2014-09-19 15:55:26 -07:00
parent d2f4cd7d92
commit 218bcd8c1e

View File

@ -201,6 +201,11 @@ module ts {
var commandLine = parseCommandLine(args);
if (commandLine.options.locale) {
if (typeof JSON === "undefined") {
reportDiagnostic(createCompilerDiagnostic(Diagnostics.The_current_host_does_not_support_the_0_option, "--locale"));
return sys.exit(1);
}
validateLocaleAndSetLanguage(commandLine.options.locale, commandLine.errors);
}