JS backend: remove ECMA 3, but several tests is broken.

Main reason: overload extention property:

Int.bar = 1
String.bar = 2
This commit is contained in:
Erokhin Stanislav
2013-08-28 19:53:15 +04:00
parent 248ec7a248
commit 4c57d70be9
20 changed files with 54 additions and 280 deletions
@@ -150,7 +150,10 @@ public class K2JSCompiler extends CLICompiler<K2JSCompilerArguments> {
@NotNull
private static Config getConfig(@NotNull K2JSCompilerArguments arguments, @NotNull Project project) {
EcmaVersion ecmaVersion = EcmaVersion.fromString(arguments.target);
if (arguments.target != null) {
assert arguments.target == "v5" : "Unsupported ECMA version: " + arguments.target;
}
EcmaVersion ecmaVersion = EcmaVersion.defaultVersion();
String moduleId = FileUtil.getNameWithoutExtension(new File(arguments.outputFile));
if (arguments.libraryFiles != null) {
return new LibrarySourcesConfig(project, moduleId, Arrays.asList(arguments.libraryFiles), ecmaVersion, arguments.sourcemap);
@@ -40,7 +40,7 @@ public class K2JSCompilerArguments extends CompilerArguments {
@Argument(value = "sourcemap", description = "Generate SourceMap")
public boolean sourcemap;
@Argument(value = "target", description = "Generate js files for specific ECMA version (3 or 5, default ECMA 3)")
@Argument(value = "target", description = "Generate js files for specific ECMA version (now support only ECMA 5)")
public String target;
@Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag")