MXMLJSC: validate targets compiler option
diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java
index 33cfb43..9b3a2ec 100644
--- a/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java
+++ b/compiler-jx/src/main/java/org/apache/royale/compiler/clients/MXMLJSC.java
@@ -174,7 +174,7 @@
if (text.equalsIgnoreCase(jsTargetType.text))
return jsTargetType;
}
- return JS_ROYALE;
+ return null;
}
}
@@ -928,6 +928,23 @@
return false;
}
+ for(String target : config.getCompilerTargets())
+ {
+ JSTargetType jsTargetType = JSTargetType.fromString(target);
+ if (jsTargetType == null)
+ {
+ String message = "configuration variable 'targets' must be one of the following: ";
+ for (JSTargetType type : JSTargetType.values())
+ {
+ message += "'" + type.text + "', ";
+ }
+ message += "got '" + target + "'";
+ final ICompilerProblem problem = new ConfigurationProblem(null, -1,
+ -1, -1, -1, message);
+ problems.add(problem);
+ }
+ }
+
if (problems.hasErrors())
return false;