diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 09b0cd3eaf8..00000000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -k2js \ No newline at end of file diff --git a/.idea/ant.xml b/.idea/ant.xml deleted file mode 100644 index 2581ca3fe84..00000000000 --- a/.idea/ant.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 00e9e1b79cb..00000000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/.idea/copyright/apache.xml b/.idea/copyright/apache.xml deleted file mode 100644 index 647fcdb02ef..00000000000 --- a/.idea/copyright/apache.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index ace2e994924..00000000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/.idea/dictionaries/Pavel_Talanov.xml b/.idea/dictionaries/Pavel_Talanov.xml deleted file mode 100644 index 556d1745d0f..00000000000 --- a/.idea/dictionaries/Pavel_Talanov.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index e206d70d859..00000000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index a76f2aecef0..00000000000 --- a/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b312839bf2..00000000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/libraries/guava_10_0_1.xml b/.idea/libraries/guava_10_0_1.xml deleted file mode 100644 index ef3fb899674..00000000000 --- a/.idea/libraries/guava_10_0_1.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index d10b9ab7f7b..00000000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - - - - - http://www.w3.org/1999/xhtml - - - - - - - - diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 37bb0135fbe..00000000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b8433..00000000000 --- a/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml deleted file mode 100644 index 3b000203088..00000000000 --- a/.idea/uiDesigner.xml +++ /dev/null @@ -1,125 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 275077f8255..00000000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/ideaAction.patch b/ideaAction.patch deleted file mode 100644 index 4f2eaa8fa34..00000000000 --- a/ideaAction.patch +++ /dev/null @@ -1,150 +0,0 @@ -Index: compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== ---- compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java (revision 24a2ec5) -+++ compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java (revision 4229e867af6d744d3b384dfc515cbf89caf363ae) -@@ -173,8 +173,8 @@ - List result = Lists.newArrayList(); - for (JetAnnotationEntry annotation : annotations) { - AnnotationDescriptor annotationDescriptor = new AnnotationDescriptor(); -- result.add(annotationDescriptor); -- trace.record(BindingContext.ANNOTATION, annotation, annotationDescriptor); -+ // result.add(annotationDescriptor); -+ // trace.record(BindingContext.ANNOTATION, annotation, annotationDescriptor); - } - return result; - } -Index: idea/src/META-INF/plugin.xml -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== ---- idea/src/META-INF/plugin.xml (revision 24a2ec5) -+++ idea/src/META-INF/plugin.xml (revision 4229e867af6d744d3b384dfc515cbf89caf363ae) -@@ -1,9 +1,12 @@ - - Kotlin - Kotlin language support -- @snapshot@ -+ 1.0 - JetBrains - -+ -+ -+ - - - org.jetbrains.jet.plugin.compiler.JetCompilerManager -@@ -28,16 +31,18 @@ - - - -- -- -- -- - - - - -+ -+ -+ -+ -+ -+ - - - -Index: idea/src/org/jetbrains/jet/plugin/actions/TranslateToJsAction.java -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== ---- idea/src/org/jetbrains/jet/plugin/actions/TranslateToJsAction.java (revision 4229e867af6d744d3b384dfc515cbf89caf363ae) -+++ idea/src/org/jetbrains/jet/plugin/actions/TranslateToJsAction.java (revision 4229e867af6d744d3b384dfc515cbf89caf363ae) -@@ -0,0 +1,79 @@ -+package org.jetbrains.jet.plugin.actions; -+ -+import com.intellij.notification.Notification; -+import com.intellij.notification.NotificationType; -+import com.intellij.notification.Notifications; -+import com.intellij.openapi.actionSystem.AnAction; -+import com.intellij.openapi.actionSystem.AnActionEvent; -+import com.intellij.openapi.actionSystem.LangDataKeys; -+import com.intellij.openapi.actionSystem.PlatformDataKeys; -+import com.intellij.openapi.application.ApplicationManager; -+import com.intellij.openapi.editor.Editor; -+import com.intellij.openapi.project.Project; -+import com.intellij.openapi.vfs.VirtualFile; -+import com.intellij.psi.PsiFile; -+import org.jetbrains.jet.lang.psi.JetFile; -+import org.jetbrains.k2js.facade.K2JSTranslator; -+ -+/** -+ * @author Pavel Talanov -+ */ -+public final class TranslateToJsAction extends AnAction { -+ -+ private static void notifyFailure(Throwable exception) { -+ Notifications.Bus.notify(new Notification("JsTranslator", "Translation failed.", -+ "Exception: " + exception.getMessage(), -+ NotificationType.ERROR)); -+ } -+ -+ private static void notifySuccess(String outputPath) { -+ Notifications.Bus.notify(new Notification("JsTranslator", "Translation successful.", -+ "Generated file: " + outputPath, -+ NotificationType.INFORMATION)); -+ } -+ -+ public void actionPerformed(AnActionEvent event) { -+ -+ final PsiFile psiFile = event.getData(LangDataKeys.PSI_FILE); -+ if (!(psiFile instanceof JetFile)) { -+ return; -+ } -+ -+ Runnable task = new Runnable() { -+ @Override -+ public void run() { -+ try { -+ Project project = psiFile.getProject(); -+ String outputPath = getOutputPath(psiFile); -+ K2JSTranslator.translateWithCallToMainAndSaveToFile((JetFile) psiFile, -+ outputPath, -+ project); -+ notifySuccess(outputPath); -+ } catch (Throwable e) { -+ e.printStackTrace(); -+ notifyFailure(e); -+ } -+ } -+ }; -+ ApplicationManager.getApplication().runWriteAction(task); -+ } -+ -+ private static String getOutputPath(PsiFile psiFile) { -+ VirtualFile virtualFile = psiFile.getVirtualFile(); -+ assert virtualFile != null : "Internal error: Psi file should correspond to actual virtual file"; -+ String originalFilePath = virtualFile.getPath(); -+ -+ //TODO: make platform independent -+ String pathToDir = originalFilePath.substring(0, originalFilePath.lastIndexOf("/") + 1); -+ String generatedFileName = ((JetFile) psiFile).getNamespaceHeader().getName() + ".js"; -+ return pathToDir + generatedFileName; -+ } -+ -+ -+ @Override -+ public void update(AnActionEvent e) { -+ Editor editor = e.getData(PlatformDataKeys.EDITOR); -+ PsiFile psiFile = e.getData(LangDataKeys.PSI_FILE); -+ e.getPresentation().setEnabled(editor != null && psiFile instanceof JetFile); -+ } -+} diff --git a/js.ast/AUTHORS b/js.ast/AUTHORS deleted file mode 100644 index fea9b245e9a..00000000000 --- a/js.ast/AUTHORS +++ /dev/null @@ -1,8 +0,0 @@ -# Below is a list of people and organizations that have contributed -# to the Dart project. Names should be added to the list like so: -# -# Name/Organization - -Google Inc. - -Ola Martin Bini diff --git a/js.ast/LICENSE b/js.ast/LICENSE deleted file mode 100644 index 64ed1a49724..00000000000 --- a/js.ast/LICENSE +++ /dev/null @@ -1,48 +0,0 @@ -This license applies to all parts of Dart that are not externally -maintained libraries. The external maintained libraries used by -Dart are: - -JSCRE - in runtime/third_party/jscre -Ant - in third_party/apache_ant -Google App Engine for Java SDK - in third_party/appengine-java-sdk -args4j - in third_party/args4j -Chrome SDK - in third_party/chromesdk -Eclipse - in third_party/eclipse -gsutil = in third_party/gsutil -Guava - in third_party/guava -hamcrest - in third_party/hamcrest -Httplib2 - in third_party/httplib2 -Jetty - in third_party/jetty -JSON - in third_party/json -JUnit - in third_party/junit -Ouath - in third_party/oauth2client -Python-scss - in third_party/pyscss -Rhino - in third_party/rhino - -The libraries may have their own licenses; we recommend you read them, -as their terms may differ from the terms below. - -Copyright 2011, the Dart project authors. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/js.ast/PATENTS b/js.ast/PATENTS deleted file mode 100644 index 69541968b91..00000000000 --- a/js.ast/PATENTS +++ /dev/null @@ -1,23 +0,0 @@ -Additional IP Rights Grant (Patents) - -"This implementation" means the copyrightable works distributed by -Google as part of the Dart Project. - -Google hereby grants to you a perpetual, worldwide, non-exclusive, -no-charge, royalty-free, irrevocable (except as stated in this -section) patent license to make, have made, use, offer to sell, sell, -import, transfer, and otherwise run, modify and propagate the contents -of this implementation of Dart, where such license applies only to -those patent claims, both currently owned by Google and acquired in -the future, licensable by Google that are necessarily infringed by -this implementation of Dart. This grant does not include claims that -would be infringed only as a consequence of further modification of -this implementation. If you or your agent or exclusive licensee -institute or order or agree to the institution of patent litigation -against any entity (including a cross-claim or counterclaim in a -lawsuit) alleging that this implementation of Dart or any code -incorporated within this implementation of Dart constitutes direct or -contributory patent infringement, or inducement of patent -infringement, then any patent rights granted to you under this License -for this implementation of Dart shall terminate as of the date such -litigation is filed. diff --git a/js.ast/js.ast.iml b/js.ast/js.ast.iml deleted file mode 100644 index 73bb50aea75..00000000000 --- a/js.ast/js.ast.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/js.ast/js.iml b/js.ast/js.iml deleted file mode 100644 index 1e3480a2bfb..00000000000 --- a/js.ast/js.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/js.ast/src/com/google/dart/compiler/InternalCompilerException.java b/js.ast/src/com/google/dart/compiler/InternalCompilerException.java deleted file mode 100644 index 5db265e920a..00000000000 --- a/js.ast/src/com/google/dart/compiler/InternalCompilerException.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler; - -/** - * Exception thrown when the compiler encounters an unexpected internal error. - */ -public class InternalCompilerException extends RuntimeException { - - public InternalCompilerException(String message) { - super(message); - } -} diff --git a/js.ast/src/com/google/dart/compiler/Source.java b/js.ast/src/com/google/dart/compiler/Source.java deleted file mode 100644 index 13e6e16cbdd..00000000000 --- a/js.ast/src/com/google/dart/compiler/Source.java +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler; - -import java.io.IOException; -import java.io.Reader; -import java.net.URI; - -/** - * Abstract interface to a source file. - */ -public interface Source { - - /** - * Determines whether the given source exists. - */ - boolean exists(); - - /** - * Returns the last-modified timestamp for this source, using the same units as - * {@link java.util.Date#getTime()}. - */ - long getLastModified(); - - /** - * Gets the name of this source. - */ - String getName(); - - /** - * Gets a reader for the dart file's source code. The caller is responsible for closing the - * returned reader. - */ - Reader getSourceReader() throws IOException; - - /** - * Gets the identifier for this source. This is used to uniquely identify the - * source, but should not be used to obtain the source content. Use - * {@link #getSourceReader()} to obtain the source content. - */ - URI getUri(); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/Cloner.java b/js.ast/src/com/google/dart/compiler/backend/js/Cloner.java deleted file mode 100644 index fa3447fe168..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/Cloner.java +++ /dev/null @@ -1,232 +0,0 @@ -// Copyright 2011, the Dart project authors. All rights reserved. -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following -// disclaimer in the documentation and/or other materials provided -// with the distribution. -// * Neither the name of Google Inc. nor the names of its -// contributors may be used to endorse or promote products derived -// from this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.InternalCompilerException; -import com.google.dart.compiler.backend.js.ast.*; - -import java.util.ArrayList; -import java.util.List; -import java.util.Stack; - -/** - * Implements actual cloning logic. We rely on the JsExpressions to provide - * traversal logic. The {@link #stack} field is used to accumulate - * already-cloned JsExpression instances. One gotcha that falls out of this is - * that argument lists are on the stack in reverse order, so lists should be - * constructed via inserts, rather than appends. - */ -public class Cloner extends JsVisitor { - protected final Stack stack = new Stack(); - private boolean successful = true; - - /** - * @param expression - * @return Return a clone of the expression tree - */ - public static JsExpression clone(JsExpression expression) { - Cloner c = new Cloner(); - c.accept(expression); - return c.getExpression(); - } - - @Override - public void endVisit(JsArrayAccess x, JsContext ctx) { - JsArrayAccess newExpression = new JsArrayAccess(); - newExpression.setIndexExpr(stack.pop()); - newExpression.setArrayExpr(stack.pop()); - stack.push(newExpression); - } - - @Override - public void endVisit(JsArrayLiteral x, JsContext ctx) { - JsArrayLiteral toReturn = new JsArrayLiteral(); - List expressions = toReturn.getExpressions(); - int size = x.getExpressions().size(); - while (size-- > 0) { - expressions.add(0, stack.pop()); - } - stack.push(toReturn); - } - - @Override - public void endVisit(JsBinaryOperation x, JsContext ctx) { - JsBinaryOperation toReturn = new JsBinaryOperation(x.getOperator()); - toReturn.setArg2(stack.pop()); - toReturn.setArg1(stack.pop()); - stack.push(toReturn); - } - - @Override - public void endVisit(JsBooleanLiteral x, JsContext ctx) { - stack.push(x); - } - - @Override - public void endVisit(JsConditional x, JsContext ctx) { - JsConditional toReturn = new JsConditional(); - toReturn.setElseExpression(stack.pop()); - toReturn.setThenExpression(stack.pop()); - toReturn.setTestExpression(stack.pop()); - stack.push(toReturn); - } - - /** - * The only functions that would get be visited are those being used as - * first-class objects. - */ - @Override - public void endVisit(JsFunction x, JsContext ctx) { - // Set a flag to indicate that we cannot continue, and push a null so - // we don't run out of elements on the stack. - successful = false; - stack.push(null); - } - - /** - * Cloning the invocation allows us to modify it without damaging other call - * sites. - */ - @Override - public void endVisit(JsInvocation x, JsContext ctx) { - JsInvocation toReturn = new JsInvocation(); - List params = toReturn.getArguments(); - int size = x.getArguments().size(); - while (size-- > 0) { - params.add(0, stack.pop()); - } - toReturn.setQualifier(stack.pop()); - stack.push(toReturn); - } - - /** - * Do a deep clone of a JsNameRef. Because JsNameRef chains are shared - * throughout the AST, you can't just go and change their qualifiers when - * re-writing an invocation. - */ - @Override - public void endVisit(JsNameRef x, JsContext ctx) { - JsNameRef toReturn; - JsName name = x.getName(); - if (name != null) { - toReturn = new JsNameRef(name); - } else { - toReturn = new JsNameRef(x.getIdent()); - } - - if (x.getQualifier() != null) { - toReturn.setQualifier(stack.pop()); - } - stack.push(toReturn); - } - - @Override - public void endVisit(JsNew x, JsContext ctx) { - int size = x.getArguments().size(); - List arguments = new ArrayList(size); - while (size-- > 0) { - arguments.add(0, stack.pop()); - } - JsNew toReturn = new JsNew(stack.pop()); - toReturn.getArguments().addAll(arguments); - stack.push(toReturn); - } - - @Override - public void endVisit(JsNullLiteral x, JsContext ctx) { - stack.push(x); - } - - @Override - public void endVisit(JsNumberLiteral x, JsContext ctx) { - stack.push(x); - } - - @Override - public void endVisit(JsObjectLiteral x, JsContext ctx) { - JsObjectLiteral toReturn = new JsObjectLiteral(); - List inits = toReturn.getPropertyInitializers(); - - int size = x.getPropertyInitializers().size(); - while (size-- > 0) { - /* - * JsPropertyInitializers are the only non-JsExpression objects that we - * care about, so we just go ahead and create the objects in the loop, - * rather than expecting it to be on the stack and having to perform - * narrowing casts at all stack.pop() invocations. - */ - JsPropertyInitializer newInit = new JsPropertyInitializer(); - newInit.setValueExpr(stack.pop()); - newInit.setLabelExpr(stack.pop()); - - inits.add(0, newInit); - } - stack.push(toReturn); - } - - @Override - public void endVisit(JsPostfixOperation x, JsContext ctx) { - JsPostfixOperation toReturn = new JsPostfixOperation(x.getOperator()); - toReturn.setArg(stack.pop()); - stack.push(toReturn); - } - - @Override - public void endVisit(JsPrefixOperation x, JsContext ctx) { - JsPrefixOperation toReturn = new JsPrefixOperation(x.getOperator()); - toReturn.setArg(stack.pop()); - stack.push(toReturn); - } - - @Override - public void endVisit(JsRegExp x, JsContext ctx) { - stack.push(x); - } - - @Override - public void endVisit(JsStringLiteral x, JsContext ctx) { - stack.push(x); - } - - @Override - public void endVisit(JsThisRef x, JsContext ctx) { - stack.push(new JsThisRef()); - } - - public JsExpression getExpression() { - return (successful && checkStack()) ? stack.peek() : null; - } - - private boolean checkStack() { - if (stack.size() > 1) { - throw new InternalCompilerException("Too many expressions on stack"); - } - - return stack.size() == 1; - } -} - diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.java b/js.ast/src/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.java deleted file mode 100644 index a15af6b44ed..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.java +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.backend.js.ast.*; - -/** - * Searches for method invocations in constructor expressions that would not - * normally be surrounded by parentheses. - */ -public class JsConstructExpressionVisitor extends JsVisitor { - - public static boolean exec(JsExpression expression) { - if (JsPrecedenceVisitor.exec(expression) < JsPrecedenceVisitor.PRECEDENCE_NEW) { - return true; - } - JsConstructExpressionVisitor visitor = new JsConstructExpressionVisitor(); - visitor.accept(expression); - return visitor.containsInvocation; - } - - private boolean containsInvocation = false; - - private JsConstructExpressionVisitor() { - } - - /** - * We only look at the array expression since the index has its own scope. - */ - @Override - public boolean visit(JsArrayAccess x, JsContext ctx) { - accept(x.getArrayExpr()); - return false; - } - - /** - * Array literals have their own scoping. - */ - @Override - public boolean visit(JsArrayLiteral x, JsContext ctx) { - return false; - } - - /** - * Functions have their own scoping. - */ - @Override - public boolean visit(JsFunction x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsInvocation x, JsContext ctx) { - containsInvocation = true; - return false; - } - - @Override - public boolean visit(JsNameRef x, JsContext ctx) { - if (!x.isLeaf()) { - accept(x.getQualifier()); - } - return false; - } - - /** - * New constructs bind to the nearest set of parentheses. - */ - @Override - public boolean visit(JsNew x, JsContext ctx) { - return false; - } - - /** - * Object literals have their own scope. - */ - @Override - public boolean visit(JsObjectLiteral x, JsContext ctx) { - return false; - } - - /** - * We only look at nodes that would not normally be surrounded by parentheses. - */ - @Override - protected T doAccept(T node) { - // Assign to Object to prevent 'inconvertible types' toJsAst errors due - // to http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6548436 - // reproducible in jdk1.6.0_02. - Object o = node; - if (o instanceof JsExpression) { - JsExpression expression = (JsExpression) o; - int precedence = JsPrecedenceVisitor.exec(expression); - // Only visit expressions that won't automatically be surrounded by - // parentheses - if (precedence < JsPrecedenceVisitor.PRECEDENCE_NEW) { - return node; - } - } - return super.doAccept(node); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.java b/js.ast/src/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.java deleted file mode 100644 index 0fdb8a5032b..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.java +++ /dev/null @@ -1,119 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.backend.js.ast.*; - -/** - * Determines if an expression statement needs to be surrounded by parentheses. - * - * The statement or the left-most expression needs to be surrounded by - * parentheses if the left-most expression is an object literal or a function - * object. Function declarations do not need parentheses. - * - * For example the following require parentheses:
- *
    - *
  • { key : 'value'}
  • - *
  • { key : 'value'}.key
  • - *
  • function () {return 1;}()
  • - *
  • function () {return 1;}.prototype
  • - *
- * - * The following do not require parentheses:
- *
    - *
  • var x = { key : 'value'}
  • - *
  • "string" + { key : 'value'}.key
  • - *
  • function func() {}
  • - *
  • function() {}
  • - *
- */ -public class JsFirstExpressionVisitor extends JsVisitor { - - public static boolean exec(JsExprStmt statement) { - JsFirstExpressionVisitor visitor = new JsFirstExpressionVisitor(); - JsExpression expression = statement.getExpression(); - // Pure function declarations do not need parentheses - if (expression instanceof JsFunction) { - return false; - } - visitor.accept(statement.getExpression()); - return visitor.needsParentheses; - } - - private boolean needsParentheses = false; - - private JsFirstExpressionVisitor() { - } - - @Override - public boolean visit(JsArrayAccess x, JsContext ctx) { - accept(x.getArrayExpr()); - return false; - } - - @Override - public boolean visit(JsArrayLiteral x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsBinaryOperation x, JsContext ctx) { - accept(x.getArg1()); - return false; - } - - @Override - public boolean visit(JsConditional x, JsContext ctx) { - accept(x.getTestExpression()); - return false; - } - - @Override - public boolean visit(JsFunction x, JsContext ctx) { - needsParentheses = true; - return false; - } - - @Override - public boolean visit(JsInvocation x, JsContext ctx) { - accept(x.getQualifier()); - return false; - } - - @Override - public boolean visit(JsNameRef x, JsContext ctx) { - if (!x.isLeaf()) { - accept(x.getQualifier()); - } - return false; - } - - @Override - public boolean visit(JsNew x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsObjectLiteral x, JsContext ctx) { - needsParentheses = true; - return false; - } - - @Override - public boolean visit(JsPostfixOperation x, JsContext ctx) { - accept(x.getArg()); - return false; - } - - @Override - public boolean visit(JsPrefixOperation x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsRegExp x, JsContext ctx) { - return false; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsNamer.java b/js.ast/src/com/google/dart/compiler/backend/js/JsNamer.java deleted file mode 100644 index 0c49ad05750..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsNamer.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.backend.js.ast.JsProgram; - -/** - * A namer runs through a program and renames the short names of JsNames. - * Namers must assign short names that don't clash and that are valid - * JS-identifiers. Nested JsScopes must not shadow JsNames from outer - * scopes. - * If a JsName is marked as non-obfuscatable then it must retain its short - * name. - */ -public interface JsNamer { - /** - * GlobalNames the shortNames of all JsNames of the program so that they are valid - * JS-identifiers and that there are no clashes and no shadowing. - */ - public void exec(JsProgram program); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsNormalizer.java b/js.ast/src/com/google/dart/compiler/backend/js/JsNormalizer.java deleted file mode 100644 index 04c5530cd42..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsNormalizer.java +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.backend.js.ast.*; - -/** - * Fixes any semantic errors introduced by JS AST gen. - * - *
    - *
  • Creating clinit calls can put comma expressions as lvalues; the modifying - * operation must be moved inside the comma expression to the last argument.
  • - *
- */ -public class JsNormalizer { - - /** - * Resolves any unresolved JsNameRefs. - */ - private static class JsNormalizing extends JsModVisitor { - - @Override - public void endVisit(JsBinaryOperation x, JsContext ctx) { - maybeShuffleModifyingBinary(x, ctx); - } - - @Override - public void endVisit(JsPostfixOperation x, JsContext ctx) { - maybeShuffleModifyingUnary(x, ctx); - } - - @Override - public void endVisit(JsPrefixOperation x, JsContext ctx) { - maybeShuffleModifyingUnary(x, ctx); - } - - /** - * Due to the way clinits are constructed, you can end up with a comma - * operation as the argument to a modifying operation, which is illegal. - * Juggle things to put the operator inside of the comma expression. - */ - private void maybeShuffleModifyingBinary(JsBinaryOperation x, JsContext ctx) { - JsBinaryOperator myOp = x.getOperator(); - JsExpression lhs = x.getArg1(); - - if (myOp.isAssignment() && (lhs instanceof JsBinaryOperation)) { - // Find the rightmost comma operation - JsBinaryOperation curLhs = (JsBinaryOperation) lhs; - assert (curLhs.getOperator() == JsBinaryOperator.COMMA); - while (curLhs.getArg2() instanceof JsBinaryOperation) { - curLhs = (JsBinaryOperation) curLhs.getArg2(); - assert (curLhs.getOperator() == JsBinaryOperator.COMMA); - } - // curLhs is now the rightmost comma operation; slide our operation in - x.setArg1(curLhs.getArg2()); - curLhs.setArg2(x); - // replace myself with the comma expression - ctx.replaceMe(lhs); - } - } - - /** - * Due to the way clinits are constructed, you can end up with a comma - * operation as the argument to a modifying operation, which is illegal. - * Juggle things to put the operator inside of the comma expression. - */ - private void maybeShuffleModifyingUnary(JsUnaryOperation x, JsContext ctx) { - JsUnaryOperator myOp = x.getOperator(); - JsExpression arg = x.getArg(); - if (myOp.isModifying() && (arg instanceof JsBinaryOperation)) { - // Find the rightmost comma operation - JsBinaryOperation curArg = (JsBinaryOperation) arg; - assert (curArg.getOperator() == JsBinaryOperator.COMMA); - while (curArg.getArg2() instanceof JsBinaryOperation) { - curArg = (JsBinaryOperation) curArg.getArg2(); - assert (curArg.getOperator() == JsBinaryOperator.COMMA); - } - // curArg is now the rightmost comma operation; slide our operation in - x.setArg(curArg.getArg2()); - curArg.setArg2(x); - // replace myself with the comma expression - ctx.replaceMe(arg); - } - } - } - - public static void exec(JsProgram program) { - new JsNormalizer(program).execImpl(); - } - - private final JsProgram program; - - private JsNormalizer(JsProgram program) { - this.program = program; - } - - private void execImpl() { - JsNormalizing normalizer = new JsNormalizing(); - normalizer.accept(program); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsParserException.java b/js.ast/src/com/google/dart/compiler/backend/js/JsParserException.java deleted file mode 100644 index 79b53c1d69e..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsParserException.java +++ /dev/null @@ -1,92 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -/** - * Indicates inability to parse JavaScript source. - */ -public class JsParserException extends Exception { - - /** - * Represents the location of a parser exception. - */ - public static class SourceDetail { - private final String fileName; - private final int line; - private final int lineOffset; - private final String lineSource; - - public SourceDetail(int line, String lineSource, int lineOffset, String fileName) { - this.line = line; - this.lineSource = lineSource; - this.lineOffset = lineOffset; - this.fileName = fileName; - } - - public String getFileName() { - return fileName; - } - - public int getLine() { - return line; - } - - public int getLineOffset() { - return lineOffset; - } - - public String getLineSource() { - return lineSource; - } - } - - private static String createMessageWithDetail(String msg, SourceDetail sourceDetail) { - if (sourceDetail == null) { - return msg; - } - StringBuffer sb = new StringBuffer(); - sb.append(sourceDetail.getFileName()); - sb.append('('); - sb.append(sourceDetail.getLine()); - sb.append(')'); - sb.append(": "); - sb.append(msg); - if (sourceDetail.getLineSource() != null) { - sb.append("\n> "); - sb.append(sourceDetail.getLineSource()); - sb.append("\n> "); - for (int i = 0, n = sourceDetail.getLineOffset(); i < n; ++i) { - sb.append('-'); - } - sb.append('^'); - } - return sb.toString(); - } - - private final SourceDetail sourceDetail; - - public JsParserException(String msg) { - this(msg, null); - } - - public JsParserException(String msg, int line, String lineSource, int lineOffset, String fileName) { - this(msg, new SourceDetail(line, lineSource, lineOffset, fileName)); - } - - public JsParserException(String msg, SourceDetail sourceDetail) { - super(createMessageWithDetail(msg, sourceDetail)); - this.sourceDetail = sourceDetail; - } - - /** - * Provides additional source detail in some cases. - * - * @return additional detail regarding the error, or null if no - * additional detail is available - */ - public SourceDetail getSourceDetail() { - return sourceDetail; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.java b/js.ast/src/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.java deleted file mode 100644 index c3a58b64e22..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.java +++ /dev/null @@ -1,274 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.backend.js.ast.*; - -/** - * Precedence indices from "JavaScript - The Definitive Guide" 4th Edition (page - * 57) - * - * Precedence 17 is for indivisible primaries that either don't have children, - * or provide their own delimiters. - * - * Precedence 16 is for really important things that have their own AST classes. - * - * Precedence 15 is for the new construct. - * - * Precedence 14 is for unary operators. - * - * Precedences 12 through 4 are for non-assigning binary operators. - * - * Precedence 3 is for the tertiary conditional. - * - * Precedence 2 is for assignments. - * - * Precedence 1 is for comma operations. - */ -class JsPrecedenceVisitor extends JsVisitor { - - static final int PRECEDENCE_NEW = 15; - - public static int exec(JsExpression expression) { - JsPrecedenceVisitor visitor = new JsPrecedenceVisitor(); - visitor.accept(expression); - if (visitor.answer < 0) { - throw new RuntimeException("Precedence must be >= 0!"); - } - return visitor.answer; - } - - private int answer = -1; - - private JsPrecedenceVisitor() { - } - - @Override - public boolean visit(JsArrayAccess x, JsContext ctx) { - answer = 16; - return false; - } - - @Override - public boolean visit(JsArrayLiteral x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsBinaryOperation x, JsContext ctx) { - answer = x.getOperator().getPrecedence(); - return false; - } - - @Override - public boolean visit(JsBlock x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsBooleanLiteral x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsBreak x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsCase x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsCatch x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsConditional x, JsContext ctx) { - answer = 3; - return false; - } - - @Override - public boolean visit(JsContinue x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsDebugger x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsDefault x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsDoWhile x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsEmpty x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsExprStmt x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsFor x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsForIn x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsFunction x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsIf x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsInvocation x, JsContext ctx) { - answer = 16; - return false; - } - - @Override - public boolean visit(JsLabel x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsNameRef x, JsContext ctx) { - if (x.isLeaf()) { - answer = 17; // primary - } else { - answer = 16; // property access - } - return false; - } - - @Override - public boolean visit(JsNew x, JsContext ctx) { - answer = PRECEDENCE_NEW; - return false; - } - - @Override - public boolean visit(JsNullLiteral x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsNumberLiteral x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsObjectLiteral x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsParameter x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsPostfixOperation x, JsContext ctx) { - answer = x.getOperator().getPrecedence(); - return false; - } - - @Override - public boolean visit(JsPrefixOperation x, JsContext ctx) { - answer = x.getOperator().getPrecedence(); - return false; - } - - @Override - public boolean visit(JsProgram x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsPropertyInitializer x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsRegExp x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsReturn x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsStringLiteral x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsSwitch x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsThisRef x, JsContext ctx) { - answer = 17; // primary - return false; - } - - @Override - public boolean visit(JsThrow x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsTry x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsVars.JsVar x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsVars x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } - - @Override - public boolean visit(JsWhile x, JsContext ctx) { - throw new RuntimeException("Only expressions have precedence."); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsPrettyNamer.java b/js.ast/src/com/google/dart/compiler/backend/js/JsPrettyNamer.java deleted file mode 100644 index 2c61e01f6b3..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsPrettyNamer.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsProgram; -import com.google.dart.compiler.backend.js.ast.JsRootScope; -import com.google.dart.compiler.backend.js.ast.JsScope; - -import java.util.*; - -/** - * A namer that uses short, readable idents to maximize reability. - */ -public class JsPrettyNamer implements JsNamer { - - public JsPrettyNamer() { - this.program = null; - } - - @Override - public void exec(JsProgram program) { - new JsPrettyNamer(program).execImpl(); - } - - /** - * Communicates to a parent scope all the idents used by all child scopes. - */ - private Set childIdents = null; - - private final JsProgram program; - - /** - * A map containing the next integer to try as an identifier suffix for a - * given JsScope. - */ - private IdentityHashMap> startIdentForScope = - new IdentityHashMap>(); - - protected JsPrettyNamer(JsProgram program) { - this.program = program; - } - - private void execImpl() { - visit(program.getRootScope()); - } - - private boolean isLegal(JsScope scope, Set childIdents, String newIdent) { - if (JsReservedIdentifiers.isKeyword(newIdent)) { - return false; - } - if (childIdents.contains(newIdent)) { - // one of my children already claimed this ident - return false; - } - /* - * Never obfuscate a name into an identifier that conflicts with an existing - * unobfuscatable name! It's okay if it conflicts with an existing - * obfuscatable name; that name will get obfuscated out of the way. - */ - return (scope.findExistingUnobfuscatableName(newIdent) == null); - } - - private void visit(JsScope scope) { - HashMap startIdent = startIdentForScope.get(scope); - if (startIdent == null) { - startIdent = new HashMap(); - startIdentForScope.put(scope, startIdent); - } - - // Save off the childIdents which is currently being computed for my parent. - Set myChildIdents = childIdents; - - /* - * Visit my children first. Reset childIdents so that my children will get a - * clean slate: I do not communicate to my children. - */ - childIdents = new HashSet(); - List children = scope.getChildren(); - for (Iterator it = children.iterator(); it.hasNext();) { - visit(it.next()); - } - - JsRootScope rootScope = program.getRootScope(); - if (scope == rootScope) { - return; - } - - // Visit all my idents. - for (Iterator it = scope.getAllNames(); it.hasNext();) { - JsName name = it.next(); - if (!name.isObfuscatable()) { - // Unobfuscatable names become themselves. - name.setShortIdent(name.getIdent()); - continue; - } - - String newIdent = name.getShortIdent(); - if (!isLegal(scope, childIdents, newIdent)) { - String checkIdent; - - // Start searching using a suffix hint stored in the scope. - // We still do a search in case there is a collision with - // a user-provided identifier - Integer s = startIdent.get(newIdent); - int suffix = (s == null) ? 0 : s.intValue(); - do { - checkIdent = newIdent + "_" + suffix++; - } while (!isLegal(scope, childIdents, checkIdent)); - startIdent.put(newIdent, suffix); - name.setShortIdent(checkIdent); - } else { - // nothing to do; the short name is already good - } - childIdents.add(name.getShortIdent()); - } - myChildIdents.addAll(childIdents); - childIdents = myChildIdents; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.java b/js.ast/src/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.java deleted file mode 100644 index f4095c5c822..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.java +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.backend.js.ast.*; - -/** - * Determines if a statement at the end of a block requires a semicolon. - * - * For example, the following statements require semicolons:
- *
    - *
  • if (cond);
  • - *
  • while (cond);
  • - *
- * - * The following do not require semicolons:
- *
    - *
  • return 1
  • - *
  • do {} while(true)
  • - *
- */ -public class JsRequiresSemiVisitor extends JsVisitor { - - public static boolean exec(JsStatement lastStatement) { - JsRequiresSemiVisitor visitor = new JsRequiresSemiVisitor(); - visitor.accept(lastStatement); - return visitor.needsSemicolon; - } - - private boolean needsSemicolon = false; - - private JsRequiresSemiVisitor() { - } - - @Override - public boolean visit(JsBlock x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsBreak x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsDebugger x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsDoWhile x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsEmpty x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsExprStmt x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsFor x, JsContext ctx) { - if (x.getBody() instanceof JsEmpty) { - needsSemicolon = true; - } - return false; - } - - @Override - public boolean visit(JsForIn x, JsContext ctx) { - if (x.getBody() instanceof JsEmpty) { - needsSemicolon = true; - } - return false; - } - - @Override - public boolean visit(JsIf x, JsContext ctx) { - JsStatement thenStmt = x.getThenStmt(); - JsStatement elseStmt = x.getElseStmt(); - JsStatement toCheck = thenStmt; - if (elseStmt != null) { - toCheck = elseStmt; - } - if (toCheck instanceof JsEmpty) { - needsSemicolon = true; - } else { - // Must recurse to determine last statement (possible if-else chain). - accept(toCheck); - } - return false; - } - - @Override - public boolean visit(JsLabel x, JsContext ctx) { - if (x.getStmt() instanceof JsEmpty) { - needsSemicolon = true; - } - return false; - } - - @Override - public boolean visit(JsReturn x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsSwitch x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsThrow x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsTry x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsVars x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsWhile x, JsContext ctx) { - if (x.getBody() instanceof JsEmpty) { - needsSemicolon = true; - } - return false; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsReservedIdentifiers.java b/js.ast/src/com/google/dart/compiler/backend/js/JsReservedIdentifiers.java deleted file mode 100644 index 56ae5428a3d..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsReservedIdentifiers.java +++ /dev/null @@ -1,223 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import java.util.HashSet; -import java.util.Set; - -/** - * Determines whether or not a particular string is a JavaScript keyword or not. - */ -public class JsReservedIdentifiers { - - private static Set javaScriptKeywords; - private static Set reservedGlobalSymbols; - private static Set reservedPropertySymbols; - - static { - javaScriptKeywords = new HashSet(); - reservedGlobalSymbols = new HashSet(); - reservedPropertySymbols = new HashSet(); - initJavaScriptKeywords(); - initReservedGlobalSymbols(); - initReservedPropertySymbols(); - } - - public static boolean isKeyword(String s) { - return javaScriptKeywords.contains(s); - } - - private static void initJavaScriptKeywords() { - String[] keywords = new String[] { - // These are current keywords - "break", "delete", "function", "return", "typeof", "case", "do", "if", "switch", "var", - "catch", "else", "in", "this", "void", "continue", "false", "instanceof", "throw", - "while", "debugger", "finally", "new", "true", "with", "default", "for", - "null", "try", - - // These are future keywords - "abstract", "double", "goto", "native", "static", "boolean", "enum", "implements", - "package", "super", "byte", "export", "import", "private", "synchronized", "char", - "extends", "int", "protected", "throws", "class", "final", "interface", "public", - "transient", "const", "float", "long", "short", "volatile" - }; - - for (int i = 0; i < keywords.length; i++) { - javaScriptKeywords.add(keywords[i]); - } - } - - /** - * @return a set containing all known reserved global identifiers. This set must not be modified. - */ - public static Set getReservedGlobalSymbols() { - return reservedGlobalSymbols; - } - - /** - * Returns true if the string s can not be used as a global identifier. The check includes - * JavaScript keywords (as they must not be used either). - * @param s - * @return true if the given String must not be used as a global identifier. - */ - public static boolean isReservedGlobalSymbol(String s) { - return isKeyword(s) || reservedGlobalSymbols.contains(s); - } - - private static void initReservedGlobalSymbols() { - // Section references are from Ecma-262 - // (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf) - String[] commonBuiltins = new String[] { - // 15.1.1 Value Properties of the Global Object - "NaN", "Infinity", "undefined", - - // 15.1.2 Function Properties of the Global Object - "eval", "parseInt", "parseFloat", "isNan", "isFinite", - - // 15.1.3 URI Handling Function Properties - "decodeURI", "decodeURIComponent", - "encodeURI", - "encodeURIComponent", - - // 15.1.4 Constructor Properties of the Global Object - "Object", "Function", "Array", "String", "Boolean", "Number", "Date", - "RegExp", "Error", "EvalError", "RangeError", "ReferenceError", - "SyntaxError", "TypeError", "URIError", - - // 15.1.5 Other Properties of the Global Object - "Math", - - // 10.1.6 Activation Object - "arguments", - - // B.2 Additional Properties (non-normative) - "escape", "unescape", - - // Window props (https://developer.mozilla.org/en/DOM/window) - "applicationCache", "closed", "Components", "content", "controllers", - "crypto", "defaultStatus", "dialogArguments", "directories", - "document", "frameElement", "frames", "fullScreen", "globalStorage", - "history", "innerHeight", "innerWidth", "length", - "location", "locationbar", "localStorage", "menubar", - "mozInnerScreenX", "mozInnerScreenY", "mozScreenPixelsPerCssPixel", - "name", "navigator", "opener", "outerHeight", "outerWidth", - "pageXOffset", "pageYOffset", "parent", "personalbar", "pkcs11", - "returnValue", "screen", "scrollbars", "scrollMaxX", "scrollMaxY", - "self", "sessionStorage", "sidebar", "status", "statusbar", "toolbar", - "top", "window", - - // Window methods (https://developer.mozilla.org/en/DOM/window) - "alert", "addEventListener", "atob", "back", "blur", "btoa", - "captureEvents", "clearInterval", "clearTimeout", "close", "confirm", - "disableExternalCapture", "dispatchEvent", "dump", - "enableExternalCapture", "escape", "find", "focus", "forward", - "GeckoActiveXObject", "getAttention", "getAttentionWithCycleCount", - "getComputedStyle", "getSelection", "home", "maximize", "minimize", - "moveBy", "moveTo", "open", "openDialog", "postMessage", "print", - "prompt", "QueryInterface", "releaseEvents", "removeEventListener", - "resizeBy", "resizeTo", "restore", "routeEvent", "scroll", "scrollBy", - "scrollByLines", "scrollByPages", "scrollTo", "setInterval", - "setResizeable", "setTimeout", "showModalDialog", "sizeToContent", - "stop", "uuescape", "updateCommands", "XPCNativeWrapper", - "XPCSafeJSOjbectWrapper", - - // Mozilla Window event handlers, same cite - "onabort", "onbeforeunload", "onchange", "onclick", "onclose", - "oncontextmenu", "ondragdrop", "onerror", "onfocus", "onhashchange", - "onkeydown", "onkeypress", "onkeyup", "onload", "onmousedown", - "onmousemove", "onmouseout", "onmouseover", "onmouseup", - "onmozorientation", "onpaint", "onreset", "onresize", "onscroll", - "onselect", "onsubmit", "onunload", - - // Safari Web Content Guide - // http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/SafariWebContent.pdf - // WebKit Window member data, from WebKit DOM Reference - // (http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/WebKitDOMRef/DOMWindow_idl/Classes/DOMWindow/index.html) - // TODO(fredsa) Many, many more functions and member data to add - "ontouchcancel", "ontouchend", "ontouchmove", "ontouchstart", - "ongesturestart", "ongesturechange", "ongestureend", - - // extra window methods - "uneval", - - // keywords https://developer.mozilla.org/en/New_in_JavaScript_1.7, - // https://developer.mozilla.org/en/New_in_JavaScript_1.8.1 - "getPrototypeOf", "let", "yield", - - // "future reserved words" - "abstract", "int", "short", "boolean", "interface", "static", "byte", - "long", "char", "final", "native", "synchronized", "float", "package", - "throws", "goto", "private", "transient", "implements", "protected", - "volatile", "double", "public", - - // IE methods - // (http://msdn.microsoft.com/en-us/library/ms535873(VS.85).aspx#) - "attachEvent", "clientInformation", "clipboardData", "createPopup", - "dialogHeight", "dialogLeft", "dialogTop", "dialogWidth", - "onafterprint", "onbeforedeactivate", "onbeforeprint", - "oncontrolselect", "ondeactivate", "onhelp", "onresizeend", - - // Common browser-defined identifiers not defined in ECMAScript - "event", "external", "Debug", "Enumerator", "Global", "Image", - "ActiveXObject", "VBArray", "Components", - - // Functions commonly defined on Object - "toString", "getClass", "constructor", "prototype", "valueOf", - - // Client-side JavaScript identifiers, which are needed for linkers - // that don't ensure GWT's window != $wnd, document != $doc, etc. - // Taken from the Rhino book, pg 715 - "Anchor", "Applet", "Attr", "Canvas", "CanvasGradient", - "CanvasPattern", "CanvasRenderingContext2D", "CDATASection", - "CharacterData", "Comment", "CSS2Properties", "CSSRule", - "CSSStyleSheet", "Document", "DocumentFragment", "DocumentType", - "DOMException", "DOMImplementation", "DOMParser", "Element", "Event", - "ExternalInterface", "FlashPlayer", "Form", "Frame", "History", - "HTMLCollection", "HTMLDocument", "HTMLElement", "IFrame", "Image", - "Input", "JSObject", "KeyEvent", "Link", "Location", "MimeType", - "MouseEvent", "Navigator", "Node", "NodeList", "Option", "Plugin", - "ProcessingInstruction", "Range", "RangeException", "Screen", "Select", - "Table", "TableCell", "TableRow", "TableSelection", "Text", "TextArea", - "UIEvent", "Window", "XMLHttpRequest", "XMLSerializer", - "XPathException", "XPathResult", "XSLTProcessor", - - // These keywords trigger the loading of the java-plugin. For the - // next-generation plugin, this results in starting a new Java process. - "java", "Packages", "netscape", "sun", "JavaObject", "JavaClass", - "JavaArray", "JavaMember", - - // GWT-defined identifiers - "$wnd", "$doc", "$entry", "$moduleName", "$moduleBase", "$gwt_version", "$sessionId", - - // Identifiers used by JsStackEmulator; later set to obfuscatable - "$stack", "$stackDepth", "$location", - - // TODO: prove why this is necessary or remove it - "call" - }; - for (int i = 0; i < commonBuiltins.length; i++) { - reservedGlobalSymbols.add(commonBuiltins[i]); - } - } - - /** - * Returns true if the given string can not be used as property symbol. The check excludes - * keywords as JavaScript allow keywords as properties. - * @param s - * @return true if the given string must not be used as a property. - */ - public static boolean isReservedPropertySymbol(String s) { - return reservedPropertySymbols.contains(s); - } - - private static void initReservedPropertySymbols() { - // TODO(floitsch): fill in reserved property symbols. - reservedPropertySymbols.add("__PROTO__"); - reservedPropertySymbols.add("prototype"); - } - - private JsReservedIdentifiers() { - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.java b/js.ast/src/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.java deleted file mode 100644 index 3a2689f65da..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.util.TextOutput; -import com.google.dart.compiler.backend.js.ast.JsContext; -import com.google.dart.compiler.backend.js.ast.JsProgramFragment; -import com.google.dart.compiler.backend.js.ast.JsBlock; -import com.google.dart.compiler.backend.js.ast.JsProgram; - -/** - * Generates JavaScript source from an AST. - */ -public class JsSourceGenerationVisitor extends JsToStringGenerationVisitor { - - public JsSourceGenerationVisitor(TextOutput out) { - super(out); - } - - @Override - public boolean visit(JsProgram x, JsContext ctx) { - // Descend naturally. - return true; - } - - @Override - public boolean visit(JsProgramFragment x, JsContext ctx) { - // Descend naturally. - return true; - } - - @Override - public boolean visit(JsBlock x, JsContext ctx) { - printJsBlock(x, false, true); - return false; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java b/js.ast/src/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java deleted file mode 100644 index a078eca30ac..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.java +++ /dev/null @@ -1,1331 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.TextOutput; - -import java.util.*; -import java.util.regex.Pattern; - -//import com.google.debugging.sourcemap.FilePosition; - -/** - * Produces text output from a JavaScript AST. - */ -public class JsToStringGenerationVisitor extends JsVisitor { - - private static final char[] CHARS_BREAK = "break".toCharArray(); - private static final char[] CHARS_CASE = "case".toCharArray(); - private static final char[] CHARS_CATCH = "catch".toCharArray(); - private static final char[] CHARS_CONTINUE = "continue".toCharArray(); - private static final char[] CHARS_DEBUGGER = "debugger".toCharArray(); - private static final char[] CHARS_DEFAULT = "default".toCharArray(); - private static final char[] CHARS_DO = "do".toCharArray(); - private static final char[] CHARS_ELSE = "else".toCharArray(); - private static final char[] CHARS_FALSE = "false".toCharArray(); - private static final char[] CHARS_FINALLY = "finally".toCharArray(); - private static final char[] CHARS_FOR = "for".toCharArray(); - private static final char[] CHARS_FUNCTION = "function".toCharArray(); - private static final char[] CHARS_IF = "if".toCharArray(); - private static final char[] CHARS_IN = "in".toCharArray(); - private static final char[] CHARS_NEW = "new".toCharArray(); - private static final char[] CHARS_NULL = "null".toCharArray(); - private static final char[] CHARS_RETURN = "return".toCharArray(); - private static final char[] CHARS_SWITCH = "switch".toCharArray(); - private static final char[] CHARS_THIS = "this".toCharArray(); - private static final char[] CHARS_THROW = "throw".toCharArray(); - private static final char[] CHARS_TRUE = "true".toCharArray(); - private static final char[] CHARS_TRY = "try".toCharArray(); - private static final char[] CHARS_VAR = "var".toCharArray(); - private static final char[] CHARS_WHILE = "while".toCharArray(); - private static final char[] HEX_DIGITS = { - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; - - /** - * How many lines of code to print inside of a JsBlock when printing terse. - */ - private static final int JSBLOCK_LINES_TO_PRINT = 3; - - /** - * A variable name is valid if it contains only letters, numbers, _, $ and - * does not begin with a number. There are actually other valid variable - * names, such as ones that contain escaped Unicode characters, but we - * surround those names with quotes in property initializers to be safe. - */ - private static final Pattern VALID_NAME_PATTERN = Pattern.compile("[a-zA-Z_$][\\w$]*"); - - public static String javaScriptString(String value) { - return javaScriptString(value, false); - } - - /** - * Generate JavaScript code that evaluates to the supplied string. Adapted - * from - * . The difference is that we quote with either " or ' depending on - * which one is used less inside the string. - */ - public static String javaScriptString(String value, boolean forceDoubleQuote) { - char[] chars = value.toCharArray(); - final int n = chars.length; - int quoteCount = 0; - int aposCount = 0; - for (int i = 0; i < n; ++i) { - switch (chars[i]) { - case '"': - ++quoteCount; - break; - case '\'': - ++aposCount; - break; - } - } - - StringBuffer result = new StringBuffer(value.length() + 16); - - char quoteChar = (quoteCount < aposCount || forceDoubleQuote) ? '"' : '\''; - result.append(quoteChar); - - for (int i = 0; i < n; ++i) { - char c = chars[i]; - - if (' ' <= c && c <= '~' && c != quoteChar && c != '\\') { - // an ordinary print character (like C isprint()) - result.append(c); - continue; - } - - int escape = -1; - switch (c) { - case '\b': - escape = 'b'; - break; - case '\f': - escape = 'f'; - break; - case '\n': - escape = 'n'; - break; - case '\r': - escape = 'r'; - break; - case '\t': - escape = 't'; - break; - case '"': - escape = '"'; - break; // only reach here if == quoteChar - case '\'': - escape = '\''; - break; // only reach here if == quoteChar - case '\\': - escape = '\\'; - break; - } - - if (escape >= 0) { - // an \escaped sort of character - result.append('\\'); - result.append((char) escape); - } else { - /* - * Emit characters from 0 to 31 that don't have a single character - * escape sequence in octal where possible. This saves one or two - * characters compared to the hexadecimal format '\xXX'. - * - * These short octal sequences may only be used at the end of the string - * or where the following character is a non-digit. Otherwise, the - * following character would be incorrectly interpreted as belonging to - * the sequence. - */ - if (c < ' ' && (i == n - 1 || chars[i + 1] < '0' || chars[i + 1] > '9')) { - result.append('\\'); - if (c > 0x7) { - result.append((char) ('0' + (0x7 & (c >> 3)))); - } - result.append((char) ('0' + (0x7 & c))); - } else { - int hexSize; - if (c < 256) { - // 2-digit hex - result.append("\\x"); - hexSize = 2; - } else { - // Unicode. - result.append("\\u"); - hexSize = 4; - } - // append hexadecimal form of ch left-padded with 0 - for (int shift = (hexSize - 1) * 4; shift >= 0; shift -= 4) { - int digit = 0xf & (c >> shift); - result.append(HEX_DIGITS[digit]); - } - } - } - } - result.append(quoteChar); - escapeClosingTags(result); - String resultString = result.toString(); - return resultString; - } - - /** - * Escapes any closing XML tags embedded in str, which could - * potentially cause a parse failure in a browser, for example, embedding a - * closing <script> tag. - * - * @param str an unescaped literal; May be null - */ - private static void escapeClosingTags(StringBuffer str) { - if (str == null) { - return; - } - - int index = 0; - - while ((index = str.indexOf(" globalBlocks = new HashSet(); - private final TextOutput p; - private ArrayList statementEnds = new ArrayList(); - private ArrayList statementStarts = new ArrayList(); - private boolean buildMappings; - //private List mappings = Lists.newArrayList(); - - public JsToStringGenerationVisitor(TextOutput out) { - this.p = out; - } - - /** - * @param generate Whether to translate the source map. - */ - public void generateSourceMap(boolean generate) { - this.buildMappings = generate; - } - -// public void writeSourceMap(Appendable out, String name) throws IOException { -// GenerateSourceMap generator = new GenerateSourceMap(); -// for (SourceMapping m : mappings) { -// generator.addMapping(m.getNode(), m.getStart(), m.getEnd()); -// } -// generator.appendTo(out, name); -// } - - @Override - public void doTraverse(JsVisitable x, JsContext ctx) { - //SourceMapping m = null; - // TODO(johnlenz): filter out uninteresting node types - if (buildMappings) { - // m = new SourceMapping((HasSourceInfo) x, new FilePosition(p.getLine(), p.getColumn())); - // mappings.add(m); - } - - super.doTraverse(x, ctx); - - if (buildMappings) { - // m.setEnd(new FilePosition(p.getLine(), p.getColumn())); - } - } - - @Override - public boolean visit(JsArrayAccess x, JsContext ctx) { - JsExpression arrayExpr = x.getArrayExpr(); - _parenPush(x, arrayExpr, false); - accept(arrayExpr); - _parenPop(x, arrayExpr, false); - _lsquare(); - accept(x.getIndexExpr()); - _rsquare(); - return false; - } - - @Override - public boolean visit(JsArrayLiteral x, JsContext ctx) { - _lsquare(); - boolean sep = false; - for (Object element : x.getExpressions()) { - JsExpression arg = (JsExpression) element; - sep = _sepCommaOptSpace(sep); - _parenPushIfCommaExpr(arg); - accept(arg); - _parenPopIfCommaExpr(arg); - } - _rsquare(); - return false; - } - - @Override - public boolean visit(JsBinaryOperation x, JsContext ctx) { - JsBinaryOperator op = x.getOperator(); - JsExpression arg1 = x.getArg1(); - _parenPush(x, arg1, !op.isLeftAssociative()); - accept(arg1); - if (op.isKeyword()) { - _parenPopOrSpace(x, arg1, !op.isLeftAssociative()); - } else { - _parenPop(x, arg1, !op.isLeftAssociative()); - _spaceOpt(); - } - p.print(op.getSymbol()); - JsExpression arg2 = x.getArg2(); - if (_spaceCalc(op, arg2)) { - _parenPushOrSpace(x, arg2, op.isLeftAssociative()); - } else { - _spaceOpt(); - _parenPush(x, arg2, op.isLeftAssociative()); - } - accept(arg2); - _parenPop(x, arg2, op.isLeftAssociative()); - return false; - } - - @Override - public boolean visit(JsBlock x, JsContext ctx) { - printJsBlock(x, true, true); - return false; - } - - @Override - public boolean visit(JsBooleanLiteral x, JsContext ctx) { - if (x.getValue()) { - _true(); - } else { - _false(); - } - return false; - } - - @Override - public boolean visit(JsBreak x, JsContext ctx) { - _break(); - - JsNameRef label = x.getLabel(); - if (label != null) { - _space(); - _nameRef(label); - } - - return false; - } - - @Override - public boolean visit(JsCase x, JsContext ctx) { - _case(); - _space(); - accept(x.getCaseExpr()); - _colon(); - _newlineOpt(); - - indent(); - for (Object element : x.getStmts()) { - JsStatement stmt = (JsStatement) element; - needSemi = true; - accept(stmt); - if (needSemi) { - _semi(); - } - _newlineOpt(); - } - outdent(); - needSemi = false; - return false; - } - - @Override - public boolean visit(JsCatch x, JsContext ctx) { - _spaceOpt(); - _catch(); - _spaceOpt(); - _lparen(); - _nameDef(x.getParameter().getName()); - - // Optional catch condition. - // - JsExpression catchCond = x.getCondition(); - if (catchCond != null) { - _space(); - _if(); - _space(); - accept(catchCond); - } - - _rparen(); - _spaceOpt(); - accept(x.getBody()); - - return false; - } - - @Override - public boolean visit(JsConditional x, JsContext ctx) { - // Associativity: for the then and else branches, it is safe to insert - // another - // ternary expression, but if the test expression is a ternary, it should - // get parentheses around it. - { - JsExpression testExpression = x.getTestExpression(); - _parenPush(x, testExpression, true); - accept(testExpression); - _parenPop(x, testExpression, true); - } - _questionMark(); - { - JsExpression thenExpression = x.getThenExpression(); - _parenPush(x, thenExpression, false); - accept(thenExpression); - _parenPop(x, thenExpression, false); - } - _colon(); - { - JsExpression elseExpression = x.getElseExpression(); - _parenPush(x, elseExpression, false); - accept(elseExpression); - _parenPop(x, elseExpression, false); - } - return false; - } - - @Override - public boolean visit(JsContinue x, JsContext ctx) { - _continue(); - - JsNameRef label = x.getLabel(); - if (label != null) { - _space(); - _nameRef(label); - } - - return false; - } - - @Override - public boolean visit(JsDebugger x, JsContext ctx) { - _debugger(); - return false; - } - - @Override - public boolean visit(JsDefault x, JsContext ctx) { - _default(); - _colon(); - - indent(); - for (Object element : x.getStmts()) { - JsStatement stmt = (JsStatement) element; - needSemi = true; - accept(stmt); - if (needSemi) { - _semi(); - } - _newlineOpt(); - } - outdent(); - needSemi = false; - return false; - } - - @Override - public boolean visit(JsDoWhile x, JsContext ctx) { - _do(); - _nestedPush(x.getBody(), true); - accept(x.getBody()); - _nestedPop(x.getBody()); - if (needSemi) { - _semi(); - _newlineOpt(); - } else { - _spaceOpt(); - needSemi = true; - } - _while(); - _spaceOpt(); - _lparen(); - accept(x.getCondition()); - _rparen(); - return false; - } - - @Override - public boolean visit(JsEmpty x, JsContext ctx) { - return false; - } - - @Override - public boolean visit(JsExprStmt x, JsContext ctx) { - boolean surroundWithParentheses = JsFirstExpressionVisitor.exec(x); - if (surroundWithParentheses) { - _lparen(); - } - JsExpression expr = x.getExpression(); - accept(expr); - if (surroundWithParentheses) { - _rparen(); - } - return false; - } - - @Override - public boolean visit(JsFor x, JsContext ctx) { - _for(); - _spaceOpt(); - _lparen(); - - // The init expressions or var decl. - // - if (x.getInitExpr() != null) { - accept(x.getInitExpr()); - } else if (x.getInitVars() != null) { - accept(x.getInitVars()); - } - - _semi(); - - // The loop test. - // - if (x.getCondition() != null) { - _spaceOpt(); - accept(x.getCondition()); - } - - _semi(); - - // The incr expression. - // - if (x.getIncrExpr() != null) { - _spaceOpt(); - accept(x.getIncrExpr()); - } - - _rparen(); - _nestedPush(x.getBody(), false); - accept(x.getBody()); - _nestedPop(x.getBody()); - return false; - } - - @Override - public boolean visit(JsForIn x, JsContext ctx) { - _for(); - _spaceOpt(); - _lparen(); - - if (x.getIterVarName() != null) { - _var(); - _space(); - _nameDef(x.getIterVarName()); - - if (x.getIterExpr() != null) { - _spaceOpt(); - _assignment(); - _spaceOpt(); - accept(x.getIterExpr()); - } - } else { - // Just a name ref. - // - accept(x.getIterExpr()); - } - - _space(); - _in(); - _space(); - accept(x.getObjExpr()); - - _rparen(); - _nestedPush(x.getBody(), false); - accept(x.getBody()); - _nestedPop(x.getBody()); - return false; - } - - // function foo(a, b) { - // stmts... - // } - // - @Override - public boolean visit(JsFunction x, JsContext ctx) { - _function(); - - // Functions can be anonymous. - // - if (x.getName() != null) { - _space(); - _nameOf(x); - } - - _lparen(); - boolean sep = false; - for (Object element : x.getParameters()) { - JsParameter param = (JsParameter) element; - sep = _sepCommaOptSpace(sep); - accept(param); - } - _rparen(); - - accept(x.getBody()); - needSemi = true; - return false; - } - - @Override - public boolean visit(JsIf x, JsContext ctx) { - _if(); - _spaceOpt(); - _lparen(); - accept(x.getIfExpr()); - _rparen(); - JsStatement thenStmt = x.getThenStmt(); - _nestedPush(thenStmt, false); - accept(thenStmt); - _nestedPop(thenStmt); - JsStatement elseStmt = x.getElseStmt(); - if (elseStmt != null) { - if (needSemi) { - _semi(); - _newlineOpt(); - } else { - _spaceOpt(); - needSemi = true; - } - _else(); - boolean elseIf = elseStmt instanceof JsIf; - if (!elseIf) { - _nestedPush(elseStmt, true); - } else { - _space(); - } - accept(elseStmt); - if (!elseIf) { - _nestedPop(elseStmt); - } - } - return false; - } - - @Override - public boolean visit(JsInvocation x, JsContext ctx) { - JsExpression qualifier = x.getQualifier(); - _parenPush(x, qualifier, false); - accept(qualifier); - _parenPop(x, qualifier, false); - - _lparen(); - boolean sep = false; - for (Object element : x.getArguments()) { - JsExpression arg = (JsExpression) element; - sep = _sepCommaOptSpace(sep); - _parenPushIfCommaExpr(arg); - accept(arg); - _parenPopIfCommaExpr(arg); - } - _rparen(); - return false; - } - - @Override - public boolean visit(JsLabel x, JsContext ctx) { - _nameOf(x); - _colon(); - _spaceOpt(); - accept(x.getStmt()); - return false; - } - - @Override - public boolean visit(JsNameRef x, JsContext ctx) { - JsExpression q = x.getQualifier(); - if (q != null) { - _parenPush(x, q, false); - if (q instanceof JsNumberLiteral) { - /** - * Fix for Issue #3796. "42.foo" is not allowed, but "(42).foo" is. - */ - _lparen(); - } - accept(q); - if (q instanceof JsNumberLiteral) { - _rparen(); - } - _parenPop(x, q, false); - _dot(); - } - _nameRef(x); - return false; - } - - @Override - public boolean visit(JsNew x, JsContext ctx) { - _new(); - _space(); - - JsExpression ctorExpr = x.getConstructorExpression(); - boolean needsParens = JsConstructExpressionVisitor.exec(ctorExpr); - if (needsParens) { - _lparen(); - } - accept(ctorExpr); - if (needsParens) { - _rparen(); - } - - /* - * If a constructor call has no arguments, it may simply be replaced with - * "new Constructor" with no parentheses. - */ - List args = x.getArguments(); - if (args.size() > 0) { - _lparen(); - boolean sep = false; - for (JsExpression arg : args) { - sep = _sepCommaOptSpace(sep); - _parenPushIfCommaExpr(arg); - accept(arg); - _parenPopIfCommaExpr(arg); - } - _rparen(); - } - - return false; - } - - @Override - public boolean visit(JsNullLiteral x, JsContext ctx) { - _null(); - return false; - } - - @Override - public boolean visit(JsNumberLiteral x, JsContext ctx) { - double dvalue = x.getValue(); - long lvalue = (long) dvalue; - if (lvalue == dvalue) { - p.print(Long.toString(lvalue)); - } else { - p.print(Double.toString(dvalue)); - } - return false; - } - - @Override - public boolean visit(JsObjectLiteral x, JsContext ctx) { - _lbrace(); - boolean sep = false; - for (Object element : x.getPropertyInitializers()) { - sep = _sepCommaOptSpace(sep); - JsPropertyInitializer propInit = (JsPropertyInitializer) element; - printLabel : { - JsExpression labelExpr = propInit.getLabelExpr(); - // labels can be either string, integral, or decimal literals - if (labelExpr instanceof JsStringLiteral) { - String propName = ((JsStringLiteral) labelExpr).getValue(); - if (VALID_NAME_PATTERN.matcher(propName).matches() - && !JsReservedIdentifiers.isKeyword(propName)) { - p.print(propName); - break printLabel; - } - } - accept(labelExpr); - } - _colon(); - JsExpression valueExpr = propInit.getValueExpr(); - _parenPushIfCommaExpr(valueExpr); - accept(valueExpr); - _parenPopIfCommaExpr(valueExpr); - } - _rbrace(); - return false; - } - - @Override - public boolean visit(JsParameter x, JsContext ctx) { - _nameOf(x); - return false; - } - - @Override - public boolean visit(JsPostfixOperation x, JsContext ctx) { - JsUnaryOperator op = x.getOperator(); - JsExpression arg = x.getArg(); - // unary operators always associate correctly (I think) - _parenPush(x, arg, false); - accept(arg); - _parenPop(x, arg, false); - p.print(op.getSymbol()); - return false; - } - - @Override - public boolean visit(JsPrefixOperation x, JsContext ctx) { - JsUnaryOperator op = x.getOperator(); - p.print(op.getSymbol()); - JsExpression arg = x.getArg(); - if (_spaceCalc(op, arg)) { - _space(); - } - // unary operators always associate correctly (I think) - _parenPush(x, arg, false); - accept(arg); - _parenPop(x, arg, false); - return false; - } - - @Override - public boolean visit(JsProgram x, JsContext ctx) { - p.print(""); - return false; - } - - @Override - public boolean visit(JsProgramFragment x, JsContext ctx) { - p.print(""); - return false; - } - - @Override - public boolean visit(JsPropertyInitializer x, JsContext ctx) { - // Since there are separators, we actually print the property init - // in visit(JsObjectLiteral). - // - return false; - } - - @Override - public boolean visit(JsRegExp x, JsContext ctx) { - _slash(); - p.print(x.getPattern()); - _slash(); - String flags = x.getFlags(); - if (flags != null) { - p.print(flags); - } - return false; - } - - @Override - public boolean visit(JsReturn x, JsContext ctx) { - _return(); - JsExpression expr = x.getExpr(); - if (expr != null) { - _space(); - accept(expr); - } - return false; - } - - @Override - public boolean visit(JsStringLiteral x, JsContext ctx) { - printStringLiteral(x.getValue()); - return false; - } - - @Override - public boolean visit(JsSwitch x, JsContext ctx) { - _switch(); - _spaceOpt(); - _lparen(); - accept(x.getExpr()); - _rparen(); - _spaceOpt(); - _blockOpen(); - acceptList(x.getCases()); - _blockClose(); - return false; - } - - @Override - public boolean visit(JsThisRef x, JsContext ctx) { - _this(); - return false; - } - - @Override - public boolean visit(JsThrow x, JsContext ctx) { - _throw(); - _space(); - accept(x.getExpr()); - return false; - } - - @Override - public boolean visit(JsTry x, JsContext ctx) { - _try(); - _spaceOpt(); - accept(x.getTryBlock()); - - acceptList(x.getCatches()); - - JsBlock finallyBlock = x.getFinallyBlock(); - if (finallyBlock != null) { - _spaceOpt(); - _finally(); - _spaceOpt(); - accept(finallyBlock); - } - - return false; - } - - @Override - public boolean visit(JsVars.JsVar x, JsContext ctx) { - _nameOf(x); - JsExpression initExpr = x.getInitExpr(); - if (initExpr != null) { - _spaceOpt(); - _assignment(); - _spaceOpt(); - _parenPushIfCommaExpr(initExpr); - accept(initExpr); - _parenPopIfCommaExpr(initExpr); - } - return false; - } - - @Override - public boolean visit(JsVars x, JsContext ctx) { - _var(); - _space(); - boolean sep = false; - for (JsVars.JsVar var : x) { - sep = _sepCommaOptSpace(sep); - accept(var); - } - return false; - } - - @Override - public boolean visit(JsWhile x, JsContext ctx) { - _while(); - _spaceOpt(); - _lparen(); - accept(x.getCondition()); - _rparen(); - _nestedPush(x.getBody(), false); - accept(x.getBody()); - _nestedPop(x.getBody()); - return false; - } - - // CHECKSTYLE_NAMING_OFF - protected void _newline() { - p.newline(); - } - - protected void _newlineOpt() { - p.newlineOpt(); - } - - protected void printJsBlock(JsBlock x, boolean truncate, boolean finalNewline) { - boolean needBraces = !x.isGlobalBlock(); - - if (needBraces) { - // Open braces. - // - _blockOpen(); - } - - int count = 0; - for (Iterator iter = x.getStatements().iterator(); iter.hasNext(); ++count) { - boolean isGlobal = x.isGlobalBlock() || globalBlocks.contains(x); - - if (truncate && count > JSBLOCK_LINES_TO_PRINT) { - p.print("[...]"); - _newlineOpt(); - break; - } - JsStatement stmt = iter.next(); - needSemi = true; - boolean shouldRecordPositions = isGlobal && !(stmt instanceof JsBlock); - boolean stmtIsGlobalBlock = false; - if (isGlobal) { - if (stmt instanceof JsBlock) { - // A block inside a global block is still considered global - stmtIsGlobalBlock = true; - globalBlocks.add((JsBlock) stmt); - } - } - if (shouldRecordPositions) { - statementStarts.add(p.getPosition()); - } - accept(stmt); - if (stmtIsGlobalBlock) { - globalBlocks.remove(stmt); - } - if (needSemi) { - /* - * Special treatment of function decls: If they are the only item in a - * statement (i.e. not part of an assignment operation), just give them - * a newline instead of a semi. - */ - boolean functionStmt = - stmt instanceof JsExprStmt && ((JsExprStmt) stmt).getExpression() instanceof JsFunction; - /* - * Special treatment of the last statement in a block: only a few - * statements at the end of a block require semicolons. - */ - boolean lastStatement = !iter.hasNext() && needBraces && !JsRequiresSemiVisitor.exec(stmt); - if (functionStmt) { - if (lastStatement) { - _newlineOpt(); - } else { - _newline(); - } - } else { - if (lastStatement) { - _semiOpt(); - } else { - _semi(); - } - _newlineOpt(); - } - } - if (shouldRecordPositions) { - assert (statementStarts.size() == statementEnds.size() + 1); - statementEnds.add(p.getPosition()); - } - } - - if (needBraces) { - // _blockClose() modified - p.indentOut(); - p.print('}'); - if (finalNewline) { - _newlineOpt(); - } - } - needSemi = false; - } - - private void _assignment() { - p.print('='); - } - - private void _blockClose() { - p.indentOut(); - p.print('}'); - _newlineOpt(); - } - - private void _blockOpen() { - p.print('{'); - p.indentIn(); - _newlineOpt(); - } - - private void _break() { - p.print(CHARS_BREAK); - } - - private void _case() { - p.print(CHARS_CASE); - } - - private void _catch() { - p.print(CHARS_CATCH); - } - - private void _colon() { - p.print(':'); - } - - private void _continue() { - p.print(CHARS_CONTINUE); - } - - private void _debugger() { - p.print(CHARS_DEBUGGER); - } - - private void _default() { - p.print(CHARS_DEFAULT); - } - - private void _do() { - p.print(CHARS_DO); - } - - private void _dot() { - p.print('.'); - } - - private void _else() { - p.print(CHARS_ELSE); - } - - private void _false() { - p.print(CHARS_FALSE); - } - - private void _finally() { - p.print(CHARS_FINALLY); - } - - private void _for() { - p.print(CHARS_FOR); - } - - private void _function() { - p.print(CHARS_FUNCTION); - } - - private void _if() { - p.print(CHARS_IF); - } - - private void _in() { - p.print(CHARS_IN); - } - - private void _lbrace() { - p.print('{'); - } - - private void _lparen() { - p.print('('); - } - - private void _lsquare() { - p.print('['); - } - - private void _nameDef(JsName name) { - p.print(name.getShortIdent()); - } - - private void _nameOf(HasName hasName) { - _nameDef(hasName.getName()); - } - - private void _nameRef(JsNameRef nameRef) { - p.print(nameRef.getShortIdent()); - } - - private boolean _nestedPop(JsStatement statement) { - boolean pop = !(statement instanceof JsBlock); - if (pop) { - p.indentOut(); - } - return pop; - } - - private boolean _nestedPush(JsStatement statement, boolean needSpace) { - boolean push = !(statement instanceof JsBlock); - if (push) { - if (needSpace) { - _space(); - } - p.indentIn(); - _newlineOpt(); - } else { - _spaceOpt(); - } - return push; - } - - private void _new() { - p.print(CHARS_NEW); - } - - private void _null() { - p.print(CHARS_NULL); - } - - private boolean _parenCalc(JsExpression parent, JsExpression child, boolean wrongAssoc) { - int parentPrec = JsPrecedenceVisitor.exec(parent); - int childPrec = JsPrecedenceVisitor.exec(child); - return (parentPrec > childPrec || (parentPrec == childPrec && wrongAssoc)); - } - - private boolean _parenPop(JsExpression parent, JsExpression child, boolean wrongAssoc) { - boolean doPop = _parenCalc(parent, child, wrongAssoc); - if (doPop) { - _rparen(); - } - return doPop; - } - - private boolean _parenPopIfCommaExpr(JsExpression x) { - boolean doPop = - x instanceof JsBinaryOperation - && ((JsBinaryOperation) x).getOperator() == JsBinaryOperator.COMMA; - if (doPop) { - _rparen(); - } - return doPop; - } - - private boolean _parenPopOrSpace(JsExpression parent, JsExpression child, boolean wrongAssoc) { - boolean doPop = _parenCalc(parent, child, wrongAssoc); - if (doPop) { - _rparen(); - } else { - _space(); - } - return doPop; - } - - private boolean _parenPush(JsExpression parent, JsExpression child, boolean wrongAssoc) { - boolean doPush = _parenCalc(parent, child, wrongAssoc); - if (doPush) { - _lparen(); - } - return doPush; - } - - private boolean _parenPushIfCommaExpr(JsExpression x) { - boolean doPush = - x instanceof JsBinaryOperation - && ((JsBinaryOperation) x).getOperator() == JsBinaryOperator.COMMA; - if (doPush) { - _lparen(); - } - return doPush; - } - - private boolean _parenPushOrSpace(JsExpression parent, JsExpression child, boolean wrongAssoc) { - boolean doPush = _parenCalc(parent, child, wrongAssoc); - if (doPush) { - _lparen(); - } else { - _space(); - } - return doPush; - } - - private void _questionMark() { - p.print('?'); - } - - private void _rbrace() { - p.print('}'); - } - - private void _return() { - p.print(CHARS_RETURN); - } - - private void _rparen() { - p.print(')'); - } - - private void _rsquare() { - p.print(']'); - } - - private void _semi() { - p.print(';'); - } - - private void _semiOpt() { - p.printOpt(';'); - } - - private boolean _sepCommaOptSpace(boolean sep) { - if (sep) { - p.print(','); - _spaceOpt(); - } - return true; - } - - private void _slash() { - p.print('/'); - } - - private void _space() { - p.print(' '); - } - - /** - * Decide whether, if op is printed followed by arg, - * there needs to be a space between the operator and expression. - * - * @return true if a space needs to be printed - */ - private boolean _spaceCalc(JsOperator op, JsExpression arg) { - if (op.isKeyword()) { - return true; - } - if (arg instanceof JsBinaryOperation) { - JsBinaryOperation binary = (JsBinaryOperation) arg; - /* - * If the binary operation has a higher precedence than op, then it won't - * be parenthesized, so check the first argument of the binary operation. - */ - if (binary.getOperator().getPrecedence() > op.getPrecedence()) { - return _spaceCalc(op, binary.getArg1()); - } - return false; - } - if (arg instanceof JsPrefixOperation) { - JsOperator op2 = ((JsPrefixOperation) arg).getOperator(); - return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG) - && (op2 == JsUnaryOperator.DEC || op2 == JsUnaryOperator.NEG) - || (op == JsBinaryOperator.ADD && op2 == JsUnaryOperator.INC); - } - if (arg instanceof JsNumberLiteral) { - JsNumberLiteral literal = (JsNumberLiteral) arg; - return (op == JsBinaryOperator.SUB || op == JsUnaryOperator.NEG) && (literal.getValue() < 0); - } - return false; - } - - private void _spaceOpt() { - p.printOpt(' '); - } - - private void _switch() { - p.print(CHARS_SWITCH); - } - - private void _this() { - p.print(CHARS_THIS); - } - - private void _throw() { - p.print(CHARS_THROW); - } - - private void _true() { - p.print(CHARS_TRUE); - } - - private void _try() { - p.print(CHARS_TRY); - } - - private void _var() { - p.print(CHARS_VAR); - } - - private void _while() { - p.print(CHARS_WHILE); - } - - // CHECKSTYLE_NAMING_ON - - private void indent() { - p.indentIn(); - } - - private void outdent() { - p.indentOut(); - } - - private void printStringLiteral(String value) { - String resultString = javaScriptString(value); - p.print(resultString); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/UncheckedJsParserException.java b/js.ast/src/com/google/dart/compiler/backend/js/UncheckedJsParserException.java deleted file mode 100644 index c2db8120537..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/UncheckedJsParserException.java +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js; - -/** - * An unchecked wrapper exception to interop with Rhino. - */ -class UncheckedJsParserException extends RuntimeException { - - private final JsParserException parserException; - - public UncheckedJsParserException(JsParserException parserException) { - this.parserException = parserException; - } - - public JsParserException getParserException() { - return parserException; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/CanBooleanEval.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/CanBooleanEval.java deleted file mode 100644 index 8f4364d94f2..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/CanBooleanEval.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * An interface that describes the boolean evaluation of an expression. - */ -public interface CanBooleanEval { - - boolean isBooleanFalse(); - - boolean isBooleanTrue(); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/HasArguments.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/HasArguments.java deleted file mode 100644 index 5a47c567606..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/HasArguments.java +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.List; - -/** - * Implemented by JavaScript objects that accept arguments. - */ -public interface HasArguments { - List getArguments(); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/HasCondition.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/HasCondition.java deleted file mode 100644 index 082f4e15eb3..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/HasCondition.java +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Implemented by JavaScript objects with conditional execution. - */ -public interface HasCondition { - - JsExpression getCondition(); - - void setCondition(JsExpression condition); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/HasName.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/HasName.java deleted file mode 100644 index 8daed3769f4..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/HasName.java +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Implemented by JavaScript objects that have a name. - */ -public interface HasName { - JsName getName(); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsArrayAccess.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsArrayAccess.java deleted file mode 100644 index 46df5108086..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsArrayAccess.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a javascript expression for array access. - */ -public final class JsArrayAccess extends JsExpression { - - private JsExpression arrayExpr; - private JsExpression indexExpr; - - public JsArrayAccess() { - super(); - } - - public JsArrayAccess(JsExpression arrayExpr, JsExpression indexExpr) { - this.arrayExpr = arrayExpr; - this.indexExpr = indexExpr; - } - - public JsExpression getArrayExpr() { - return arrayExpr; - } - - public JsExpression getIndexExpr() { - return indexExpr; - } - - @Override - public boolean hasSideEffects() { - return arrayExpr.hasSideEffects() || indexExpr.hasSideEffects(); - } - - @Override - public boolean isDefinitelyNotNull() { - return false; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - public void setArrayExpr(JsExpression arrayExpr) { - this.arrayExpr = arrayExpr; - } - - public void setIndexExpr(JsExpression indexExpr) { - this.indexExpr = indexExpr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - arrayExpr = v.accept(arrayExpr); - indexExpr = v.accept(indexExpr); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.ARRAY_ACCESS; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.java deleted file mode 100644 index 8cb9f7e6d52..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represents a JavaScript expression for array literals. - */ -public final class JsArrayLiteral extends JsLiteral { - - private final List exprs = new ArrayList(); - - public JsArrayLiteral() { - super(); - } - - public List getExpressions() { - return exprs; - } - - @Override - public boolean hasSideEffects() { - for (JsExpression expr : exprs) { - if (expr.hasSideEffects()) { - return true; - } - } - return false; - } - - @Override - public boolean isBooleanFalse() { - return false; - } - - @Override - public boolean isBooleanTrue() { - return true; - } - - @Override - public boolean isDefinitelyNotNull() { - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - v.acceptWithInsertRemove(exprs); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.ARRAY; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.java deleted file mode 100644 index b09d50c1d05..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.java +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript binary operation. - */ -public final class JsBinaryOperation extends JsExpression { - - private JsExpression arg1; - private JsExpression arg2; - private final JsBinaryOperator op; - - public JsBinaryOperation(JsBinaryOperator op) { - this(op, null, null); - } - - public JsBinaryOperation(JsBinaryOperator op, JsExpression arg1, JsExpression arg2) { - this.op = op; - this.arg1 = arg1; - this.arg2 = arg2; - } - - public JsExpression getArg1() { - return arg1; - } - - public JsExpression getArg2() { - return arg2; - } - - public JsBinaryOperator getOperator() { - return op; - } - - @Override - public boolean hasSideEffects() { - return op.isAssignment() || arg1.hasSideEffects() || arg2.hasSideEffects(); - } - - @Override - public boolean isDefinitelyNotNull() { - // Precarious coding, but none of these can have null results. - if (op.getPrecedence() > 5) { - return true; - } - if (op == JsBinaryOperator.OR) { - if (arg1 instanceof CanBooleanEval) { - if (((CanBooleanEval) arg1).isBooleanTrue()) { - assert arg1.isDefinitelyNotNull(); - return true; - } - } - } - // AND and OR can return nulls - if (op.isAssignment()) { - if (op == JsBinaryOperator.ASG) { - return arg2.isDefinitelyNotNull(); - } else { - // All other ASG's are math ops. - return true; - } - } - - if (op == JsBinaryOperator.COMMA) { - return arg2.isDefinitelyNotNull(); - } - - return false; - } - - @Override - public boolean isDefinitelyNull() { - if (op == JsBinaryOperator.AND) { - return arg1.isDefinitelyNull(); - } - return false; - } - - public void setArg1(JsExpression arg1) { - this.arg1 = arg1; - } - - public void setArg2(JsExpression arg2) { - this.arg2 = arg2; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - if (op.isAssignment()) { - arg1 = v.acceptLvalue(arg1); - } else { - arg1 = v.accept(arg1); - } - arg2 = v.accept(arg2); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.BINARY_OP; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.java deleted file mode 100644 index b54647f3a46..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.java +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents the operator in a JavaScript binary operation. - */ -public enum JsBinaryOperator implements JsOperator { - - /* - * Precedence indices from "JavaScript - The Definitive Guide" 4th Edition - * (page 57) - * - * - * Precedence 15 is for really important things that have their own AST - * classes. - * - * Precedence 14 is for unary operators. - */ - - MUL("*", 13, LEFT | INFIX), DIV("/", 13, LEFT | INFIX), MOD("%", 13, LEFT - | INFIX), - - ADD("+", 12, LEFT | INFIX), SUB("-", 12, LEFT | INFIX), - - SHL("<<", 11, LEFT | INFIX), SHR(">>", 11, LEFT | INFIX), SHRU(">>>", 11, - LEFT | INFIX), - - LT("<", 10, LEFT | INFIX), LTE("<=", 10, LEFT | INFIX), GT(">", 10, LEFT - | INFIX), GTE(">=", 10, LEFT | INFIX), INSTANCEOF("instanceof", 10, LEFT - | INFIX), INOP("in", 10, LEFT | INFIX), - - EQ("==", 9, LEFT | INFIX), NEQ("!=", 9, LEFT | INFIX), REF_EQ("===", 9, LEFT - | INFIX), REF_NEQ("!==", 9, LEFT | INFIX), - - BIT_AND("&", 8, LEFT | INFIX), - - BIT_XOR("^", 7, LEFT | INFIX), - - BIT_OR("|", 6, LEFT | INFIX), - - AND("&&", 5, LEFT | INFIX), - - OR("||", 4, LEFT | INFIX), - - // Precedence 3 is for the condition operator. - - // These assignment operators are right-associative. - ASG("=", 2, INFIX), ASG_ADD("+=", 2, INFIX), ASG_SUB("-=", 2, INFIX), ASG_MUL( - "*=", 2, INFIX), ASG_DIV("/=", 2, INFIX), ASG_MOD("%=", 2, INFIX), ASG_SHL( - "<<=", 2, INFIX), ASG_SHR(">>=", 2, INFIX), ASG_SHRU(">>>=", 2, INFIX), ASG_BIT_AND( - "&=", 2, INFIX), ASG_BIT_OR("|=", 2, INFIX), ASG_BIT_XOR("^=", 2, INFIX), - - COMMA(",", 1, LEFT | INFIX); - - private final int mask; - private final int precedence; - private final String symbol; - - private JsBinaryOperator(String symbol, int precedence, int mask) { - this.symbol = symbol; - this.precedence = precedence; - this.mask = mask; - } - - @Override - public int getPrecedence() { - return precedence; - } - - @Override - public String getSymbol() { - return symbol; - } - - public boolean isAssignment() { - /* - * Beware, flaky! Maybe I should have added Yet Another Field to - * BinaryOperator? - */ - return (getPrecedence() == ASG.getPrecedence()); - } - - @Override - public boolean isKeyword() { - return this == INSTANCEOF || this == INOP; - } - - @Override - public boolean isLeftAssociative() { - return (mask & LEFT) != 0; - } - - @Override - public boolean isPrecedenceLessThan(JsOperator other) { - return precedence < other.getPrecedence(); - } - - @Override - public boolean isValidInfix() { - return (mask & INFIX) != 0; - } - - @Override - public boolean isValidPostfix() { - return (mask & POSTFIX) != 0; - } - - @Override - public boolean isValidPrefix() { - return (mask & PREFIX) != 0; - } - - @Override - public String toString() { - return symbol; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBlock.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBlock.java deleted file mode 100644 index fca607c4eb4..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBlock.java +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.LinkedList; -import java.util.List; - -/** - * Represents a JavaScript block statement. - */ -public class JsBlock extends JsStatement { - - private final LinkedList stmts = new LinkedList(); - - public JsBlock() { - } - - public JsBlock(JsStatement stmt) { - stmts.add(stmt); - } - - public List getStatements() { - return stmts; - } - - public void addStatement(JsStatement statement) { - assert statement != null; - stmts.add(statement); - } - - public boolean isGlobalBlock() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - v.acceptWithInsertRemove(stmts); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.BLOCK; - } - - /*Pavel Talanov*/ - public void addVarDeclaration(JsVars vars) { - stmts.offerFirst(vars); - } - - public void setStatements(List statements) { - assert this.stmts.isEmpty() : "Already contains statements."; - this.stmts.addAll(statements); - } - -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.java deleted file mode 100644 index 12238ddbb02..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript literal boolean expression. - */ -public final class JsBooleanLiteral extends JsValueLiteral { - - private final boolean value; - - // Should be interned by JsProgram - JsBooleanLiteral(boolean value) { - this.value = value; - } - - public boolean getValue() { - return value; - } - - @Override - public boolean isBooleanFalse() { - return value == false; - } - - @Override - public boolean isBooleanTrue() { - return value == true; - } - - @Override - public boolean isDefinitelyNotNull() { - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.BOOLEAN; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBreak.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBreak.java deleted file mode 100644 index 363f294df78..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsBreak.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents the JavaScript break statement. - */ -public final class JsBreak extends JsStatement { - - private final JsNameRef label; - - public JsBreak() { - this(null); - } - - public JsBreak(JsNameRef label) { - super(); - this.label = label; - } - - public JsNameRef getLabel() { - return label; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - if (label != null) { - v.accept(label); - } - } - v.endVisit(this, ctx); - } - - @Override - public boolean unconditionalControlBreak() { - return true; - } - - @Override - public NodeKind getKind() { - return NodeKind.BREAK; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCase.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCase.java deleted file mode 100644 index 43d2fc41230..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCase.java +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents the JavaScript case statement. - */ -public final class JsCase extends JsSwitchMember { - - private JsExpression caseExpr; - - public JsCase() { - super(); - } - - public JsExpression getCaseExpr() { - return caseExpr; - } - - public void setCaseExpr(JsExpression caseExpr) { - this.caseExpr = caseExpr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - caseExpr = v.accept(caseExpr); - v.acceptWithInsertRemove(stmts); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.CASE; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java deleted file mode 100644 index f992545b944..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript catch clause. - */ -public class JsCatch extends JsNode implements HasCondition { - - protected final JsCatchScope scope; - private JsBlock body; - private JsExpression condition; - private JsParameter param; - - public JsCatch(JsScope parent, String ident) { - super(); - assert (parent != null); - scope = new JsCatchScope(parent, ident); - param = new JsParameter(scope.findExistingName(ident)); - } - - public JsBlock getBody() { - return body; - } - - @Override - public JsExpression getCondition() { - return condition; - } - - public JsParameter getParameter() { - return param; - } - - public JsScope getScope() { - return scope; - } - - public void setBody(JsBlock body) { - this.body = body; - } - - @Override - public void setCondition(JsExpression condition) { - this.condition = condition; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - param = v.accept(param); - if (condition != null) { - condition = v.accept(condition); - } - body = v.accept(body); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.CATCH; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java deleted file mode 100644 index 5e5a2f2f577..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.Iterator; -import java.util.NoSuchElementException; - -/** - * A special scope used only for catch blocks. It only holds a single symbol: - * the catch argument's name. - */ -public class JsCatchScope extends JsScope { - - private final JsName name; - - public JsCatchScope(JsScope parent, String ident) { - super(parent, "Catch scope"); - this.name = new JsName(this, ident, ident, ident); - } - - @Override - public JsName declareName(String ident) { - // Declare into parent scope! - return getParent().declareName(ident); - } - - @Override - public JsName declareName(String ident, String shortIdent) { - // Declare into parent scope! - return getParent().declareName(ident, shortIdent); - } - - @Override - public Iterator getAllNames() { - return new Iterator() { - private boolean didIterate = false; - - @Override - public boolean hasNext() { - return !didIterate; - } - - @Override - public JsName next() { - if (didIterate) { - throw new NoSuchElementException(); - } - didIterate = true; - return name; - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - - }; - } - - @Override - protected JsName doCreateName(String ident, String shortIdent, String originalName) { - throw new UnsupportedOperationException("Cannot create a name in a catch scope"); - } - - @Override - public JsName findExistingNameNoRecurse(String ident) { - if (name.getIdent().equals(ident)) { - return name; - } else { - return null; - } - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsConditional.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsConditional.java deleted file mode 100644 index b1171bac2c0..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsConditional.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript conditional expression. - */ -public final class JsConditional extends JsExpression { - - private JsExpression elseExpr; - private JsExpression testExpr; - private JsExpression thenExpr; - - public JsConditional() { - } - - public JsConditional(JsExpression testExpr, JsExpression thenExpr, JsExpression elseExpr) { - this.testExpr = testExpr; - this.thenExpr = thenExpr; - this.elseExpr = elseExpr; - } - - public JsExpression getElseExpression() { - return elseExpr; - } - - public JsExpression getTestExpression() { - return testExpr; - } - - public JsExpression getThenExpression() { - return thenExpr; - } - - @Override - public boolean hasSideEffects() { - return testExpr.hasSideEffects() || thenExpr.hasSideEffects() || elseExpr.hasSideEffects(); - } - - @Override - public boolean isDefinitelyNotNull() { - return thenExpr.isDefinitelyNotNull() && elseExpr.isDefinitelyNotNull(); - } - - @Override - public boolean isDefinitelyNull() { - return thenExpr.isDefinitelyNull() && elseExpr.isDefinitelyNull(); - } - - public void setElseExpression(JsExpression elseExpr) { - this.elseExpr = elseExpr; - } - - public void setTestExpression(JsExpression testExpr) { - this.testExpr = testExpr; - } - - public void setThenExpression(JsExpression thenExpr) { - this.thenExpr = thenExpr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - testExpr = v.accept(testExpr); - thenExpr = v.accept(thenExpr); - elseExpr = v.accept(elseExpr); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.CONDITIONAL; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsContext.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsContext.java deleted file mode 100644 index ddb170052d3..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsContext.java +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * The context in which a JsNode visitation occurs. This represents the set of - * possible operations a JsVisitor subclass can perform on the currently visited - * node. - */ -public interface JsContext { - - boolean canInsert(); - - boolean canRemove(); - - void insertAfter(JsVisitable node); - - void insertBefore(JsVisitable node); - - boolean isLvalue(); - - void removeMe(); - - void replaceMe(JsVisitable node); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsContinue.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsContinue.java deleted file mode 100644 index d761815fe76..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsContinue.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents the JavaScript continue statement. - */ -public final class JsContinue extends JsStatement { - - private final JsNameRef label; - - public JsContinue() { - this(null); - } - - public JsContinue(JsNameRef label) { - super(); - this.label = label; - } - - public JsNameRef getLabel() { - return label; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - if (label != null) { - v.accept(label); - } - } - v.endVisit(this, ctx); - } - - @Override - public boolean unconditionalControlBreak() { - return true; - } - - @Override - public NodeKind getKind() { - return NodeKind.CONTINUE; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDebugger.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDebugger.java deleted file mode 100644 index 34cfae43f48..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDebugger.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript debugger statement. - */ -public class JsDebugger extends JsStatement { - - public JsDebugger() { - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.DEBUGGER; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDefault.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDefault.java deleted file mode 100644 index a76987a8e5d..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDefault.java +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents the default option in a JavaScript swtich statement. - */ -public final class JsDefault extends JsSwitchMember { - - public JsDefault() { - super(); - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - v.acceptWithInsertRemove(stmts); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.DEFAULT; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDoWhile.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDoWhile.java deleted file mode 100644 index 1dd4a47e8d4..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsDoWhile.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript do..while statement. - */ -public class JsDoWhile extends JsStatement { - - private JsStatement body; - private JsExpression condition; - - public JsDoWhile() { - super(); - } - - public JsDoWhile(JsExpression condition, JsStatement body) { - super(); - this.condition = condition; - this.body = body; - } - - public JsStatement getBody() { - return body; - } - - public JsExpression getCondition() { - return condition; - } - - public void setBody(JsStatement body) { - this.body = body; - } - - public void setCondition(JsExpression condition) { - this.condition = condition; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - body = v.accept(body); - condition = v.accept(condition); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.DO; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsEmpty.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsEmpty.java deleted file mode 100644 index c2ac99e3ac0..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsEmpty.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents an empty statement in JavaScript. - */ -public class JsEmpty extends JsStatement { - - // Interned by JsProgram - JsEmpty() { - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.EMPTY; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsExprStmt.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsExprStmt.java deleted file mode 100644 index 5b9fc1218c3..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsExprStmt.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript expression statement. - */ -public final class JsExprStmt extends JsStatement { - - private JsExpression expr; - - public JsExprStmt(JsExpression expr) { - super(); - this.expr = expr; - this.setSourceInfo(expr); - } - - public JsExpression getExpression() { - return expr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - expr = v.accept(expr); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.EXPR_STMT; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsExpression.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsExpression.java deleted file mode 100644 index 43545ec98dc..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsExpression.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import com.google.dart.compiler.common.SourceInfo; - -/** - * An abstract base class for all JavaScript expressions. - */ -public abstract class JsExpression extends JsNode { - - protected JsExpression() { - } - - /** - * Determines whether the expression can cause side effects. - */ - public abstract boolean hasSideEffects(); - - /** - * True if the target expression is definitely not null. - */ - public abstract boolean isDefinitelyNotNull(); - - /** - * True if the target expression is definitely null. - */ - public abstract boolean isDefinitelyNull(); - - /** - * Determines whether or not this expression is a leaf, such as a - * {@link JsNameRef}, {@link JsBooleanLiteral}, and so on. Leaf expressions - * never need to be parenthesized. - */ - public boolean isLeaf() { - // Conservatively say that it isn't a leaf. - // Individual subclasses can speak for themselves if they are a leaf. - return false; - } - - public JsExprStmt makeStmt() { - return new JsExprStmt(this); - } - - @Override - public JsExpression setSourceRef(SourceInfo info) { - super.setSourceRef(info); - return this; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsFor.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsFor.java deleted file mode 100644 index b980d4be1a2..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsFor.java +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import com.google.dart.compiler.common.SourceInfo; - -/** - * A for statement. If specified at all, the initializer part is - * either a declaration of one or more variables, in which case - * {@link #getInitVars()} is used, or an expression, in which case - * {@link #getInitExpr()} is used. In the latter case, the comma operator is - * often used to create a compound expression. - * - *

- * Note that any of the parts of the for loop header can be - * null, although the body will never be null. - */ -public class JsFor extends JsStatement { - - private JsStatement body; - private JsExpression condition; - private JsExpression incrExpr; - private JsExpression initExpr; - private JsVars initVars; - - public JsFor() { - super(); - } - - public JsStatement getBody() { - return body; - } - - public JsExpression getCondition() { - return condition; - } - - public JsExpression getIncrExpr() { - return incrExpr; - } - - public JsExpression getInitExpr() { - return initExpr; - } - - public JsVars getInitVars() { - return initVars; - } - - public void setBody(JsStatement body) { - this.body = body; - } - - public void setCondition(JsExpression condition) { - this.condition = condition; - } - - public void setIncrExpr(JsExpression incrExpr) { - this.incrExpr = incrExpr; - } - - public void setInitExpr(JsExpression initExpr) { - this.initExpr = initExpr; - } - - public void setInitVars(JsVars initVars) { - this.initVars = initVars; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - assert (!(initExpr != null && initVars != null)); - - if (initExpr != null) { - initExpr = v.accept(initExpr); - } else if (initVars != null) { - initVars = v.accept(initVars); - } - - if (condition != null) { - condition = v.accept(condition); - } - - if (incrExpr != null) { - incrExpr = v.accept(incrExpr); - } - body = v.accept(body); - } - v.endVisit(this, ctx); - } - - @Override - public JsFor setSourceRef(SourceInfo info) { - super.setSourceRef(info); - return this; - } - - @Override - public NodeKind getKind() { - return NodeKind.FOR; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsForIn.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsForIn.java deleted file mode 100644 index 646e349885c..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsForIn.java +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript for..in statement. - */ -public class JsForIn extends JsStatement { - - private JsStatement body; - private JsExpression iterExpr; - private JsExpression objExpr; - - // Optional: the name of a new iterator variable to introduce - private final JsName iterVarName; - - public JsForIn() { - this(null); - } - - public JsForIn(JsName iterVarName) { - this.iterVarName = iterVarName; - } - - public JsStatement getBody() { - return body; - } - - public JsExpression getIterExpr() { - return iterExpr; - } - - public JsName getIterVarName() { - return iterVarName; - } - - public JsExpression getObjExpr() { - return objExpr; - } - - public void setBody(JsStatement body) { - this.body = body; - } - - public void setIterExpr(JsExpression iterExpr) { - this.iterExpr = iterExpr; - } - - public void setObjExpr(JsExpression objExpr) { - this.objExpr = objExpr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - if (iterExpr != null) { - iterExpr = v.acceptLvalue(iterExpr); - } - objExpr = v.accept(objExpr); - body = v.accept(body); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.FOR_IN; - } -} \ No newline at end of file diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsFunction.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsFunction.java deleted file mode 100644 index f2c7d258791..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsFunction.java +++ /dev/null @@ -1,238 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import com.google.dart.compiler.common.SourceInfo; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represents a JavaScript function expression. - */ -public final class JsFunction extends JsLiteral implements HasName { - - private static void trace(String title, String code) { - System.out.println("---------------------------"); - System.out.println(title + ":"); - System.out.println("---------------------------"); - System.out.println(code); - } - - protected JsBlock body; - protected final List params = new ArrayList(); - protected final JsScope scope; - private boolean artificiallyRescued; - private boolean executeOnce; - private boolean fromDart; - private JsFunction impliedExecute; - private JsName name; - private boolean trace = false; - private boolean traceFirst = true; - private boolean hoisted = false; - private boolean constructor = false; - - /** - * Creates an anonymous function. - */ - public JsFunction(JsScope parent) { - this(parent, null, false); - } - - /** - * Creates a function that is not derived from Dart source. - */ - public JsFunction(JsScope parent, JsName name) { - this(parent, name, false); - } - - /** - * Creates a named function, possibly derived from Dart source. - */ - public JsFunction(JsScope parent, JsName name, boolean fromDart) { - assert (parent != null); - this.fromDart = fromDart; - setName(name); - String scopeName = (name == null) ? "" : name.getIdent(); - scopeName = "function " + scopeName; - this.scope = new JsScope(parent, scopeName); - } - - public JsBlock getBody() { - return body; - } - - /** - * If true, this indicates that only the first invocation of the function will - * have any effects. Subsequent invocations may be considered to be no-op - * calls whose return value is ignored. - */ - public boolean getExecuteOnce() { - return executeOnce; - } - - public JsFunction getImpliedExecute() { - return impliedExecute; - } - - @Override - public JsName getName() { - return name; - } - - public void setParameters(List params) { - this.params.clear(); - this.params.addAll(params); - } - - public List getParameters() { - return params; - } - - public JsScope getScope() { - return scope; - } - - @Override - public boolean hasSideEffects() { - // If there's a name, the name is assigned to. - return name != null; - } - - public boolean isArtificiallyRescued() { - return artificiallyRescued; - } - - @Override - public boolean isBooleanFalse() { - return false; - } - - @Override - public boolean isBooleanTrue() { - return true; - } - - @Override - public boolean isDefinitelyNotNull() { - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - public boolean isFromDart() { - return fromDart; - } - - public void setArtificiallyRescued(boolean rescued) { - this.artificiallyRescued = rescued; - } - - public void setBody(JsBlock body) { - this.body = body; - } - - public void setExecuteOnce(boolean executeOnce) { - this.executeOnce = executeOnce; - } - - public void setFromDart(boolean fromDart) { - this.fromDart = fromDart; - } - - public void setImpliedExecute(JsFunction impliedExecute) { - this.impliedExecute = impliedExecute; - } - - public void setName(JsName name) { - this.name = name; - if (name != null) { - if (isFromDart()) { - name.setStaticRef(this); - } - } - } - - public void setTrace() { - this.trace = true; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - String before = null; - if (trace && v instanceof JsModVisitor) { - before = this.toSource(); - if (traceFirst) { - traceFirst = false; - trace("SCRIPT INITIAL", before); - } - } - if (v.visit(this, ctx)) { - v.acceptWithInsertRemove(params); - body = v.accept(body); - } - v.endVisit(this, ctx); - if (trace && v instanceof JsModVisitor) { - String after = this.toSource(); - if (!after.equals(before)) { - String title = v.getClass().getSimpleName(); - trace(title, after); - } - } - } - - public void setHoisted() { - hoisted = true; - } - - /** - * Whether the function has been hoisted - */ - public boolean isHoisted() { - return hoisted; - } - - /** - * Rebase the function to a new scope. - * - * @param newScopeParent The scope to add the function to. - */ - public void rebaseScope(JsScope newScopeParent) { - this.scope.rebase(newScopeParent); - } - - @Override - public JsFunction setSourceRef(SourceInfo info) { - super.setSourceRef(info); - return this; - } - - public boolean isConstructor() { - return this.constructor; - } - - public boolean setIsConstructor(boolean constructor) { - return this.constructor = constructor; - } - - @Override - public NodeKind getKind() { - return NodeKind.FUNCTION; - } - - // Pavel Talanov - // dummy parameter to distinguish from other constructors - private JsFunction(Void dummy, JsScope functionScope) { - this.fromDart = false; - this.scope = functionScope; - } - - public static JsFunction getAnonymousFunctionWithScope(JsScope scope) { - return new JsFunction(null, scope); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.java deleted file mode 100644 index 9a14004e14c..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represnts a JavaScript block in the global scope. - */ -public class JsGlobalBlock extends JsBlock { - - public JsGlobalBlock() { - } - - @Override - public boolean isGlobalBlock() { - return true; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsIf.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsIf.java deleted file mode 100644 index 478538235ab..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsIf.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript if statement. - */ -public final class JsIf extends JsStatement { - - private JsExpression ifExpr; - private JsStatement thenStmt; - private JsStatement elseStmt; - - public JsIf() { - } - - public JsIf(JsExpression ifExpr, JsStatement thenStmt, JsStatement elseStmt) { - this.ifExpr = ifExpr; - this.thenStmt = thenStmt; - this.elseStmt = elseStmt; - } - - public JsStatement getElseStmt() { - return elseStmt; - } - - public JsExpression getIfExpr() { - return ifExpr; - } - - public JsStatement getThenStmt() { - return thenStmt; - } - - public void setElseStmt(JsStatement elseStmt) { - this.elseStmt = elseStmt; - } - - public void setIfExpr(JsExpression ifExpr) { - this.ifExpr = ifExpr; - } - - public void setThenStmt(JsStatement thenStmt) { - this.thenStmt = thenStmt; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - ifExpr = v.accept(ifExpr); - thenStmt = v.accept(thenStmt); - if (elseStmt != null) { - elseStmt = v.accept(elseStmt); - } - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.IF; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsInvocation.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsInvocation.java deleted file mode 100644 index 777c33730d0..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsInvocation.java +++ /dev/null @@ -1,73 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * Represents a JavaScript invocation. - */ -public final class JsInvocation extends JsExpression implements HasArguments { - - private final List args = new ArrayList(); - private JsExpression qualifier; - - public JsInvocation() { - } - - @Override - public List getArguments() { - return args; - } - - public JsExpression getQualifier() { - return qualifier; - } - - @Override - public boolean hasSideEffects() { - return true; - } - - @Override - public boolean isDefinitelyNotNull() { - return false; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - public void setQualifier(JsExpression qualifier) { - this.qualifier = qualifier; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - qualifier = v.accept(qualifier); - v.acceptList(args); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.INVOKE; - } - - // Pavel Talanov - public void setArguments(List arguments) { - assert this.args.isEmpty() : "Arguments already set."; - this.args.addAll(arguments); - } - - public void setArguments(JsExpression... arguments) { - setArguments(Arrays.asList(arguments)); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsLabel.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsLabel.java deleted file mode 100644 index 7d026c3a6de..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsLabel.java +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript label statement. - */ -public class JsLabel extends JsStatement implements HasName { - - private final JsName label; - - private JsStatement stmt; - - public JsLabel(JsName label) { - this.label = label; - } - - @Override - public JsName getName() { - return label; - } - - public JsStatement getStmt() { - return stmt; - } - - public void setStmt(JsStatement stmt) { - this.stmt = stmt; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - stmt = v.accept(stmt); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.LABEL; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsLiteral.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsLiteral.java deleted file mode 100644 index c87ae0c8af1..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsLiteral.java +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript string literal expression. - */ -public abstract class JsLiteral extends JsExpression implements CanBooleanEval { - - protected JsLiteral() { - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsModVisitor.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsModVisitor.java deleted file mode 100644 index ef6e75ce994..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsModVisitor.java +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import com.google.dart.compiler.util.Hack; - -import java.util.List; - -/** - * A visitor for iterating through and modifying an AST. - */ -public class JsModVisitor extends JsVisitor { - - private class ListContext implements JsContext { - - private List collection; - private int index; - private boolean removed; - private boolean replaced; - - @Override - public boolean canInsert() { - return true; - } - - @Override - public boolean canRemove() { - return true; - } - - @Override - public void insertAfter(JsVisitable node) { - checkRemoved(); - collection.add(index + 1, Hack.cast(node)); - didChange = true; - } - - @Override - public void insertBefore(JsVisitable node) { - checkRemoved(); - collection.add(index++, Hack.cast(node)); - didChange = true; - } - - @Override - public boolean isLvalue() { - return false; - } - - @Override - public void removeMe() { - checkState(); - collection.remove(index--); - didChange = removed = true; - } - - @Override - public void replaceMe(JsVisitable node) { - checkState(); - checkReplacement(collection.get(index), node); - collection.set(index, Hack.cast(node)); - didChange = replaced = true; - } - - protected void traverse(List collection) { - this.collection = collection; - for (index = 0; index < collection.size(); ++index) { - removed = replaced = false; - doTraverse(collection.get(index), this); - } - } - - private void checkRemoved() { - if (removed) { - throw new RuntimeException("Node was already removed"); - } - } - - private void checkState() { - checkRemoved(); - if (replaced) { - throw new RuntimeException("Node was already replaced"); - } - } - } - - private class LvalueContext extends NodeContext { - @Override - public boolean isLvalue() { - return true; - } - } - - private class NodeContext implements JsContext { - private T node; - private boolean replaced; - - @Override - public boolean canInsert() { - return false; - } - - @Override - public boolean canRemove() { - return false; - } - - @Override - public void insertAfter(JsVisitable node) { - throw new UnsupportedOperationException(); - } - - @Override - public void insertBefore(JsVisitable node) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isLvalue() { - return false; - } - - @Override - public void removeMe() { - throw new UnsupportedOperationException(); - } - - @Override - public void replaceMe(JsVisitable node) { - if (replaced) { - throw new RuntimeException("Node was already replaced"); - } - checkReplacement(this.node, node); - this.node = Hack.cast(node); - didChange = replaced = true; - } - - protected T traverse(T node) { - this.node = node; - replaced = false; - doTraverse(node, this); - return this.node; - } - } - - protected static void checkReplacement(T origNode, T newNode) { - if (newNode == null) { - throw new RuntimeException("Cannot replace with null"); - } - if (newNode == origNode) { - throw new RuntimeException("The replacement is the same as the original"); - } - } - - protected boolean didChange = false; - - @Override - public boolean didChange() { - return didChange; - } - - @Override - protected T doAccept(T node) { - return new NodeContext().traverse(node); - } - - @Override - protected void doAcceptList(List collection) { - NodeContext ctx = new NodeContext(); - for (int i = 0, c = collection.size(); i < c; ++i) { - ctx.traverse(collection.get(i)); - if (ctx.replaced) { - collection.set(i, ctx.node); - } - } - } - - @Override - protected JsExpression doAcceptLvalue(JsExpression expr) { - return new LvalueContext().traverse(expr); - } - - @Override - protected void doAcceptWithInsertRemove(List collection) { - new ListContext().traverse(collection); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsName.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsName.java deleted file mode 100644 index ccc1322338a..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsName.java +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.io.Serializable; - -/** - * An abstract base class for named JavaScript objects. - */ -public class JsName implements Serializable { - private final JsScope enclosing; - private final String ident; - private boolean isObfuscatable; - private String shortIdent; - private String originalName; - - /** - * A back-reference to the JsNode that the JsName refers to. - */ - private JsNode staticRef; - - /** - * @param ident the unmangled ident to use for this name - */ -JsName(JsScope enclosing, String ident, String shortIdent, String originalName) { - this.enclosing = enclosing; - this.ident = ident; - this.shortIdent = shortIdent; - if (originalName != null) { - this.originalName = originalName; - } - this.isObfuscatable = true; - } - - public JsScope getEnclosing() { - return enclosing; - } - - public String getIdent() { - return ident; - } - - public String getShortIdent() { - return shortIdent; - } - - public String getOriginalName() { - return originalName; - } - - public JsNode getStaticRef() { - return staticRef; - } - - public boolean isObfuscatable() { - return isObfuscatable; - } - - public JsNameRef makeRef() { - return new JsNameRef(this); - } - - public void setObfuscatable(boolean isObfuscatable) { - this.isObfuscatable = isObfuscatable; - } - - public void setShortIdent(String shortIdent) { - this.shortIdent = shortIdent; - } - - /** - * Should never be called except on immutable stuff. - */ - public void setStaticRef(JsNode node) { - this.staticRef = node; - } - - @Override - public String toString() { - return ident; - } - - @Override - public int hashCode() { - return ident.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof JsName)) { - return false; - } - JsName other = (JsName) obj; - return ident.equals(other.ident) && enclosing == other.enclosing; - } - -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNameRef.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNameRef.java deleted file mode 100644 index dc26c8fa61a..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNameRef.java +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript expression that references a name. - */ -public final class JsNameRef extends JsExpression implements CanBooleanEval, HasName { - - private String ident; - private JsName name; - private JsExpression qualifier; - - public JsNameRef(JsName name) { - this.name = name; - } - - public JsNameRef(String ident) { - this.ident = ident; - } - - public String getIdent() { - return (name == null) ? ident : name.getIdent(); - } - - @Override - public JsName getName() { - return name; - } - - public JsExpression getQualifier() { - return qualifier; - } - - public String getShortIdent() { - return (name == null) ? ident : name.getShortIdent(); - } - - @Override - public boolean hasSideEffects() { - if (qualifier == null) { - return false; - } - if (!qualifier.isDefinitelyNotNull()) { - // Could trigger NPE. - return true; - } - return qualifier.hasSideEffects(); - } - - @Override - public boolean isBooleanFalse() { - return isDefinitelyNull(); - } - - @Override - public boolean isBooleanTrue() { - return false; - } - - @Override - public boolean isDefinitelyNotNull() { - // TODO: look for single-assignment of stuff from Java? - return false; - } - - @Override - public boolean isDefinitelyNull() { - if (name != null) { - return (name.getEnclosing().getProgram().getUndefinedLiteral().getName() == name); - } - return false; - } - - @Override - public boolean isLeaf() { - if (qualifier == null) { - return true; - } else { - return false; - } - } - - public boolean isResolved() { - return name != null; - } - - public void resolve(JsName name) { - this.name = name; - this.ident = null; - } - - public void setQualifier(JsExpression qualifier) { - this.qualifier = qualifier; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - if (qualifier != null) { - qualifier = v.accept(qualifier); - } - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.NAME_REF; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNew.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNew.java deleted file mode 100644 index 68fc366684d..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNew.java +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.ArrayList; -import java.util.List; - -/** - * Represents the JavaScript new expression. - */ -public final class JsNew extends JsExpression implements HasArguments { - - private final List args = new ArrayList(); - private JsExpression ctorExpr; - - public JsNew(JsExpression ctorExpr) { - this.ctorExpr = ctorExpr; - } - - @Override - public List getArguments() { - return args; - } - - public void setArguments(List arguments) { - args.clear(); - args.addAll(arguments); - } - - public JsExpression getConstructorExpression() { - return ctorExpr; - } - - @Override - public boolean hasSideEffects() { - return true; - } - - @Override - public boolean isDefinitelyNotNull() { - // Sadly, in JS it can be! - // TODO: analysis could probably determine most instances cannot be null. - return false; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - ctorExpr = v.accept(ctorExpr); - v.acceptList(args); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.NEW; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNode.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNode.java deleted file mode 100644 index 0d4b7aaa714..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNode.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. -package com.google.dart.compiler.backend.js.ast; - -import com.google.dart.compiler.backend.js.JsSourceGenerationVisitor; -import com.google.dart.compiler.backend.js.JsToStringGenerationVisitor; -import com.google.dart.compiler.common.AbstractNode; -import com.google.dart.compiler.common.SourceInfo; -import com.google.dart.compiler.util.DefaultTextOutput; - -/** - * Base class for all JS AST elements. - */ -public abstract class JsNode extends AbstractNode implements JsVisitable { - - protected JsNode() { - } - - // Causes source generation to delegate to the one visitor - public final String toSource() { - DefaultTextOutput out = new DefaultTextOutput(false); - JsSourceGenerationVisitor v = new JsSourceGenerationVisitor(out); - v.accept(this); - return out.toString(); - } - - // Causes source generation to delegate to the one visitor - @Override - public final String toString() { - DefaultTextOutput out = new DefaultTextOutput(false); - JsToStringGenerationVisitor v = new JsToStringGenerationVisitor(out); - v.accept(this); - return out.toString(); - } - - @Override - public SourceInfo getSourceInfo() { - return this; - } - - public JsNode setSourceRef(SourceInfo info) { - if (info != null) { - this.setSourceInfo(info); - } - return this; - } - - public abstract NodeKind getKind(); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNullLiteral.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNullLiteral.java deleted file mode 100644 index 506b2e3f330..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNullLiteral.java +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript null literal. - */ -public final class JsNullLiteral extends JsValueLiteral { - - // Should only be instantiated in JsProgram - JsNullLiteral() { - } - - @Override - public boolean isBooleanFalse() { - return true; - } - - @Override - public boolean isBooleanTrue() { - return false; - } - - @Override - public boolean isDefinitelyNotNull() { - return false; - } - - @Override - public boolean isDefinitelyNull() { - return true; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.NULL; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.java deleted file mode 100644 index 726c6b0ed27..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Represents a JavaScript literal decimal expression. - */ -public final class JsNumberLiteral extends JsValueLiteral { - - private final double value; - - // Should be interned by JsProgram - JsNumberLiteral(double value) { - this.value = value; - } - - public double getValue() { - return value; - } - - @Override - public boolean isBooleanFalse() { - return value == 0.0; - } - - @Override - public boolean isBooleanTrue() { - return value != 0.0; - } - - @Override - public boolean isDefinitelyNotNull() { - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.NUMBER; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.java deleted file mode 100644 index 749ed473c21..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.java +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.ArrayList; -import java.util.List; - -/** - * A JavaScript object literal. - */ -public final class JsObjectLiteral extends JsLiteral { - - private final List props; - - public JsObjectLiteral() { - props = new ArrayList(); - } - - public JsObjectLiteral(List props) { - assert props != null; - this.props = props; - } - - public List getPropertyInitializers() { - return props; - } - - @Override - public boolean hasSideEffects() { - for (JsPropertyInitializer prop : props) { - if (prop.hasSideEffects()) { - return true; - } - } - return false; - } - - @Override - public boolean isBooleanFalse() { - return false; - } - - @Override - public boolean isBooleanTrue() { - return true; - } - - @Override - public boolean isDefinitelyNotNull() { - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - v.acceptWithInsertRemove(props); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.OBJECT; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsOperator.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsOperator.java deleted file mode 100644 index e4440cbe9ab..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsOperator.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript operator. - */ -public interface JsOperator { - - int INFIX = 0x02; - int LEFT = 0x01; - int POSTFIX = 0x04; - int PREFIX = 0x08; - - int getPrecedence(); - - String getSymbol(); - - boolean isKeyword(); - - boolean isLeftAssociative(); - - boolean isPrecedenceLessThan(JsOperator other); - - boolean isValidInfix(); - - boolean isValidPostfix(); - - boolean isValidPrefix(); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsParameter.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsParameter.java deleted file mode 100644 index 17581ce4084..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsParameter.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript parameter. - */ -public final class JsParameter extends JsNode implements HasName { - - private final JsName name; - - public JsParameter(JsName name) { - this.name = name; - name.setStaticRef(this); - } - - @Override - public JsName getName() { - return name; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.PARAMETER; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.java deleted file mode 100644 index a33536f6c0d..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.java +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript postfix operation. - */ -public final class JsPostfixOperation extends JsUnaryOperation { - - public JsPostfixOperation(JsUnaryOperator op) { - this(op, null); - } - - public JsPostfixOperation(JsUnaryOperator op, JsExpression arg) { - super(op, arg); - } - - @Override - public boolean isDefinitelyNotNull() { - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - super.traverse(v, ctx); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.POSTFIX_OP; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.java deleted file mode 100644 index 8ce12c7bacd..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript prefix operation. - */ -public final class JsPrefixOperation extends JsUnaryOperation implements CanBooleanEval { - - public JsPrefixOperation(JsUnaryOperator op) { - this(op, null); - } - - public JsPrefixOperation(JsUnaryOperator op, JsExpression arg) { - super(op, arg); - } - - @Override - public boolean isBooleanFalse() { - if (getOperator() == JsUnaryOperator.VOID) { - return true; - } - if (getOperator() == JsUnaryOperator.NOT && getArg() instanceof CanBooleanEval) { - CanBooleanEval eval = (CanBooleanEval) getArg(); - return eval.isBooleanTrue(); - } - return false; - } - - @Override - public boolean isBooleanTrue() { - if (getOperator() == JsUnaryOperator.NOT && getArg() instanceof CanBooleanEval) { - CanBooleanEval eval = (CanBooleanEval) getArg(); - return eval.isBooleanFalse(); - } - if (getOperator() == JsUnaryOperator.TYPEOF) { - return true; - } - return false; - } - - @Override - public boolean isDefinitelyNotNull() { - if (getOperator() == JsUnaryOperator.TYPEOF) { - return true; - } - return getOperator() != JsUnaryOperator.VOID; - } - - @Override - public boolean isDefinitelyNull() { - return getOperator() == JsUnaryOperator.VOID; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - super.traverse(v, ctx); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.PREFIX_OP; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsProgram.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsProgram.java deleted file mode 100644 index c8e4310ba9b..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsProgram.java +++ /dev/null @@ -1,174 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.HashMap; -import java.util.Map; - -/** - * A JavaScript program. - */ -public final class JsProgram extends JsNode { - - private final JsStatement debuggerStmt; - private final JsEmpty emptyStmt; - private final JsBooleanLiteral falseLiteral; - private JsProgramFragment[] fragments; - private final Map indexedFunctions = new HashMap(); - private final JsNullLiteral nullLiteral; - private final Map numberLiteralMap = - new HashMap(); - private final JsScope objectScope; - private final JsRootScope rootScope; - private final Map stringLiteralMap = - new HashMap(); - private final JsScope topScope; - private final JsBooleanLiteral trueLiteral; - - /** - * Constructs a JavaScript program object. - */ - public JsProgram(String unitId) { - rootScope = new JsRootScope(this); - topScope = new JsScope(rootScope, "Global", unitId); - objectScope = new JsScope(rootScope, "Object"); - setFragmentCount(1); - - debuggerStmt = new JsDebugger(); - emptyStmt = new JsEmpty(); - falseLiteral = new JsBooleanLiteral(false); - nullLiteral = new JsNullLiteral(); - trueLiteral = new JsBooleanLiteral(true); - } - - public JsBooleanLiteral getBooleanLiteral(boolean truth) { - if (truth) { - return getTrueLiteral(); - } - return getFalseLiteral(); - } - - /** - * Gets the {@link JsStatement} to use whenever parsed source include a - * debugger statement. - */ - public JsStatement getDebuggerStmt() { - return debuggerStmt; - } - - public JsEmpty getEmptyStmt() { - return emptyStmt; - } - - public JsBooleanLiteral getFalseLiteral() { - return falseLiteral; - } - - public JsBlock getFragmentBlock(int fragment) { - if (fragment < 0 || fragment >= fragments.length) { - throw new IllegalArgumentException("Invalid fragment: " + fragment); - } - return fragments[fragment].getGlobalBlock(); - } - - public int getFragmentCount() { - return this.fragments.length; - } - - /** - * Gets the one and only global block. - */ - public JsBlock getGlobalBlock() { - return getFragmentBlock(0); - } - - public JsFunction getIndexedFunction(String name) { - return indexedFunctions.get(name); - } - - public JsNullLiteral getNullLiteral() { - return nullLiteral; - } - - public JsNumberLiteral getNumberLiteral(double value) { - JsNumberLiteral lit = numberLiteralMap.get(value); - if (lit == null) { - lit = new JsNumberLiteral(value); - numberLiteralMap.put(value, lit); - } - - return lit; - } - - public JsScope getObjectScope() { - return objectScope; - } - - /** - * Gets the quasi-mythical root scope. This is not the same as the top scope; - * all unresolvable identifiers wind up here, because they are considered - * external to the program. - */ - public JsRootScope getRootScope() { - return rootScope; - } - - /** - * Gets the top level scope. This is the scope of all the statements in the - * main program. - */ - public JsScope getScope() { - return topScope; - } - - /** - * Creates or retrieves a JsStringLiteral from an interned object pool. - */ - public JsStringLiteral getStringLiteral(String value) { - JsStringLiteral lit = stringLiteralMap.get(value); - if (lit == null) { - lit = new JsStringLiteral(value); - stringLiteralMap.put(value, lit); - } - return lit; - } - - public JsBooleanLiteral getTrueLiteral() { - return trueLiteral; - } - - public JsNameRef getUndefinedLiteral() { - return new JsNameRef("$Dart$Null"); - } - - public void setFragmentCount(int fragments) { - this.fragments = new JsProgramFragment[fragments]; - for (int i = 0; i < fragments; i++) { - this.fragments[i] = new JsProgramFragment(); - } - } - - public void setIndexedFunctions(Map indexedFunctions) { - this.indexedFunctions.clear(); - this.indexedFunctions.putAll(indexedFunctions); - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - for (JsProgramFragment fragment : fragments) { - v.accept(fragment); - } - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.PROGRAM; - } - - -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java deleted file mode 100644 index 3c6859e2150..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsProgramFragment.java +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * One independently loadable fragment of a {@link JsProgram}. - */ -public class JsProgramFragment extends JsNode { - - private final JsGlobalBlock globalBlock; - - public JsProgramFragment() { - this.globalBlock = new JsGlobalBlock(); - } - - public JsBlock getGlobalBlock() { - return globalBlock; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - v.accept(globalBlock); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.PROGRAM_FRAGMENT; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.java deleted file mode 100644 index d68d8d01af4..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Used in object literals to specify property values by name. - */ -public class JsPropertyInitializer extends JsNode { - - private JsExpression labelExpr; - private JsExpression valueExpr; - - public JsPropertyInitializer() { - } - - public JsPropertyInitializer(JsExpression labelExpr, JsExpression valueExpr) { - this.labelExpr = labelExpr; - this.valueExpr = valueExpr; - } - - public JsExpression getLabelExpr() { - return labelExpr; - } - - public JsExpression getValueExpr() { - return valueExpr; - } - - public boolean hasSideEffects() { - return labelExpr.hasSideEffects() || valueExpr.hasSideEffects(); - } - - public void setLabelExpr(JsExpression labelExpr) { - this.labelExpr = labelExpr; - } - - public void setValueExpr(JsExpression valueExpr) { - this.valueExpr = valueExpr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - labelExpr = v.accept(labelExpr); - valueExpr = v.accept(valueExpr); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.PROPERTY_INIT; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsRegExp.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsRegExp.java deleted file mode 100644 index 158c7a5e092..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsRegExp.java +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript regular expression. - */ -public final class JsRegExp extends JsValueLiteral { - - private String flags; - private String pattern; - - public JsRegExp() { - } - - public String getFlags() { - return flags; - } - - public String getPattern() { - return pattern; - } - - @Override - public boolean isBooleanFalse() { - return false; - } - - @Override - public boolean isBooleanTrue() { - return true; - } - - @Override - public boolean isDefinitelyNotNull() { - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - public void setFlags(String suffix) { - this.flags = suffix; - } - - public void setPattern(String re) { - this.pattern = re; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.REGEXP; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsReturn.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsReturn.java deleted file mode 100644 index 16d90e4b353..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsReturn.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript return statement. - */ -public final class JsReturn extends JsStatement { - - private JsExpression expr; - - public JsReturn() { - } - - public JsReturn(JsExpression expr) { - this.expr = expr; - } - - public JsExpression getExpr() { - return expr; - } - - public void setExpr(JsExpression expr) { - this.expr = expr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - if (expr != null) { - expr = v.accept(expr); - } - } - v.endVisit(this, ctx); - } - - @Override - public boolean unconditionalControlBreak() { - return true; - } - - @Override - public NodeKind getKind() { - return NodeKind.RETURN; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsRootScope.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsRootScope.java deleted file mode 100644 index 33b71f26222..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsRootScope.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import com.google.dart.compiler.backend.js.JsReservedIdentifiers; - -/** - * The root scope is the parent of every scope. All identifiers in this scope - * are not obfuscatable. This scope is prefilled with reserved global - * JavaScript symbols. - */ -public final class JsRootScope extends JsScope { - - private final JsProgram program; - - public JsRootScope(JsProgram program) { - super("Root"); - this.program = program; - } - - @Override - public JsProgram getProgram() { - return program; - } - - @Override - protected JsName doCreateName(String ident, String shortIdent, String originalName) { - JsName name = super.doCreateName(ident, shortIdent, originalName); - name.setObfuscatable(false); - return name; - } - - @Override - public JsName findExistingNameNoRecurse(String ident) { - JsName name = super.findExistingNameNoRecurse(ident); - if (name == null) { - if (JsReservedIdentifiers.getReservedGlobalSymbols().contains(ident)) { - /* - * Lazily add JsNames for reserved identifiers. Since a JsName for a reserved global symbol - * must report a legitimate enclosing scope, we can't simply have a shared set of symbol - * names. - */ - name = doCreateName(ident, ident, ident); - } - } - return name; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsScope.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsScope.java deleted file mode 100644 index 0a4053960b8..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsScope.java +++ /dev/null @@ -1,308 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import com.google.dart.compiler.util.Lists; -import com.google.dart.compiler.util.Maps; - -import java.io.Serializable; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * A scope is a factory for creating and allocating - * {@link JsName}s. A JavaScript AST is - * built in terms of abstract name objects without worrying about obfuscation, - * keyword/identifier blacklisting, and so on. - *

- *

- *

- * Scopes are associated with - * {@link JsFunction}s, but the two are - * not equivalent. Functions have scopes, but a scope does not - * necessarily have an associated Function. Examples of this include the - * {@link JsRootScope} and synthetic - * scopes that might be created by a client. - *

- *

- *

- * Scopes can have parents to provide constraints when allocating actual - * identifiers for names. Specifically, names in child scopes are chosen such - * that they do not conflict with names in their parent scopes. The ultimate - * parent is usually the global scope (see - * {@link JsProgram#getRootScope()}), - * but parentless scopes are useful for managing names that are always accessed - * with a qualifier and could therefore never be confused with the global scope - * hierarchy. - */ -public class JsScope implements Serializable { - - private List children = Collections.emptyList(); - private final String description; - private Map names = Collections.emptyMap(); - private JsScope parent; - protected int tempIndex = 0; - private final String scopeId; - - /* - * Create a scope with parent. - */ - public JsScope(JsScope parent, String description) { - this(parent, description, null); - } - - /** - * Create a scope with parent. - */ - public JsScope(JsScope parent, String description, String scopeId) { - assert (parent != null); - this.scopeId = scopeId; - this.description = description; - this.parent = parent; - parent.children = Lists.add(parent.children, this); - } - - /** - * Rebase the function to a new scope. - * - * @param newParent The scope to add the function to. - */ - public void rebase(JsScope newParent) { - detachFromParent(); - parent = newParent; - parent.children = Lists.add(parent.children, this); - } - - /** - * Rebase the function's children to a new scope. - * - * @param newParent - */ - public void rebaseChildScopes(JsScope newParent) { - if (newParent == this) { - return; - } - parent.children = Lists.addAll(parent.children, children); - for (JsScope child : children) { - child.parent = newParent; - } - children = Collections.emptyList(); - } - - /** - * Subclasses can detach and become parentless. - */ - protected void detachFromParent() { - JsScope oldParent = parent; - - oldParent.children = Lists.remove( - parent.children, oldParent.children.indexOf(this)); - - parent = null; - } - - /** - * Subclasses can be parentless. - */ - protected JsScope(String description) { - this.description = description; - this.parent = null; - this.scopeId = null; - } - - /** - * Gets a name object associated with the specified ident in this scope, - * creating it if necessary.
- * If the JsName does not exist yet, a new JsName is created. The ident, - * short name, and original name of the newly created JsName are equal to - * the given ident. - * - * @param ident An identifier that is unique within this scope. - */ - public JsName declareName(String ident) { - JsName name = findExistingNameNoRecurse(ident); - if (name != null) { - return name; - } - return doCreateName(ident, ident, ident); - } - - /** - * Creates a new variable with an unique ident in this scope. - * The generated JsName is guaranteed to have an identifier (but not short - * name) that does not clash with any existing variables in the scope. - * Future declarations of variables might however clash with the temporary - * (unless they use this function). - */ - public JsName declareFreshName(String shortName) { - String ident = shortName; - int counter = 0; - while (findExistingNameNoRecurse(ident) != null) { - ident = shortName + "_" + counter++; - } - return doCreateName(ident, shortName, shortName); - } - - String getNextTempName() { - // TODO(ngeoffray): Decide on a convention for temporary variables - // introduced by the compiler. - return "tmp$" + (scopeId != null ? scopeId + "$" : "") + tempIndex++; - } - - /** - * Creates a temporary variable with an unique name in this scope. - * The generated temporary is guaranteed to have an identifier (but not short - * name) that does not clash with any existing variables in the scope. - * Future declarations of variables might however clash with the temporary. - */ - public JsName declareTemporary() { - return declareFreshName(getNextTempName()); - } - - /** - * Gets a name object associated with the specified ident in this scope, - * creating it if necessary.
- * If the JsName does not exist yet, a new JsName is created with the given - * ident, short name and original name. - * - * @param ident An identifier that is unique within this scope. - * @param shortIdent A "pretty" name that does not have to be unique. - * @throws IllegalArgumentException if ident already exists in this scope but - * the requested short name does not match the existing short name. - */ - public JsName declareName(String ident, String shortIdent) { - return declareName(ident, shortIdent, ident); - } - - /** - * Gets a name object associated with the specified ident in this scope, - * creating it if necessary.
- * If the JsName does not exist yet, a new JsName is created. The original - * name stored in the JsName is equal to the (unmangled) specified originalName. - * - * @param ident An identifier that is unique within this scope. - * @param shortIdent A "pretty" name that does not have to be unique. - * @param originalName The original name in the source. - * @throws IllegalArgumentException if ident already exists in this scope but - * the requested short name does not match the existing short name, - * or the original name does not match the existing original name. - */ - public JsName declareName(String ident, String shortIdent, String originalName) { - JsName name = findExistingNameNoRecurse(ident); - if (name != null) { - if (!name.getShortIdent().equals(shortIdent) - || !nullableEquals(name.getOriginalName(), originalName)) { - throw new IllegalArgumentException("Requested short name " + shortIdent - + " conflicts with preexisting short name " + name.getShortIdent() + " for identifier " - + ident); - } - return name; - } - return doCreateName(ident, shortIdent, originalName); - } - - boolean nullableEquals(String s1, String s2) { - return (s1 == null) ? (s2 == null) : s1.equals(s2); - } - - /** - * Attempts to find the name object for the specified ident, searching in this - * scope, and if not found, in the parent scopes. - * - * @return null if the identifier has no associated name - */ - public final JsName findExistingName(String ident) { - JsName name = findExistingNameNoRecurse(ident); - if (name == null && parent != null) { - return parent.findExistingName(ident); - } - return name; - } - - /** - * Attempts to find an unobfuscatable name object for the specified ident, - * searching in this scope, and if not found, in the parent scopes. - * - * @return null if the identifier has no associated name - */ - public final JsName findExistingUnobfuscatableName(String ident) { - JsName name = findExistingNameNoRecurse(ident); - if (name != null && name.isObfuscatable()) { - name = null; - } - if (name == null && parent != null) { - return parent.findExistingUnobfuscatableName(ident); - } - return name; - } - - /** - * Returns an iterator for all the names defined by this scope. - */ - public Iterator getAllNames() { - return names.values().iterator(); - } - - /** - * Returns a list of this scope's child scopes. - */ - public final List getChildren() { - return children; - } - - /** - * Returns the parent scope of this scope, or null if this is the - * root scope. - */ - public final JsScope getParent() { - return parent; - } - - /** - * Returns the associated program. - */ - public JsProgram getProgram() { - assert (parent != null) : "Subclasses must override getProgram() if they do not set a parent"; - return parent.getProgram(); - } - - @Override - public final String toString() { - if (parent != null) { - return description + "->" + parent; - } else { - return description; - } - } - - /** - * Creates a new name in this scope. - */ - protected JsName doCreateName(String ident, String shortIdent, String originalName) { - JsName name = new JsName(this, ident, shortIdent, originalName); - names = Maps.putOrdered(names, ident, name); - return name; - } - - /** - * Attempts to find the name object for the specified ident, searching in this - * scope only. - * - * @return null if the identifier has no associated name - */ - public JsName findExistingNameNoRecurse(String ident) { - return names.get(ident); - } - - /** - * - * Checks whether this scope owns this name. - */ - public boolean ownsName(JsName name) { - return names.containsValue(name); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsStatement.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsStatement.java deleted file mode 100644 index 82d37ca1185..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsStatement.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Abstract base class for JavaScript statement objects. - */ -public abstract class JsStatement extends JsNode { - - protected JsStatement() { - } - - /** - * Returns true if this statement definitely causes an abrupt change in flow - * control. - */ - public boolean unconditionalControlBreak() { - return false; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsStringLiteral.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsStringLiteral.java deleted file mode 100644 index 77e60c9b89a..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsStringLiteral.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript string literal expression. - */ -public final class JsStringLiteral extends JsValueLiteral { - - private final String value; - - // These only get created by JsProgram so that they can be interned. - JsStringLiteral(String value) { - this.value = value; - } - - public String getValue() { - return value; - } - - @Override - public boolean isBooleanFalse() { - return value.length() == 0; - } - - @Override - public boolean isBooleanTrue() { - return value.length() != 0; - } - - @Override - public boolean isDefinitelyNotNull() { - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.STRING; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsSwitch.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsSwitch.java deleted file mode 100644 index 5a49624af42..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsSwitch.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.ArrayList; -import java.util.List; - -/** - * A JavaScript switch statement. - */ -public class JsSwitch extends JsStatement { - - private final List cases = new ArrayList(); - private JsExpression expr; - - public JsSwitch() { - super(); - } - - public List getCases() { - return cases; - } - - public JsExpression getExpr() { - return expr; - } - - public void setExpr(JsExpression expr) { - this.expr = expr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - expr = v.accept(expr); - v.acceptWithInsertRemove(cases); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.SWITCH; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsSwitchMember.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsSwitchMember.java deleted file mode 100644 index 0a748f60078..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsSwitchMember.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.ArrayList; -import java.util.List; - -/** - * A member/case in a JavaScript switch object. - */ -public abstract class JsSwitchMember extends JsNode { - - protected final List stmts = new ArrayList(); - - protected JsSwitchMember() { - super(); - } - - public List getStmts() { - return stmts; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsThisRef.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsThisRef.java deleted file mode 100644 index 9adb6459488..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsThisRef.java +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript this reference. - */ -public final class JsThisRef extends JsValueLiteral { - - public JsThisRef() { - super(); - } - - @Override - public boolean isBooleanFalse() { - return false; - } - - @Override - public boolean isBooleanTrue() { - return true; - } - - @Override - public boolean isDefinitelyNotNull() { - /* - * You'd think that you could get a null this via function.call/apply, but - * in fact you can't: they just make this be the window object instead. So - * it really can't ever be null. - */ - return true; - } - - @Override - public boolean isDefinitelyNull() { - return false; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - v.visit(this, ctx); - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.THIS; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsThrow.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsThrow.java deleted file mode 100644 index 4616418fb6b..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsThrow.java +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript throw statement. - */ -public class JsThrow extends JsStatement { - - private JsExpression expr; - - public JsThrow() { - super(); - } - - public JsThrow(JsExpression expr) { - super(); - this.expr = expr; - } - - public JsExpression getExpr() { - return expr; - } - - public void setExpr(JsExpression expr) { - this.expr = expr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - expr = v.accept(expr); - } - v.endVisit(this, ctx); - } - - @Override - public boolean unconditionalControlBreak() { - return true; - } - - @Override - public NodeKind getKind() { - return NodeKind.THROW; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsTry.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsTry.java deleted file mode 100644 index 61357bcd406..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsTry.java +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.ArrayList; -import java.util.List; - -/** - * A JavaScript try statement. - */ -public class JsTry extends JsStatement { - - private final List catches = new ArrayList(); - private JsBlock finallyBlock; - private JsBlock tryBlock; - - public JsTry() { - super(); - } - - public List getCatches() { - return catches; - } - - public JsBlock getFinallyBlock() { - return finallyBlock; - } - - public JsBlock getTryBlock() { - return tryBlock; - } - - public void setFinallyBlock(JsBlock block) { - this.finallyBlock = block; - } - - public void setTryBlock(JsBlock block) { - tryBlock = block; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - tryBlock = v.accept(tryBlock); - v.acceptWithInsertRemove(catches); - if (finallyBlock != null) { - finallyBlock = v.accept(finallyBlock); - } - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.TRY; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.java deleted file mode 100644 index 00f103f35c9..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript prefix or postfix operation. - */ -public abstract class JsUnaryOperation extends JsExpression { - - private JsExpression arg; - - private final JsUnaryOperator op; - - public JsUnaryOperation(JsUnaryOperator op) { - this(op, null); - } - - public JsUnaryOperation(JsUnaryOperator op, JsExpression arg) { - super(); - this.op = op; - this.arg = arg; - } - - public JsExpression getArg() { - return arg; - } - - public JsUnaryOperator getOperator() { - return op; - } - - @Override - public final boolean hasSideEffects() { - return op.isModifying() || arg.hasSideEffects(); - } - - public void setArg(JsExpression arg) { - this.arg = arg; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (op.isModifying()) { - // The delete operator is practically like an assignment of undefined, so - // for practical purposes we're treating it as an lvalue. - arg = v.acceptLvalue(arg); - } else { - arg = v.accept(arg); - } - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java deleted file mode 100644 index 2b854d8313e..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.java +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript unary operator. - */ -public enum JsUnaryOperator implements JsOperator { - - /* - * Precedence indices from "JavaScript - The Definitive Guide" 4th Edition - * (page 57) - */ - BIT_NOT("~", 14, PREFIX), DEC("--", 14, POSTFIX | PREFIX), DELETE("delete", 14, PREFIX), INC( - "++", 14, POSTFIX | PREFIX), NEG("-", 14, PREFIX), POS("+", 14, PREFIX), - NOT("!", 14, PREFIX), TYPEOF("typeof", 14, PREFIX), VOID("void", 14, PREFIX); - - private final int mask; - private final int precedence; - private final String symbol; - - private JsUnaryOperator(String symbol, int precedence, int mask) { - this.symbol = symbol; - this.precedence = precedence; - this.mask = mask; - } - - @Override - public int getPrecedence() { - return precedence; - } - - @Override - public String getSymbol() { - return symbol; - } - - @Override - public boolean isKeyword() { - return this == DELETE || this == TYPEOF || this == VOID; - } - - @Override - public boolean isLeftAssociative() { - return (mask & LEFT) != 0; - } - - public boolean isModifying() { - return this == DEC || this == INC || this == DELETE; - } - - @Override - public boolean isPrecedenceLessThan(JsOperator other) { - return precedence < other.getPrecedence(); - } - - @Override - public boolean isValidInfix() { - return (mask & INFIX) != 0; - } - - @Override - public boolean isValidPostfix() { - return (mask & POSTFIX) != 0; - } - - @Override - public boolean isValidPrefix() { - return (mask & PREFIX) != 0; - } - - @Override - public String toString() { - return symbol; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsValueLiteral.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsValueLiteral.java deleted file mode 100644 index f23ab5dbce4..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsValueLiteral.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript string literal expression. - */ -public abstract class JsValueLiteral extends JsLiteral { - - protected JsValueLiteral() { - } - - @Override - public final boolean hasSideEffects() { - return false; - } - - @Override - public final boolean isLeaf() { - return true; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVars.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVars.java deleted file mode 100644 index aaf629259aa..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVars.java +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import com.google.dart.compiler.common.SourceInfo; - -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** - * A JavaScript var statement. - */ -public class JsVars extends JsStatement implements Iterable { - - /** - * A var declared using the JavaScript var statement. - */ - public static class JsVar extends JsNode implements HasName { - - private final JsName name; - private JsExpression initExpr; - - public JsVar(JsName name) { - this.name = name; - } - - public JsVar(JsName name, JsExpression initExpr) { - this.name = name; - this.initExpr = initExpr; - } - - public JsExpression getInitExpr() { - return initExpr; - } - - @Override - public JsName getName() { - return name; - } - - public void setInitExpr(JsExpression initExpr) { - this.initExpr = initExpr; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - if (initExpr != null) { - initExpr = v.accept(initExpr); - } - } - v.endVisit(this, ctx); - } - - @Override - public JsVar setSourceRef(SourceInfo info) { - super.setSourceRef(info); - return this; - } - - @Override - public NodeKind getKind() { - return NodeKind.VAR; - } - } - - private final List vars = new ArrayList(); - - public JsVars() { - } - - public void add(JsVar var) { - vars.add(var); - } - - public int getNumVars() { - return vars.size(); - } - - public void insert(JsVar var) { - vars.add(var); - } - - public boolean isEmpty() { - return vars.isEmpty(); - } - - // Iterator returns JsVar objects - @Override - public Iterator iterator() { - return vars.iterator(); - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - v.acceptWithInsertRemove(vars); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.VARS; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVisitable.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVisitable.java deleted file mode 100644 index 626648af8ae..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVisitable.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * Abstracts the idea that a class can be traversed. - */ -public interface JsVisitable { - - /** - * Causes this object to have the visitor visit itself and its children. - * - * @param visitor the visitor that should traverse this node - * @param ctx the context of an existing traversal - */ - void traverse(JsVisitor visitor, JsContext ctx); -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVisitor.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVisitor.java deleted file mode 100644 index 5b9cd983d08..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsVisitor.java +++ /dev/null @@ -1,430 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -import java.util.List; - -/** - * Implemented by nodes that will visit child nodes. - */ -@SuppressWarnings("unused") -public class JsVisitor { - - protected static final JsContext LVALUE_CONTEXT = new JsContext() { - - @Override - public boolean canInsert() { - return false; - } - - @Override - public boolean canRemove() { - return false; - } - - @Override - public void insertAfter(JsVisitable node) { - throw new UnsupportedOperationException(); - } - - @Override - public void insertBefore(JsVisitable node) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isLvalue() { - return true; - } - - @Override - public void removeMe() { - throw new UnsupportedOperationException(); - } - - @Override - public void replaceMe(JsVisitable node) { - throw new UnsupportedOperationException(); - } - }; - - protected static final JsContext UNMODIFIABLE_CONTEXT = new JsContext() { - - @Override - public boolean canInsert() { - return false; - } - - @Override - public boolean canRemove() { - return false; - } - - @Override - public void insertAfter(JsVisitable node) { - throw new UnsupportedOperationException(); - } - - @Override - public void insertBefore(JsVisitable node) { - throw new UnsupportedOperationException(); - } - - @Override - public boolean isLvalue() { - return false; - } - - @Override - public void removeMe() { - throw new UnsupportedOperationException(); - } - - @Override - public void replaceMe(JsVisitable node) { - throw new UnsupportedOperationException(); - } - }; - - public final T accept(T node) { - return this.doAccept(node); - } - - public final void acceptList(List collection) { - doAcceptList(collection); - } - - public JsExpression acceptLvalue(JsExpression expr) { - return doAcceptLvalue(expr); - } - - public final void acceptWithInsertRemove(List collection) { - doAcceptWithInsertRemove(collection); - } - - public boolean didChange() { - throw new UnsupportedOperationException(); - } - - public void endVisit(JsArrayAccess x, JsContext ctx) { - } - - public void endVisit(JsArrayLiteral x, JsContext ctx) { - } - - public void endVisit(JsBinaryOperation x, JsContext ctx) { - } - - public void endVisit(JsBlock x, JsContext ctx) { - } - - public void endVisit(JsBooleanLiteral x, JsContext ctx) { - } - - public void endVisit(JsBreak x, JsContext ctx) { - } - - public void endVisit(JsCase x, JsContext ctx) { - } - - public void endVisit(JsCatch x, JsContext ctx) { - } - - public void endVisit(JsConditional x, JsContext ctx) { - } - - public void endVisit(JsContinue x, JsContext ctx) { - } - - public void endVisit(JsDebugger x, JsContext ctx) { - } - - public void endVisit(JsDefault x, JsContext ctx) { - } - - public void endVisit(JsDoWhile x, JsContext ctx) { - } - - public void endVisit(JsEmpty x, JsContext ctx) { - } - - public void endVisit(JsExprStmt x, JsContext ctx) { - } - - public void endVisit(JsFor x, JsContext ctx) { - } - - public void endVisit(JsForIn x, JsContext ctx) { - } - - public void endVisit(JsFunction x, JsContext ctx) { - } - - public void endVisit(JsIf x, JsContext ctx) { - } - - public void endVisit(JsInvocation x, JsContext ctx) { - } - - public void endVisit(JsLabel x, JsContext ctx) { - } - - public void endVisit(JsNameRef x, JsContext ctx) { - } - - public void endVisit(JsNew x, JsContext ctx) { - } - - public void endVisit(JsNullLiteral x, JsContext ctx) { - } - - public void endVisit(JsNumberLiteral x, JsContext ctx) { - } - - public void endVisit(JsObjectLiteral x, JsContext ctx) { - } - - public void endVisit(JsParameter x, JsContext ctx) { - } - - public void endVisit(JsPostfixOperation x, JsContext ctx) { - } - - public void endVisit(JsPrefixOperation x, JsContext ctx) { - } - - public void endVisit(JsProgram x, JsContext ctx) { - } - - public void endVisit(JsProgramFragment x, JsContext ctx) { - } - - public void endVisit(JsPropertyInitializer x, JsContext ctx) { - } - - public void endVisit(JsRegExp x, JsContext ctx) { - } - - public void endVisit(JsReturn x, JsContext ctx) { - } - - public void endVisit(JsStringLiteral x, JsContext ctx) { - } - - public void endVisit(JsSwitch x, JsContext ctx) { - } - - public void endVisit(JsThisRef x, JsContext ctx) { - } - - public void endVisit(JsThrow x, JsContext ctx) { - } - - public void endVisit(JsTry x, JsContext ctx) { - } - - public void endVisit(JsVars.JsVar x, JsContext ctx) { - } - - public void endVisit(JsVars x, JsContext ctx) { - } - - public void endVisit(JsWhile x, JsContext ctx) { - } - - public boolean visit(JsArrayAccess x, JsContext ctx) { - return true; - } - - public boolean visit(JsArrayLiteral x, JsContext ctx) { - return true; - } - - public boolean visit(JsBinaryOperation x, JsContext ctx) { - return true; - } - - public boolean visit(JsBlock x, JsContext ctx) { - return true; - } - - public boolean visit(JsBooleanLiteral x, JsContext ctx) { - return true; - } - - public boolean visit(JsBreak x, JsContext ctx) { - return true; - } - - public boolean visit(JsCase x, JsContext ctx) { - return true; - } - - public boolean visit(JsCatch x, JsContext ctx) { - return true; - } - - public boolean visit(JsConditional x, JsContext ctx) { - return true; - } - - public boolean visit(JsContinue x, JsContext ctx) { - return true; - } - - public boolean visit(JsDebugger x, JsContext ctx) { - return true; - } - - public boolean visit(JsDefault x, JsContext ctx) { - return true; - } - - public boolean visit(JsDoWhile x, JsContext ctx) { - return true; - } - - public boolean visit(JsEmpty x, JsContext ctx) { - return true; - } - - public boolean visit(JsExprStmt x, JsContext ctx) { - return true; - } - - public boolean visit(JsFor x, JsContext ctx) { - return true; - } - - public boolean visit(JsForIn x, JsContext ctx) { - return true; - } - - public boolean visit(JsFunction x, JsContext ctx) { - return true; - } - - public boolean visit(JsIf x, JsContext ctx) { - return true; - } - - public boolean visit(JsInvocation x, JsContext ctx) { - return true; - } - - public boolean visit(JsLabel x, JsContext ctx) { - return true; - } - - public boolean visit(JsNameRef x, JsContext ctx) { - return true; - } - - public boolean visit(JsNew x, JsContext ctx) { - return true; - } - - public boolean visit(JsNullLiteral x, JsContext ctx) { - return true; - } - - public boolean visit(JsNumberLiteral x, JsContext ctx) { - return true; - } - - public boolean visit(JsObjectLiteral x, JsContext ctx) { - return true; - } - - public boolean visit(JsParameter x, JsContext ctx) { - return true; - } - - public boolean visit(JsPostfixOperation x, JsContext ctx) { - return true; - } - - public boolean visit(JsPrefixOperation x, JsContext ctx) { - return true; - } - - public boolean visit(JsProgram x, JsContext ctx) { - return true; - } - - public boolean visit(JsProgramFragment x, JsContext ctx) { - return true; - } - - public boolean visit(JsPropertyInitializer x, JsContext ctx) { - return true; - } - - public boolean visit(JsRegExp x, JsContext ctx) { - return true; - } - - public boolean visit(JsReturn x, JsContext ctx) { - return true; - } - - public boolean visit(JsStringLiteral x, JsContext ctx) { - return true; - } - - public boolean visit(JsSwitch x, JsContext ctx) { - return true; - } - - public boolean visit(JsThisRef x, JsContext ctx) { - return true; - } - - public boolean visit(JsThrow x, JsContext ctx) { - return true; - } - - public boolean visit(JsTry x, JsContext ctx) { - return true; - } - - public boolean visit(JsVars.JsVar x, JsContext ctx) { - return true; - } - - public boolean visit(JsVars x, JsContext ctx) { - return true; - } - - public boolean visit(JsWhile x, JsContext ctx) { - return true; - } - - protected T doAccept(T node) { - doTraverse(node, UNMODIFIABLE_CONTEXT); - return node; - } - - protected void doAcceptList(List collection) { - for (T node : collection) { - doTraverse(node, UNMODIFIABLE_CONTEXT); - } - } - - protected JsExpression doAcceptLvalue(JsExpression expr) { - doTraverse(expr, LVALUE_CONTEXT); - return expr; - } - - protected void doAcceptWithInsertRemove(List collection) { - for (T node : collection) { - doTraverse(node, UNMODIFIABLE_CONTEXT); - } - } - - protected void doTraverse(JsVisitable node, JsContext ctx) { - node.traverse(this, ctx); - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsWhile.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/JsWhile.java deleted file mode 100644 index c40203bc1f1..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/JsWhile.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -/** - * A JavaScript while statement. - */ -public class JsWhile extends JsStatement { - - private JsStatement body; - private JsExpression condition; - - public JsWhile() { - } - - public JsWhile(JsExpression condition, JsStatement body) { - this.condition = condition; - this.body = body; - } - - public JsStatement getBody() { - return body; - } - - public JsExpression getCondition() { - return condition; - } - - public void setBody(JsStatement body) { - this.body = body; - } - - public void setCondition(JsExpression condition) { - this.condition = condition; - } - - @Override - public void traverse(JsVisitor v, JsContext ctx) { - if (v.visit(this, ctx)) { - condition = v.accept(condition); - body = v.accept(body); - } - v.endVisit(this, ctx); - } - - @Override - public NodeKind getKind() { - return NodeKind.WHILE; - } -} diff --git a/js.ast/src/com/google/dart/compiler/backend/js/ast/NodeKind.java b/js.ast/src/com/google/dart/compiler/backend/js/ast/NodeKind.java deleted file mode 100644 index 614e4bb3bd9..00000000000 --- a/js.ast/src/com/google/dart/compiler/backend/js/ast/NodeKind.java +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.backend.js.ast; - -public enum NodeKind { - ARRAY_ACCESS, - ARRAY, - BINARY_OP, - BLOCK, - BOOLEAN, - BREAK, - CASE, - CATCH, - CONDITIONAL, - CONTINUE, - DEBUGGER, - DEFAULT, - DO, - EMPTY, - EXPR_STMT, - FOR, - FOR_IN, - FUNCTION, - IF, - INVOKE, - LABEL, - NAME_REF, - NEW, - NULL, - NUMBER, - OBJECT, - PARAMETER, - POSTFIX_OP, - PREFIX_OP, - PROGRAM, - PROGRAM_FRAGMENT, - PROPERTY_INIT, - REGEXP, - RETURN, - STRING, - SWITCH, - THIS, - THROW, - TRY, - VARS, - VAR, - WHILE -} diff --git a/js.ast/src/com/google/dart/compiler/common/AbstractNode.java b/js.ast/src/com/google/dart/compiler/common/AbstractNode.java deleted file mode 100644 index 5b70197dd13..00000000000 --- a/js.ast/src/com/google/dart/compiler/common/AbstractNode.java +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.common; - -import com.google.dart.compiler.Source; - -/** - * Abstract base class for nodes that carry source information. - */ -public class AbstractNode implements SourceInfo, HasSourceInfo { - - // TODO(johnlenz): All this source location data is wasteful. - // Move it into a com.google.dart.compiler.backend.common object, that can be shared between the ASTs - // or something. - protected Source source = null; - protected int sourceLine = -1; - protected int sourceColumn = -1; - protected int sourceStart = -1; - protected int sourceLength = -1; - - @Override - public Source getSource() { - return source; - } - - @Override - public int getSourceLine() { - return sourceLine; - } - - @Override - public int getSourceColumn() { - return sourceColumn; - } - - @Override - public int getSourceStart() { - return sourceStart; - } - - @Override - public int getSourceLength() { - return sourceLength; - } - - @Override - public SourceInfo getSourceInfo() { - return this; - } - - @Override - public void setSourceInfo(SourceInfo info) { - source = info.getSource(); - sourceStart = info.getSourceStart(); - sourceLength = info.getSourceLength(); - sourceLine = info.getSourceLine(); - sourceColumn = info.getSourceColumn(); - } - - @Override - public final void setSourceLocation( - Source source, int line, int column, int startPosition, int length) { - assert (startPosition != -1 && length >= 0 - || startPosition == -1 && length == 0); - this.source = source; - this.sourceLine = line; - this.sourceColumn = column; - this.sourceStart = startPosition; - this.sourceLength = length; - } - - public final void setSourceRange(int startPosition, int length) { - assert (startPosition != -1 && length >= 0 - || startPosition == -1 && length == 0); - this.sourceStart = startPosition; - this.sourceLength = length; - } - -} diff --git a/js.ast/src/com/google/dart/compiler/common/HasSourceInfo.java b/js.ast/src/com/google/dart/compiler/common/HasSourceInfo.java deleted file mode 100644 index bda3da94996..00000000000 --- a/js.ast/src/com/google/dart/compiler/common/HasSourceInfo.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.common; - -import com.google.dart.compiler.Source; - -/** - * Abstract view of a class that has source info. - */ -public interface HasSourceInfo { - - /** - * Return the source info associated with this object. - */ - SourceInfo getSourceInfo(); - - /** - * Set the source info associated with this object. May only be called once. - * @param info - */ - void setSourceInfo(SourceInfo info); - - /** - * Sets the source range of the original source file where the source fragment - * corresponding to this node was found. - * - *

- * Each node in the subtree (other than the contrived nodes) carries source - * range(s) information relating back to positions in the given source (the - * given source itself is not remembered with the AST). The source range - * usually begins at the first character of the first token corresponding to - * the node; leading whitespace and comments are not included. The - * source range usually extends through the last character of the last token - * corresponding to the node; trailing whitespace and comments are not - * included. There are a handful of exceptions (including the various body - * declarations). Source ranges nest properly: the source range for a child is - * always within the source range of its parent, and the source ranges of - * sibling nodes never overlap. - * - * @param source the associated source - * @param line the 1-based line index, or -1, if no source - * location is available - * @param column the 1-based column index, or -1, if no source - * location is available - * @param startPosition a 0-based character index, or -1, if no - * source location is available - * @param length a (possibly 0) length, or -1, if no source - * location is available - * @see SourceInfo#getSourceStart() - * @see SourceInfo#getSourceLength() - */ - void setSourceLocation(Source source, int line, int column, int startPosition, int length); -} diff --git a/js.ast/src/com/google/dart/compiler/common/Name.java b/js.ast/src/com/google/dart/compiler/common/Name.java deleted file mode 100644 index 4697b491d96..00000000000 --- a/js.ast/src/com/google/dart/compiler/common/Name.java +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.common; - -import java.io.*; -import java.nio.charset.Charset; - -/** - * Instead of Strings, we use GlobalNames to abstract the underlying representation. - * - *

    - *
  • GlobalNames are globally unique and use identity for equality.
  • - *
  • GlobalNames are interned, so all references to the same name use the same - * bytes.
  • - *
- * TODO(scottb): use byte[] instead of char[] when the parser is rewritten - * to parse byte[]. - */ -public final class Name implements Serializable { - - /** - * The encoding this class uses when converting between chars and bytes. - */ - public static final Charset CHARSET = Charset.forName("UTF-8"); - - private static final NameFactory factory = new NameFactory(); - - private static final long serialVersionUID = 0L; - - /** - * Return the Name corresponding to the data. An internal reference to - * data is kept for efficiency, do NOT mutate data after calling - * this method. - */ - public static Name of(char[] data) { - return factory.of(data); - } - - /** - * Return the Name corresponding to the data. An internal copy of the data is - * made. - */ - public static Name of(char[] data, int offset, int length) { - return factory.of(data, offset, length); - } - - static int computeHashCode(char[] data, int offset, int length) { - // Effective Java Item 9. - int result = 89; - for (int i = offset, end = offset + length; i < end; ++i) { - result *= 31; - result += data[i]; - } - return result; - } - - final char[] data; - - private final transient int hashCode; - - Name(char[] data, int hashCode) { - this.data = data; - this.hashCode = hashCode; - } - - /** - * Always compares based on identity. - */ - @Override - public boolean equals(Object obj) { - return this == obj; - } - - /** - * Returns the hashCode of the underlying data. - */ - @Override - public int hashCode() { - return hashCode; - } - - /** - * Constructs a String to represent the internal data. - */ - @Override - public String toString() { - return String.valueOf(data); - } - - /** - * Write my data into a {@link java.io.OutputStream} using the encoding specified in - * {@link #CHARSET}. - */ - public void writeBytesTo(OutputStream out) throws IOException { - // TODO(scottb): avoid allocating the String. - out.write(new String(data).getBytes(CHARSET)); - } - - /** - * Write my character data into a {@link java.io.PrintStream}. - */ - public void writeCharsTo(PrintStream out) { - out.print(data); - } - - /** - * Write my character data into a {@link java.io.Writer}. - */ - public void writeCharsTo(Writer writer) throws IOException { - writer.write(data); - } - - /** - * Replace with the canonical instance. - */ - private Object readResolve() { - return Name.of(data); - } -} diff --git a/js.ast/src/com/google/dart/compiler/common/NameFactory.java b/js.ast/src/com/google/dart/compiler/common/NameFactory.java deleted file mode 100644 index d305f290bf9..00000000000 --- a/js.ast/src/com/google/dart/compiler/common/NameFactory.java +++ /dev/null @@ -1,226 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.common; - -import com.google.common.annotations.VisibleForTesting; -import com.google.common.collect.MapMaker; - -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; -import java.util.Arrays; -import java.util.concurrent.ConcurrentMap; - -/** - * Manages the life cycle, uniqueness, and object identity invariants of - * {@link Name}. - */ -final class NameFactory { - /* - * TODO: does this actually save memory in practice? For each interned Name, - * we use: - * - * 1) The data array (n bytes). - * - * 2) The Name object (2 fields) - * - * 3) The RealKey (1 field + 4 fields from Reference). - * - * 4) ConcurrentMap.Entry (4 fields) - * - * Of course, a Map is really much heavier than we need, all we really need is - * a Set where you can retrieve an object already in the Set. A bare linear - * probe hash table of RealKey would let us get rid of the Entry object. - */ - - /** - * The whole point of this class is to cheaply create a light-weight key that - * doesn't need to make its own copy of the data. This object is constructed - * with equality semantics to {com.google.dart.compiler.backend.common.NameFactory.RealKey}, for doing cheap map lookups. - */ - private static final class FakeKey { - private final char[] data; - private final int hashCode; - private final int length; - private final int offset; - - public FakeKey(char[] data, int hashCode) { - this(data, 0, data.length, hashCode); - } - - public FakeKey(char[] data, int offset, int length, int hashCode) { - this.data = data; - this.offset = offset; - this.length = length; - this.hashCode = hashCode; - } - - @Override - public boolean equals(Object obj) { - /* - * NOTE: this ONLY WORKS for comparisons to RealKey. But that's all we - * need since we only store real keys in the map. - */ - Name name = ((RealKey) obj).get(); - if (name == null) { - return false; - } - return equalsName(name); - } - - public boolean equalsName(Name name) { - if (this.length != name.data.length) { - return false; - } - int itMine = this.offset; - int itTheirs = 0; - int endMine = this.offset + this.length; - while (itMine < endMine) { - if (this.data[itMine++] != name.data[itTheirs++]) { - return false; - } - } - return true; - } - - @Override - public int hashCode() { - return hashCode; - } - - @Override - public String toString() { - return "FakeKey(" + String.valueOf(data, offset, length) + ")"; - } - } - - /** - * Adapted from {@link com.google.common.collect.Interners#newWeakInterner()}. - */ - private static final class RealKey extends WeakReference { - /** - * Must store the hashCode locally so we can be removed from - * {com.google.dart.compiler.backend.common.NameFactory#map} after our referent is cleared. - */ - private final int hashCode; - - public RealKey(Name name, ReferenceQueue queue) { - super(name, queue); - hashCode = name.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (obj == this) { - return true; - } - if (obj instanceof FakeKey) { - Name referent = get(); - if (referent == null) { - return false; - } - return ((FakeKey) obj).equalsName(referent); - } - if (obj instanceof RealKey) { - Name referent = get(); - if (referent == null) { - return false; - } - Name otherReferent = ((RealKey) obj).get(); - if (otherReferent == null) { - return false; - } - return Arrays.equals(referent.data, otherReferent.data); - } - return false; - } - - @Override - public int hashCode() { - return hashCode; - } - - @Override - public String toString() { - Name referent = get(); - return "RealKey(" + referent + ")"; - } - } - - private final ConcurrentMap map = new MapMaker().makeMap(); - private final ReferenceQueue queue = new ReferenceQueue(); - - /** - * Return the Name corresponding to the data. An internal reference to - * data may be kept. - */ - public Name of(char[] data) { - cleanUp(); - int hashCode = Name.computeHashCode(data, 0, data.length); - FakeKey fakeKey = new FakeKey(data, hashCode); - Name result = get(fakeKey); - if (result == null) { - result = put(new Name(data, hashCode)); - } - return result; - } - - /** - * Return the Name corresponding to the data. An internal copy of the data is - * made. - */ - public Name of(char[] data, int offset, int length) { - cleanUp(); - int hashCode = Name.computeHashCode(data, offset, length); - FakeKey fakeKey = new FakeKey(data, offset, length, hashCode); - Name result = get(fakeKey); - if (result == null) { - char[] copy = new char[length]; - System.arraycopy(data, offset, copy, 0, length); - result = put(new Name(copy, hashCode)); - } - return result; - } - - @VisibleForTesting - void cleanUp() { - RealKey item; - while ((item = (RealKey) queue.poll()) != null) { - map.remove(item); - } - } - - @VisibleForTesting - WeakReference getRefFor(Name name) { - return map.get(new FakeKey(name.data, name.hashCode())); - } - - @VisibleForTesting - int numEntries() { - return map.size(); - } - - private Name get(FakeKey fakeKey) { - RealKey realKey = map.get(fakeKey); - if (realKey != null) { - return realKey.get(); - } - return null; - } - - private Name put(Name name) { - RealKey realKey = new RealKey(name, queue); - while (true) { - RealKey sneakyRef = map.putIfAbsent(realKey, realKey); - if (sneakyRef == null) { - return name; - } else { - Name canonical = sneakyRef.get(); - if (canonical != null) { - return canonical; - } - } - } - } -} diff --git a/js.ast/src/com/google/dart/compiler/common/SourceInfo.java b/js.ast/src/com/google/dart/compiler/common/SourceInfo.java deleted file mode 100644 index 3a5cd23f113..00000000000 --- a/js.ast/src/com/google/dart/compiler/common/SourceInfo.java +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.common; -import com.google.dart.compiler.Source; - -import java.io.Serializable; - -/** - * Tracks file and line information for AST nodes. - */ -public interface SourceInfo extends Serializable { - - /** - * The source code provider. - */ - Source getSource(); - - /** - * @return A 1-based line number into the original source file indicating - * where the source fragment begins. - */ - int getSourceLine(); - - /** - * @return A 1-based column number into the original source file indicating - * where the source fragment begins. - */ - int getSourceColumn(); - - /** - * Returns the character index into the original source file indicating - * where the source fragment corresponding to this node begins. - * - *

- * The parser supplies useful well-defined source ranges to the nodes it creates. - * - * @return the 0-based character index, or -1 - * if no source startPosition information is recorded for this node - * @see #getSourceLength() - * @see HasSourceInfo#setSourceLocation(com.google.dart.compiler.Source, int, int, int, int) - */ - int getSourceStart(); - - /** - * Returns the length in characters of the original source file indicating - * where the source fragment corresponding to this node ends. - *

- * The parser supplies useful well-defined source ranges to the nodes it creates. - * - * @return a (possibly 0) length, or 0 - * if no source source position information is recorded for this node - * @see #getSourceStart() - * @see HasSourceInfo#setSourceLocation(com.google.dart.compiler.Source, int, int, int, int) - */ - int getSourceLength(); -} diff --git a/js.ast/src/com/google/dart/compiler/util/AbstractTextOutput.java b/js.ast/src/com/google/dart/compiler/util/AbstractTextOutput.java deleted file mode 100644 index 9c8d2b1cd16..00000000000 --- a/js.ast/src/com/google/dart/compiler/util/AbstractTextOutput.java +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.util; - -import java.io.PrintWriter; -import java.util.Arrays; - -/** - * An abstract base type to build TextOutput implementations. - */ -public abstract class AbstractTextOutput implements TextOutput { - private final boolean compact; - private int identLevel = 0; - private int indentGranularity = 2; - private char[][] indents = new char[][] {new char[0]}; - private boolean justNewlined; - private PrintWriter out; - private int position = 0; - private int line = 0; - private int column = 0; - - protected AbstractTextOutput(boolean compact) { - this.compact = compact; - } - - public int getPosition() { - return position; - } - - public int getLine() { - return line; - } - - public int getColumn() { - return column; - } - - public void indentIn() { - ++identLevel; - if (identLevel >= indents.length) { - // Cache a new level of indentation string. - // - char[] newIndentLevel = new char[identLevel * indentGranularity]; - Arrays.fill(newIndentLevel, ' '); - char[][] newIndents = new char[indents.length + 1][]; - System.arraycopy(indents, 0, newIndents, 0, indents.length); - newIndents[identLevel] = newIndentLevel; - indents = newIndents; - } - } - - public void indentOut() { - --identLevel; - } - - public void newline() { - out.print('\n'); - position++; - line++; - column = 0; - justNewlined = true; - } - - public void newlineOpt() { - if (!compact) { - newline(); - } - } - - public void print(char c) { - maybeIndent(); - out.print(c); - position++; - column++; - justNewlined = false; - } - - public void print(char[] s) { - maybeIndent(); - printAndCount(s); - justNewlined = false; - } - - public void print(String s) { - maybeIndent(); - printAndCount(s.toCharArray()); - justNewlined = false; - } - - // Why don't the "Opt" methods update "justNewLined"? - public void printOpt(char c) { - if (!compact) { - maybeIndent(); - out.print(c); - position += 1; - column++; - } - } - - public void printOpt(char[] s) { - if (!compact) { - maybeIndent(); - printAndCount(s); - } - } - - public void printOpt(String s) { - if (!compact) { - maybeIndent(); - printAndCount(s.toCharArray()); - } - } - - protected void setPrintWriter(PrintWriter out) { - this.out = out; - } - - private void maybeIndent() { - if (justNewlined && !compact) { - printAndCount(indents[identLevel]); - justNewlined = false; - } - } - - private void printAndCount(char[] chars) { - position += chars.length; - column += chars.length; - out.print(chars); - } -} diff --git a/js.ast/src/com/google/dart/compiler/util/AstUtil.java b/js.ast/src/com/google/dart/compiler/util/AstUtil.java deleted file mode 100644 index c635d696c54..00000000000 --- a/js.ast/src/com/google/dart/compiler/util/AstUtil.java +++ /dev/null @@ -1,404 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.util; - -import com.google.dart.compiler.InternalCompilerException; -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.common.SourceInfo; -import com.sun.istack.internal.NotNull; - -import java.util.List; - -/** - * @author johnlenz@google.com (John Lenz) - */ -public class AstUtil { - - public static JsInvocation newInvocation( - JsExpression target, JsExpression... params) { - JsInvocation invoke = new JsInvocation(); - invoke.setQualifier(target); - for (JsExpression expr : params) { - invoke.getArguments().add(expr); - } - return invoke; - } - - public static JsInvocation newInvocation( - JsExpression target, List params) { - JsInvocation invoke = new JsInvocation(); - invoke.setQualifier(target); - for (JsExpression expr : params) { - invoke.getArguments().add(expr); - } - return invoke; - } - - public static JsNameRef newQualifiedNameRef(String name) { - JsNameRef node = null; - int endPos = -1; - int startPos = 0; - do { - endPos = name.indexOf('.', startPos); - String part = (endPos == -1 - ? name.substring(startPos) - : name.substring(startPos, endPos)); - node = newNameRef(node, part); - startPos = endPos + 1; - } while (endPos != -1); - - return node; - } - - public static JsNameRef newNameRef(JsExpression qualifier, String prop) { - JsNameRef nameRef = new JsNameRef(prop); - if (qualifier != null) { - nameRef.setQualifier(qualifier); - } - return nameRef; - } - - public static JsNameRef nameref(SourceInfo info, JsName qualifier, JsName prop) { - JsNameRef nameRef = new JsNameRef(prop); - if (qualifier != null) { - nameRef.setQualifier(qualifier.makeRef()); - } - nameRef.setSourceRef(info); - return nameRef; - } - - public static JsNameRef newNameRef(JsExpression qualifier, JsName prop) { - JsNameRef nameRef = new JsNameRef(prop); - if (qualifier != null) { - nameRef.setQualifier(qualifier); - } - return nameRef; - } - - public static JsNameRef newPrototypeNameRef(JsExpression qualifier) { - return newNameRef(qualifier, "prototype"); - } - - public static JsArrayAccess newArrayAccess(JsExpression target, JsExpression key) { - JsArrayAccess arr = new JsArrayAccess(); - arr.setArrayExpr(target); - arr.setIndexExpr(key); - return arr; - } - - public static JsBlock newBlock(JsStatement... stmts) { - JsBlock jsBlock = new JsBlock(); - for (JsStatement stmt : stmts) { - jsBlock.getStatements().add(stmt); - } - return jsBlock; - } - - /** - * Returns a sequence of expressions (using the binary sequence operator). - * - * @param exprs - expressions to add to sequence - * @return a sequence of expressions. - */ - public static JsBinaryOperation newSequence(JsExpression... exprs) { - if (exprs.length < 2) { - throw new InternalCompilerException("newSequence expects at least two arguments"); - } - JsExpression result = exprs[exprs.length - 1]; - for (int i = exprs.length - 2; i >= 0; i--) { - result = new JsBinaryOperation(JsBinaryOperator.COMMA, exprs[i], result); - } - return (JsBinaryOperation) result; - } - - // Ensure a valid LHS - public static JsBinaryOperation newAssignment( - JsNameRef nameRef, JsExpression expr) { - return new JsBinaryOperation(JsBinaryOperator.ASG, nameRef, expr); - } - - public static JsBinaryOperation newAssignment( - JsArrayAccess target, JsExpression expr) { - return new JsBinaryOperation(JsBinaryOperator.ASG, target, expr); - } - - public static JsVars newVar(SourceInfo info, JsName name, JsExpression expr) { - JsVars.JsVar var = new JsVars.JsVar(name).setSourceRef(info); - var.setInitExpr(expr); - JsVars vars = new JsVars(); - vars.add(var); - return vars; - } - - public static JsVars newVar(JsName name, JsExpression expr) { - JsVars.JsVar var = new JsVars.JsVar(name); - if (expr != null) { - var.setInitExpr(expr); - } - JsVars vars = new JsVars(); - vars.add(var); - return vars; - } - - public static JsSwitch newSwitch( - JsExpression expr, JsSwitchMember... cases) { - JsSwitch jsSwitch = new JsSwitch(); - jsSwitch.setExpr(expr); - for (JsSwitchMember jsCase : cases) { - jsSwitch.getCases().add(jsCase); - } - return jsSwitch; - } - - public static JsCase newCase(JsExpression expr, JsStatement... stmts) { - JsCase jsCase = new JsCase(); - jsCase.setCaseExpr(expr); - for (JsStatement stmt : stmts) { - jsCase.getStmts().add(stmt); - } - return jsCase; - } - - public static JsDefault newDefaultCase(JsStatement... stmts) { - JsDefault jsCase = new JsDefault(); - for (JsStatement stmt : stmts) { - jsCase.getStmts().add(stmt); - } - return jsCase; - } - - public static JsFunction newFunction( - JsScope scope, JsName name, List params, JsBlock body) { - JsFunction fn = new JsFunction(scope); - if (name != null) { - fn.setName(name); - } - if (params != null) { - for (JsParameter param : params) { - fn.getParameters().add(param); - } - } - fn.setBody(body); - return fn; - } - - public static JsInvocation call(SourceInfo src, JsExpression target, JsExpression... params) { - return (JsInvocation) newInvocation(target, params).setSourceRef(src); - } - - public static JsBinaryOperation comma(SourceInfo src, JsExpression op1, JsExpression op2) { - return (JsBinaryOperation) new JsBinaryOperation(JsBinaryOperator.COMMA, op1, op2) - .setSourceRef(src); - } - - public static JsNameRef nameref(SourceInfo src, String name) { - return (JsNameRef) new JsNameRef(name).setSourceRef(src); - } - - public static JsNameRef nameref(SourceInfo src, JsName qualifier, String prop) { - return nameref(src, qualifier.makeRef().setSourceRef(src), prop); - } - - public static JsNameRef nameref(SourceInfo src, JsExpression qualifier, String prop) { - return (JsNameRef) newNameRef(qualifier, prop).setSourceRef(src); - } - - public static JsExpression assign(SourceInfo src, JsNameRef op1, JsExpression op2) { - return newAssignment(op1, op2).setSourceRef(src); - } - - public static JsExpression neq(SourceInfo src, JsExpression op1, JsExpression op2) { - return new JsBinaryOperation(JsBinaryOperator.NEQ, op1, op2).setSourceRef(src); - } - - public static JsExpression not(SourceInfo src, JsExpression op1) { - return new JsPrefixOperation(JsUnaryOperator.NOT, op1).setSourceRef(src); - } - - public static JsExpression preinc(SourceInfo src, JsExpression op1) { - return new JsPrefixOperation(JsUnaryOperator.INC, op1).setSourceRef(src); - } - - public static JsExpression and(SourceInfo src, JsExpression op1, JsExpression op2) { - return new JsBinaryOperation(JsBinaryOperator.AND, op1, op2).setSourceRef(src); - } - - public static JsExpression in(SourceInfo src, JsExpression propName, JsExpression obj) { - return new JsBinaryOperation(JsBinaryOperator.INOP, propName, obj).setSourceRef(src); - } - - - // Pavel Talanov - public static JsPropertyInitializer newNamedMethod(JsName name, JsFunction function) { - JsNameRef methodName = name.makeRef(); - return new JsPropertyInitializer(methodName, function); - } - - public static JsStatement convertToStatement(JsNode jsNode) { - assert (jsNode instanceof JsExpression) || (jsNode instanceof JsStatement) - : "Unexpected node of type: " + jsNode.getClass().toString(); - if (jsNode instanceof JsExpression) { - return new JsExprStmt((JsExpression) jsNode); - } - return (JsStatement) jsNode; - } - - public static JsBlock convertToBlock(JsNode jsNode) { - if (jsNode instanceof JsBlock) { - return (JsBlock) jsNode; - } - JsStatement jsStatement = convertToStatement(jsNode); - return new JsBlock(jsStatement); - } - - public static JsExpression convertToExpression(JsNode jsNode) { - assert jsNode instanceof JsExpression : "Unexpected node of type: " + jsNode.getClass().toString(); - return (JsExpression) jsNode; - } - - public static JsNameRef thisQualifiedReference(JsName name) { - JsNameRef result = name.makeRef(); - result.setQualifier(new JsThisRef()); - return result; - } - - public static JsBlock newBlock(List statements) { - JsBlock result = new JsBlock(); - result.setStatements(statements); - return result; - } - - public static JsPrefixOperation negated(JsExpression expression) { - return new JsPrefixOperation(JsUnaryOperator.NOT, expression); - } - - public static JsStatement newAssignmentStatement(JsNameRef nameRef, JsExpression expr) { - return convertToStatement(new JsBinaryOperation(JsBinaryOperator.ASG, nameRef, expr)); - } - - public static JsExpression extractExpressionFromStatement(JsStatement statement) { - assert statement instanceof JsExprStmt : "Cannot extract expression from statement: " + statement; - return (((JsExprStmt) statement).getExpression()); - } - - public static JsBinaryOperation and(JsExpression op1, JsExpression op2) { - return new JsBinaryOperation(JsBinaryOperator.AND, op1, op2); - } - - public static JsBinaryOperation or(JsExpression op1, JsExpression op2) { - return new JsBinaryOperation(JsBinaryOperator.OR, op1, op2); - } - - //TODO refactor - public static void setQualifier(JsExpression selector, JsExpression receiver) { - if (selector instanceof JsInvocation) { - setQualifier(((JsInvocation) selector).getQualifier(), receiver); - return; - } - if (selector instanceof JsNameRef) { - JsNameRef nameRef = (JsNameRef) selector; - JsExpression qualifier = nameRef.getQualifier(); - if (qualifier == null) { - nameRef.setQualifier(receiver); - } else { - setQualifier(qualifier, receiver); - } - return; - } - throw new AssertionError("Set qualifier should be applied only to JsInvocation or JsNameRef instances"); - } - - //TODO: look for should-be-usages - public static JsNameRef qualified(JsName selector, JsExpression qualifier) { - JsNameRef reference = selector.makeRef(); - AstUtil.setQualifier(reference, qualifier); - return reference; - } - - public static JsBinaryOperation equals(JsExpression arg1, JsExpression arg2) { - return new JsBinaryOperation(JsBinaryOperator.EQ, arg1, arg2); - } - - public static JsBinaryOperation notEqual(JsExpression arg1, JsExpression arg2) { - return new JsBinaryOperation(JsBinaryOperator.NEQ, arg1, arg2); - } - - public static JsExpression equalsTrue(JsExpression expression, JsProgram program) { - return equals(expression, program.getTrueLiteral()); - } - - public static JsExpression assignment(JsExpression left, JsExpression right) { - return new JsBinaryOperation(JsBinaryOperator.ASG, left, right); - } - - public static JsBinaryOperation sum(JsExpression left, JsExpression right) { - return new JsBinaryOperation(JsBinaryOperator.ADD, left, right); - } - - public static JsBinaryOperation subtract(JsExpression left, JsExpression right) { - return new JsBinaryOperation(JsBinaryOperator.SUB, left, right); - } - - public static JsPrefixOperation not(JsExpression expression) { - return new JsPrefixOperation(JsUnaryOperator.NOT, expression); - } - - public static JsBinaryOperation typeof(JsExpression expression, JsStringLiteral string) { - return equals(new JsPrefixOperation(JsUnaryOperator.TYPEOF, expression), string); - } - - public static interface Mutator { - public JsNode mutate(JsNode node); - } - - - //TODO: move somewhere - //TODO: refactor and review - public static JsNode mutateLastExpression(JsNode node, Mutator mutator) { - if (node instanceof JsBlock) { - JsBlock block = (JsBlock) node; - List statements = block.getStatements(); - - if (statements.isEmpty()) return block; - - int size = statements.size(); - statements.set(size - 1, - AstUtil.convertToStatement(mutateLastExpression(statements.get(size - 1), mutator))); - return block; - } - if (node instanceof JsIf) { - JsIf ifExpr = (JsIf) node; - ifExpr.setThenStmt(AstUtil.convertToStatement(mutateLastExpression(ifExpr.getThenStmt(), mutator))); - JsStatement elseStmt = ifExpr.getElseStmt(); - if (elseStmt != null) { - ifExpr.setElseStmt(AstUtil.convertToStatement(mutateLastExpression(elseStmt, mutator))); - } - return ifExpr; - } - if (node instanceof JsExprStmt) { - return AstUtil.convertToStatement(mutateLastExpression(((JsExprStmt) node).getExpression(), mutator)); - } - return mutator.mutate(node); - } - - - public static final class SaveLastExpressionMutator implements Mutator { - - @NotNull - private final JsExpression toAssign; - - public SaveLastExpressionMutator(@NotNull JsExpression toAssign) { - this.toAssign = toAssign; - } - - @Override - public JsNode mutate(JsNode node) { - if (!(node instanceof JsExpression)) { - return node; - } - return AstUtil.assignment(toAssign, (JsExpression) node); - } - } -} diff --git a/js.ast/src/com/google/dart/compiler/util/DefaultTextOutput.java b/js.ast/src/com/google/dart/compiler/util/DefaultTextOutput.java deleted file mode 100644 index 2a064ff87fd..00000000000 --- a/js.ast/src/com/google/dart/compiler/util/DefaultTextOutput.java +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.util; - -import java.io.PrintWriter; -import java.io.StringWriter; - -/** - * Adapts {@link TextOutput} to an internal text buffer. - */ -public class DefaultTextOutput extends AbstractTextOutput { - - private final StringWriter sw = new StringWriter(); - private final PrintWriter out; - - public DefaultTextOutput(boolean compact) { - super(compact); - setPrintWriter(out = new PrintWriter(sw)); - } - - @Override - public String toString() { - out.flush(); - if (sw != null) { - return sw.toString(); - } else { - return super.toString(); - } - } -} diff --git a/js.ast/src/com/google/dart/compiler/util/Hack.java b/js.ast/src/com/google/dart/compiler/util/Hack.java deleted file mode 100644 index 642f416394f..00000000000 --- a/js.ast/src/com/google/dart/compiler/util/Hack.java +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.util; - -/** - * Utility to hack around untypable (or yet to be) code. - */ -public class Hack { - public static T cast(Object o) { - @SuppressWarnings("unchecked") - T t = (T) o; - return t; - } -} diff --git a/js.ast/src/com/google/dart/compiler/util/Lists.java b/js.ast/src/com/google/dart/compiler/util/Lists.java deleted file mode 100644 index b0ca023d280..00000000000 --- a/js.ast/src/com/google/dart/compiler/util/Lists.java +++ /dev/null @@ -1,291 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.util; - -import java.util.*; - -/** - * Utility methods for operating on memory-efficient lists. All lists of size 0 - * or 1 are assumed to be immutable. All lists of size greater than 1 are - * assumed to be mutable. - */ -public class Lists { - - private static final Class MULTI_LIST_CLASS = ArrayList.class; - private static final Class SINGLETON_LIST_CLASS = Collections.singletonList(null).getClass(); - - public static List add(List list, int index, T toAdd) { - switch (list.size()) { - case 0: - // Empty -> Singleton - if (index != 0) { - throw newIndexOutOfBounds(list, index); - } - return Collections.singletonList(toAdd); - case 1: { - // Singleton -> ArrayList - List result = new ArrayList(2); - switch (index) { - case 0: - result.add(toAdd); - result.add(list.get(0)); - return result; - case 1: - result.add(list.get(0)); - result.add(toAdd); - return result; - default: - throw newIndexOutOfBounds(list, index); - } - } - default: - // ArrayList - list.add(index, toAdd); - return list; - } - } - - public static List add(List list, T toAdd) { - switch (list.size()) { - case 0: - // Empty -> Singleton - return Collections.singletonList(toAdd); - case 1: { - // Singleton -> ArrayList - List result = new ArrayList(2); - result.add(list.get(0)); - result.add(toAdd); - return result; - } - default: - // ArrayList - list.add(toAdd); - return list; - } - } - - public static List addAll(List list, int index, List toAdd) { - switch (toAdd.size()) { - case 0: - // No-op. - return list; - case 1: - // Add one element. - return add(list, index, toAdd.get(0)); - default: - // True list merge, result >= 2. - switch (list.size()) { - case 0: - if (index != 0) { - throw newIndexOutOfBounds(list, index); - } - return new ArrayList(toAdd); - case 1: { - List result = new ArrayList(1 + toAdd.size()); - switch (index) { - case 0: - result.addAll(toAdd); - result.add(list.get(0)); - return result; - case 1: - result.add(list.get(0)); - result.addAll(toAdd); - return result; - default: - throw newIndexOutOfBounds(list, index); - } - } - default: - list.addAll(index, toAdd); - return list; - } - } - } - - public static List addAll(List list, List toAdd) { - switch (toAdd.size()) { - case 0: - // No-op. - return list; - case 1: - // Add one element. - return add(list, toAdd.get(0)); - default: - // True list merge, result >= 2. - switch (list.size()) { - case 0: - return new ArrayList(toAdd); - case 1: { - List result = new ArrayList(1 + toAdd.size()); - result.add(list.get(0)); - result.addAll(toAdd); - return result; - } - default: - list.addAll(toAdd); - return list; - } - } - } - - public static List addAll(List list, T... toAdd) { - switch (toAdd.length) { - case 0: - // No-op. - return list; - case 1: - // Add one element. - return add(list, toAdd[0]); - default: - // True list merge, result >= 2. - switch (list.size()) { - case 0: - return new ArrayList(Arrays.asList(toAdd)); - case 1: { - List result = new ArrayList(1 + toAdd.length); - result.add(list.get(0)); - result.addAll(Arrays.asList(toAdd)); - return result; - } - default: - list.addAll(Arrays.asList(toAdd)); - return list; - } - } - } - - public static List create() { - return Collections.emptyList(); - } - - public static List create(Collection collection) { - switch (collection.size()) { - case 0: - return create(); - default: - return new ArrayList(collection); - } - } - - public static List create(List list) { - switch (list.size()) { - case 0: - return create(); - case 1: - return create(list.get(0)); - default: - return new ArrayList(list); - } - } - - public static List create(T item) { - return Collections.singletonList(item); - } - - public static List create(T... items) { - switch (items.length) { - case 0: - return create(); - case 1: - return create(items[0]); - default: - return new ArrayList(Arrays.asList(items)); - } - } - - public static List normalize(List list) { - switch (list.size()) { - case 0: - return create(); - case 1: { - if (list.getClass() == SINGLETON_LIST_CLASS) { - return list; - } - return create(list.get(0)); - } - default: - if (list.getClass() == MULTI_LIST_CLASS) { - return list; - } - return new ArrayList(list); - } - } - - public static List normalizeUnmodifiable(List list) { - if (list.size() < 2) { - return normalize(list); - } else { - List copy = new ArrayList(list.size()); - Collections.copy(copy, list); - return copy; - } - } - - public static List remove(List list, int toRemove) { - switch (list.size()) { - case 0: - // Empty - throw newIndexOutOfBounds(list, toRemove); - case 1: - // Singleton -> Empty - if (toRemove == 0) { - return Collections.emptyList(); - } else { - throw newIndexOutOfBounds(list, toRemove); - } - case 2: - // ArrayList -> Singleton - switch (toRemove) { - case 0: - return Collections.singletonList(list.get(1)); - case 1: - return Collections.singletonList(list.get(0)); - default: - throw newIndexOutOfBounds(list, toRemove); - } - default: - // ArrayList - list.remove(toRemove); - return list; - } - } - - public static List set(List list, int index, T e) { - switch (list.size()) { - case 0: - // Empty - throw newIndexOutOfBounds(list, index); - case 1: - // Singleton - if (index == 0) { - return Collections.singletonList(e); - } else { - throw newIndexOutOfBounds(list, index); - } - default: - // ArrayList - list.set(index, e); - return list; - } - } - - public static > List sort(List list) { - if (list.size() > 1) { - Collections.sort(list); - } - return list; - } - - public static List sort(List list, Comparator sort) { - if (list.size() > 1) { - Collections.sort(list, sort); - } - return list; - } - - private static IndexOutOfBoundsException newIndexOutOfBounds(List list, int index) { - return new IndexOutOfBoundsException("Index: " + index + ", Size: " + list.size()); - } -} diff --git a/js.ast/src/com/google/dart/compiler/util/Maps.java b/js.ast/src/com/google/dart/compiler/util/Maps.java deleted file mode 100644 index 15274b04902..00000000000 --- a/js.ast/src/com/google/dart/compiler/util/Maps.java +++ /dev/null @@ -1,160 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.util; - -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; - -/** - * Utility methods for operating on memory-efficient maps. All maps of size 0 or - * 1 are assumed to be immutable. All maps of size greater than 1 are assumed to - * be mutable. - */ -public class Maps { - - private static final Class MULTI_MAP_CLASS = HashMap.class; - private static final Class SINGLETON_MAP_CLASS = - Collections.singletonMap(null, null).getClass(); - - public static Map create() { - return Collections.emptyMap(); - } - - public static Map create(K key, V value) { - return Collections.singletonMap(key, value); - } - - public static Map normalize(Map map) { - switch (map.size()) { - case 0: - return create(); - case 1: { - if (map.getClass() == SINGLETON_MAP_CLASS) { - return map; - } - K key = map.keySet().iterator().next(); - return create(key, map.get(key)); - } - default: - if (map.getClass() == MULTI_MAP_CLASS) { - return map; - } - return new HashMap(map); - } - } - - public static Map normalizeUnmodifiable(Map map) { - if (map.size() < 2) { - return normalize(map); - } else { - // TODO: implement an UnmodifiableHashMap? - return Collections.unmodifiableMap(normalize(map)); - } - } - - public static Map put(Map map, K key, V value) { - switch (map.size()) { - case 0: - // Empty -> Singleton - return Collections.singletonMap(key, value); - case 1: { - if (map.containsKey(key)) { - return create(key, value); - } - // Singleton -> HashMap - Map result = new HashMap(); - result.put(map.keySet().iterator().next(), map.values().iterator().next()); - result.put(key, value); - return result; - } - default: - // HashMap - map.put(key, value); - return map; - } - } - - public static Map putAll(Map map, Map toAdd) { - switch (toAdd.size()) { - case 0: - // No-op. - return map; - case 1: { - // Add one element. - K key = toAdd.keySet().iterator().next(); - return put(map, key, toAdd.get(key)); - } - default: - // True list merge, result >= 2. - switch (map.size()) { - case 0: - return new HashMap(toAdd); - case 1: { - HashMap result = new HashMap(); - K key = map.keySet().iterator().next(); - result.put(key, map.get(key)); - result.putAll(toAdd); - return result; - } - default: - map.putAll(toAdd); - return map; - } - } - } - - /** - * A variation of the put method which uses a LinkedHashMap. - */ - public static Map putOrdered(Map map, K key, V value) { - switch (map.size()) { - case 0: - // Empty -> Singleton - return Collections.singletonMap(key, value); - case 1: { - if (map.containsKey(key)) { - return create(key, value); - } - // Singleton -> LinkedHashMap - Map result = new LinkedHashMap(); - result.put(map.keySet().iterator().next(), map.values().iterator().next()); - result.put(key, value); - return result; - } - default: - // LinkedHashMap - map.put(key, value); - return map; - } - } - - public static Map remove(Map map, K key) { - switch (map.size()) { - case 0: - // Empty - return map; - case 1: - // Singleton -> Empty - if (map.containsKey(key)) { - return create(); - } - return map; - case 2: - // HashMap -> Singleton - if (map.containsKey(key)) { - map.remove(key); - key = map.keySet().iterator().next(); - return create(key, map.get(key)); - } - return map; - default: - // IdentityHashMap - map.remove(key); - return map; - } - } -} diff --git a/js.ast/src/com/google/dart/compiler/util/Paths.java b/js.ast/src/com/google/dart/compiler/util/Paths.java deleted file mode 100644 index cdda910ccb1..00000000000 --- a/js.ast/src/com/google/dart/compiler/util/Paths.java +++ /dev/null @@ -1,100 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.util; - -import java.io.File; -import java.net.URI; -import java.util.ArrayList; -import java.util.List; - -/** - * Utility methods for obtaining relative paths from files and translating - * relative paths into files. - */ -public class Paths { - - /** - * Answer the relative path from baseFile to relFile - * - * @param baseFile the base file (not null) from which the - * desired path starts - * @param relFile the file referenced by the desired relative path (not - * null) - * @return a relative path (not null) - */ - public static String relativePathFor(File baseFile, File relFile) { - String baseFilePath = baseFile.getPath().replace(File.separatorChar, '/'); - String relFilePath = relFile.getPath().replace(File.separatorChar, '/'); - int baseFilePathLen = baseFilePath.length(); - int relFilePathLen = relFilePath.length(); - - // Find the com.google.dart.compiler.backend.common path elements - int index = 0; - while (index < baseFilePathLen - 1 && index < relFilePathLen - 1) { - if (baseFilePath.charAt(index) != relFilePath.charAt(index)) { - break; - } - index++; - } - while (index >= 0 - && (baseFilePath.charAt(index) != '/' || relFilePath.charAt(index) != '/')) { - index--; - } - int commonStart = index; - - // Build a path up from the base file - StringBuilder relPath = new StringBuilder(baseFilePathLen + relFilePathLen - - commonStart * 2); - index = commonStart + 1; - while (true) { - index = baseFilePath.indexOf('/', index); - if (index == -1) { - break; - } - relPath.append("../"); - index++; - } - relPath.append(relFilePath.substring(commonStart + 1)); - return relPath.toString(); - } - - /** - * Answer the file relative to the specified file - * - * @param baseFile the base file (not null) - * @param relPath the path to the desired file relative to baseFile - * @return the file (not null) - */ - public static File relativePathToFile(File baseFile, String relPath) { - if (relPath.startsWith("/")) { - return new File(relPath); - } - File parentFile = baseFile.getParentFile(); - String name; - if (parentFile == null) { - name = "."; - } else { - name = parentFile.getPath().replace(File.separatorChar, '/'); - } - name = URI.create(name + "/" + relPath).normalize().getPath(); - return new File(name); - } - - /** - * Given a collection of paths, return a collection of files - * - * @param a collection of paths to various files (not null, - * contains no nulls) - * @return a collection of files (not null, contains no - * nulls) - */ - public static List toFiles(List filePaths) { - List files = new ArrayList(); - for (String path : filePaths) { - files.add(new File(path)); - } - return files; - } -} diff --git a/js.ast/src/com/google/dart/compiler/util/TextOutput.java b/js.ast/src/com/google/dart/compiler/util/TextOutput.java deleted file mode 100644 index 99a465b1532..00000000000 --- a/js.ast/src/com/google/dart/compiler/util/TextOutput.java +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -package com.google.dart.compiler.util; - -/** - * Interface used for printing text output. - */ -public interface TextOutput { - - int getPosition(); - - int getLine(); - - int getColumn(); - - void indentIn(); - - void indentOut(); - - void newline(); - - void newlineOpt(); - - void print(char c); - - void print(char[] s); - - void print(String s); - - void printOpt(char c); - - void printOpt(char[] s); - - void printOpt(String s); -} diff --git a/js.backend/js.backend.iml b/js.backend/js.backend.iml deleted file mode 100644 index 6333c03551e..00000000000 --- a/js.backend/js.backend.iml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/js.backend/src/org/jetbrains/k2js/analyze/Analyzer.java b/js.backend/src/org/jetbrains/k2js/analyze/Analyzer.java deleted file mode 100644 index d0aba16b5a6..00000000000 --- a/js.backend/src/org/jetbrains/k2js/analyze/Analyzer.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.analyze; - -import com.google.common.base.Predicate; -import com.intellij.openapi.project.Project; -import com.intellij.psi.PsiFile; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.Configuration; -import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.psi.JetPsiFactory; -import org.jetbrains.jet.lang.resolve.*; -import org.jetbrains.jet.lang.resolve.scopes.WritableScope; -import org.jetbrains.k2js.config.Config; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class Analyzer { - - private Analyzer() { - } - - @NotNull - public static BindingContext analyzeFilesAndCheckErrors(@NotNull List files, - @NotNull Config config) { - BindingContext bindingContext = analyzeFiles(files, config); - checkForErrors(withJsLibAdded(files, config), bindingContext); - return bindingContext; - } - - @NotNull - public static BindingContext analyzeFiles(@NotNull List files, - @NotNull Config config) { - Project project = config.getProject(); - return AnalyzingUtils.analyzeFiles(project, - JsConfiguration.jsLibConfiguration(project), - withJsLibAdded(files, config), - notLibFiles(config.getLibFiles()), - JetControlFlowDataTraceFactory.EMPTY); - } - - private static void checkForErrors(@NotNull List allFiles, @NotNull BindingContext bindingContext) { - AnalyzingUtils.throwExceptionOnErrors(bindingContext); - for (JetFile file : allFiles) { - AnalyzingUtils.checkForSyntacticErrors(file); - } - } - - //TODO: use some mechanism to avoid this - //TODO: move method somewhere - @NotNull - public static List withJsLibAdded(@NotNull List files, @NotNull Config config) { - List allFiles = new ArrayList(); - allFiles.addAll(files); - allFiles.addAll(config.getLibFiles()); - return allFiles; - } - - @NotNull - private static Predicate notLibFiles(@NotNull final List jsLibFiles) { - return new Predicate() { - @Override - public boolean apply(@Nullable PsiFile file) { - assert file instanceof JetFile; - @SuppressWarnings("UnnecessaryLocalVariable") boolean notLibFile = !jsLibFiles.contains(file); - return notLibFile; - } - }; - } - - private static final class JsConfiguration implements Configuration { - - @NotNull - private Project project; - - public static JsConfiguration jsLibConfiguration(@NotNull Project project) { - return new JsConfiguration(project); - } - - private JsConfiguration(@NotNull Project project) { - this.project = project; - } - - @Override - public void addDefaultImports(@NotNull BindingTrace trace, @NotNull WritableScope rootScope, - @NotNull Importer importer) { - ImportsResolver.ImportResolver importResolver = new ImportsResolver.ImportResolver(trace, true); - importResolver.processImportReference(JetPsiFactory.createImportDirective(project, "js.*"), rootScope, importer); - } - - @Override - public void extendNamespaceScope(@NotNull BindingTrace trace, @NotNull NamespaceDescriptor namespaceDescriptor, - @NotNull WritableScope namespaceMemberScope) { - } - } -} diff --git a/js.backend/src/org/jetbrains/k2js/config/Config.java b/js.backend/src/org/jetbrains/k2js/config/Config.java deleted file mode 100644 index 9bef13e1220..00000000000 --- a/js.backend/src/org/jetbrains/k2js/config/Config.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.config; - -import com.intellij.openapi.project.Project; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetFile; - -import java.util.List; - -/** - * @author Pavel Talanov - *

- * Base class reprenting a configuration of translator. - */ -public abstract class Config { - - @NotNull - public abstract Project getProject(); - - @NotNull - public abstract List getLibFiles(); - -} diff --git a/js.backend/src/org/jetbrains/k2js/config/IDEAConfig.java b/js.backend/src/org/jetbrains/k2js/config/IDEAConfig.java deleted file mode 100644 index b421601c274..00000000000 --- a/js.backend/src/org/jetbrains/k2js/config/IDEAConfig.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.config; - -import com.intellij.openapi.project.Project; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetFile; - -import java.util.Collections; -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class IDEAConfig extends Config { - - @NotNull - private final Project project; - - public IDEAConfig(@NotNull Project project) { - this.project = project; - } - - @NotNull - @Override - public Project getProject() { - return project; - } - - @NotNull - @Override - public List getLibFiles() { - return Collections.emptyList(); - } -} diff --git a/js.backend/src/org/jetbrains/k2js/config/TestConfig.java b/js.backend/src/org/jetbrains/k2js/config/TestConfig.java deleted file mode 100644 index 68a91518455..00000000000 --- a/js.backend/src/org/jetbrains/k2js/config/TestConfig.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.config; - -import com.intellij.openapi.Disposable; -import com.intellij.openapi.project.Project; -import core.Dummy; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.compiler.JetCoreEnvironment; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.k2js.utils.JetFileUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.Reader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * @author Pavel Talanov - */ -//TODO: review/refactor -public final class TestConfig extends Config { - - //TODO: provide some generic way to get the files of the project - @NotNull - private static final List LIB_FILE_NAMES = Arrays.asList( - "/core/annotations.kt", - "/jquery/common.kt", - "/jquery/ui.kt", - "/core/javautil.kt", - "/core/javalang.kt", - "/core/core.kt", - "/core/math.kt", - "/core/json.kt", - "/raphael/raphael.kt", - "/html5/canvas.kt", - "/html5/files.kt", - "/html5/image.kt" - ); - - @NotNull - private static JetCoreEnvironment getTestEnvironment() { - if (testOnlyEnvironment == null) { - testOnlyEnvironment = new JetCoreEnvironment(new Disposable() { - @Override - public void dispose() { - } - }); - } - return testOnlyEnvironment; - } - - @Nullable - private static /*var*/ JetCoreEnvironment testOnlyEnvironment = null; - - - @Nullable - private /*var*/ List jsLibFiles = null; - - public TestConfig() { - } - - @NotNull - @Override - public Project getProject() { - return getTestEnvironment().getProject(); - } - - @NotNull - private static List initLibFiles(@NotNull Project project) { - List libFiles = new ArrayList(); - for (String libFileName : LIB_FILE_NAMES) { - JetFile file = null; - //TODO: close stream? - InputStream stream = Dummy.class.getResourceAsStream(libFileName); - try { - String text = readString(stream); - file = JetFileUtils.createPsiFile(libFileName, text, project); - } catch (IOException e) { - e.printStackTrace(); - } - libFiles.add(file); - } - return libFiles; - } - - @NotNull - public List getLibFiles() { - if (jsLibFiles == null) { - jsLibFiles = initLibFiles(getProject()); - } - return jsLibFiles; - } - - @NotNull - private static String readString(@NotNull InputStream is) throws IOException { - char[] buf = new char[2048]; - Reader r = new InputStreamReader(is, "UTF-8"); - StringBuilder s = new StringBuilder(); - while (true) { - int n = r.read(buf); - if (n < 0) - break; - s.append(buf, 0, n); - } - return s.toString(); - } -} diff --git a/js.backend/src/org/jetbrains/k2js/facade/K2JSTranslator.java b/js.backend/src/org/jetbrains/k2js/facade/K2JSTranslator.java deleted file mode 100644 index 86b330ea218..00000000000 --- a/js.backend/src/org/jetbrains/k2js/facade/K2JSTranslator.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.facade; - -import com.google.dart.compiler.backend.js.ast.JsProgram; -import com.intellij.openapi.project.Project; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.types.JetStandardLibrary; -import org.jetbrains.jet.plugin.JetMainDetector; -import org.jetbrains.k2js.analyze.Analyzer; -import org.jetbrains.k2js.config.Config; -import org.jetbrains.k2js.config.IDEAConfig; -import org.jetbrains.k2js.config.TestConfig; -import org.jetbrains.k2js.generate.CodeGenerator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.utils.GenerationUtils; -import org.jetbrains.k2js.utils.JetFileUtils; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.util.*; - -import static org.jetbrains.k2js.translate.utils.PsiUtils.getNamespaceName; -import static org.jetbrains.k2js.utils.JetFileUtils.createPsiFileList; - -//TODO: clean up the code - -/** - * @author Pavel Talanov - *

- * An entry point of translator. - */ -public final class K2JSTranslator { - - public static void translateWithCallToMainAndSaveToFile(@NotNull List files, - @NotNull String outputPath, - @NotNull Project project) throws Exception { - K2JSTranslator translator = new K2JSTranslator(new IDEAConfig(project)); - String programCode = translator.generateProgramCode(files) + "\n"; - JetFile fileWithMain = JetMainDetector.getFileWithMain(files); - if (fileWithMain == null) { - throw new RuntimeException("No file with main detected."); - } - String callToMain = translator.generateCallToMain(fileWithMain, ""); - FileWriter writer = new FileWriter(new File(outputPath)); - writer.write(programCode + callToMain); - writer.close(); - } - - public static void testTranslateFile(@NotNull String inputFile, - @NotNull String outputFile) throws Exception { - testTranslateFiles(Collections.singletonList(inputFile), outputFile); - } - - public static void testTranslateFiles(@NotNull List inputFiles, - @NotNull String outputFile) throws Exception { - K2JSTranslator translator = new K2JSTranslator(new TestConfig()); - List psiFiles = createPsiFileList(inputFiles, translator.getProject()); - JsProgram program = translator.generateProgram(psiFiles); - saveProgramToFile(outputFile, program); - } - - private static void saveProgramToFile(@NotNull String outputFile, @NotNull JsProgram program) throws IOException { - CodeGenerator generator = new CodeGenerator(); - generator.generateToFile(program, new File(outputFile)); - } - - @NotNull - private Config config; - - - public K2JSTranslator(@NotNull Config config) { - this.config = config; - } - - //TODO: refactor - @NotNull - public String translateStringWithCallToMain(@NotNull String programText, @NotNull String argumentsString) { - JetFile file = JetFileUtils.createPsiFile("test", programText, getProject()); - String programCode = generateProgramCode(file) + "\n"; - String flushOutput = "Kotlin.System.flush();\n"; - String callToMain = generateCallToMain(file, argumentsString); - String programOutput = "Kotlin.System.output();\n"; - return programCode + flushOutput + callToMain + programOutput; - } - - @NotNull - private String generateProgramCode(@NotNull JetFile psiFile) { - JsProgram program = generateProgram(Arrays.asList(psiFile)); - CodeGenerator generator = new CodeGenerator(); - return generator.generateToString(program); - } - - @NotNull - private String generateProgramCode(@NotNull List files) { - JsProgram program = generateProgram(files); - CodeGenerator generator = new CodeGenerator(); - return generator.generateToString(program); - } - - @NotNull - public BindingContext analyzeProgramCode(@NotNull String programText) { - JetFile file = JetFileUtils.createPsiFile("test", programText, getProject()); - return Analyzer.analyzeFiles(Arrays.asList(file), config); - } - - - @NotNull - private JsProgram generateProgram(@NotNull List filesToTranslate) { - JetStandardLibrary.initialize(config.getProject()); - BindingContext bindingContext = Analyzer.analyzeFilesAndCheckErrors(filesToTranslate, config); - return Translation.generateAst(bindingContext, Analyzer.withJsLibAdded(filesToTranslate, config)); - } - - - @NotNull - public String generateCallToMain(@NotNull JetFile file, @NotNull String argumentString) { - String namespaceName = getNamespaceName(file); - List arguments = parseString(argumentString); - return GenerationUtils.generateCallToMain(namespaceName, arguments); - } - - @NotNull - private List parseString(@NotNull String argumentString) { - List result = new ArrayList(); - StringTokenizer stringTokenizer = new StringTokenizer(argumentString); - while (stringTokenizer.hasMoreTokens()) { - result.add(stringTokenizer.nextToken()); - } - return result; - } - - @NotNull - private Project getProject() { - return config.getProject(); - } - -} diff --git a/js.backend/src/org/jetbrains/k2js/facade/K2JSTranslatorUtils.java b/js.backend/src/org/jetbrains/k2js/facade/K2JSTranslatorUtils.java deleted file mode 100644 index 8fafffc52ff..00000000000 --- a/js.backend/src/org/jetbrains/k2js/facade/K2JSTranslatorUtils.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.facade; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.k2js.config.TestConfig; - -/** - * Created by IntelliJ IDEA. - * User: Natalia.Ukhorskaya - * Date: 2/9/12 - * Time: 7:49 PM - */ - -public class K2JSTranslatorUtils { - @SuppressWarnings("FieldCanBeLocal") - private static String EXCEPTION = "exception="; - - @Nullable - public String translateToJS(@NotNull String code, @NotNull String arguments) { - try { - return generateJSCode(code, arguments); - } catch (AssertionError e) { - reportException(e); - return EXCEPTION + "Translation error."; - } catch (UnsupportedOperationException e) { - reportException(e); - return EXCEPTION + "Unsupported feature."; - } catch (Throwable e) { - reportException(e); - return EXCEPTION + "Unexpected exception."; - } - } - - @Nullable - public BindingContext getBindingContext(@NotNull String programText) { - try { - K2JSTranslator k2JSTranslator = new K2JSTranslator(new TestConfig()); - return k2JSTranslator.analyzeProgramCode(programText); - } catch (Throwable e) { - e.printStackTrace(); - reportException(e); - return null; - } - } - - @NotNull - private String generateJSCode(@NotNull String code, @NotNull String arguments) { - String generatedCode = (new K2JSTranslator(new TestConfig())).translateStringWithCallToMain(code, arguments); - return generatedCode; - } - - private void reportException(@NotNull Throwable e) { - System.out.println("Exception in translateToJS!!!"); - e.printStackTrace(); - } -} diff --git a/js.backend/src/org/jetbrains/k2js/generate/CodeGenerator.java b/js.backend/src/org/jetbrains/k2js/generate/CodeGenerator.java deleted file mode 100644 index ecb5d30b2c0..00000000000 --- a/js.backend/src/org/jetbrains/k2js/generate/CodeGenerator.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.generate; - -import com.google.dart.compiler.backend.js.JsSourceGenerationVisitor; -import com.google.dart.compiler.backend.js.ast.JsProgram; -import com.google.dart.compiler.util.DefaultTextOutput; -import com.google.dart.compiler.util.TextOutput; -import org.jetbrains.annotations.NotNull; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -/** - * @author Pavel.Talanov - */ -public final class CodeGenerator { - - @NotNull - private final TextOutput output = new DefaultTextOutput(false); - - public CodeGenerator() { - } - - public void generateToFile(@NotNull JsProgram program, @NotNull File file) throws IOException { - generateCode(program); - FileWriter writer = new FileWriter(file); - writer.write(output.toString()); - writer.close(); - } - - @NotNull - public String generateToString(@NotNull JsProgram program) { - generateCode(program); - return output.toString(); - } - - private void generateCode(@NotNull JsProgram program) { - JsSourceGenerationVisitor sourceGenerator = - new JsSourceGenerationVisitor(output); - program.traverse(sourceGenerator, null); - } -} diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/Aliaser.java b/js.backend/src/org/jetbrains/k2js/translate/context/Aliaser.java deleted file mode 100644 index f77a65a7e0d..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/Aliaser.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context; - -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; - -import java.util.HashMap; -import java.util.Map; -import java.util.Stack; - -public class Aliaser { - - public static Aliaser newInstance() { - return new Aliaser(); - } - - @NotNull - private final Map aliasesForDescriptors = new HashMap(); - @NotNull - private final Map> aliasesForThis - = new HashMap>(); - - private Aliaser() { - } - - @NotNull - public JsNameRef getAliasForThis(@NotNull DeclarationDescriptor descriptor) { - Stack aliasStack = aliasesForThis.get(descriptor.getOriginal()); - assert !aliasStack.empty(); - JsName aliasName = aliasStack.peek(); - assert aliasName != null : "This " + descriptor.getOriginal() + " doesn't have an alias."; - return aliasName.makeRef(); - } - - public void setAliasForThis(@NotNull DeclarationDescriptor descriptor, @NotNull JsName alias) { - Stack aliasStack = aliasesForThis.get(descriptor.getOriginal()); - if (aliasStack == null) { - aliasStack = new Stack(); - aliasesForThis.put(descriptor, aliasStack); - } - aliasStack.push(alias); - } - - public void removeAliasForThis(@NotNull DeclarationDescriptor descriptor) { - Stack aliasStack = aliasesForThis.get(descriptor.getOriginal()); - assert !aliasStack.empty(); - aliasStack.pop(); - if (aliasStack.empty()) { - aliasesForThis.put(descriptor, null); - } - } - - public boolean hasAliasForThis(@NotNull DeclarationDescriptor descriptor) { - Stack aliasStack = aliasesForThis.get(descriptor.getOriginal()); - if (aliasStack == null) { - return false; - } - return (!aliasStack.empty()); - } - - @NotNull - public JsName getAliasForDeclaration(@NotNull DeclarationDescriptor declaration) { - JsName alias = aliasesForDescriptors.get(declaration.getOriginal()); - assert alias != null : "Use has alias for declaration to check."; - return alias; - } - - public void setAliasForDescriptor(@NotNull DeclarationDescriptor declaration, @NotNull JsName alias) { - assert (!hasAliasForDeclaration(declaration.getOriginal())) : "This declaration already has an alias!"; - aliasesForDescriptors.put(declaration.getOriginal(), alias); - } - - public void removeAliasForDescriptor(@NotNull DeclarationDescriptor declaration) { - assert (hasAliasForDeclaration(declaration.getOriginal())) : "This declaration does not has an alias!"; - aliasesForDescriptors.remove(declaration.getOriginal()); - } - - public boolean hasAliasForDeclaration(@NotNull DeclarationDescriptor declaration) { - return aliasesForDescriptors.containsKey(declaration.getOriginal()); - } - - -} \ No newline at end of file diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/DynamicContext.java b/js.backend/src/org/jetbrains/k2js/translate/context/DynamicContext.java deleted file mode 100644 index 7e09549fdb9..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/DynamicContext.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; - -public class DynamicContext { - - @NotNull - public static DynamicContext rootContext(@NotNull NamingScope rootScope, @NotNull JsBlock globalBlock) { - return new DynamicContext(rootScope, rootScope, globalBlock); - } - - @NotNull - public static DynamicContext contextWithScope(@NotNull NamingScope scope) { - return new DynamicContext(scope, scope, new JsBlock()); - } - - //TODO: current/block scope logic unclear. is it necessary? - @NotNull - private NamingScope currentScope; - - @NotNull - private NamingScope blockScope; - - @NotNull - private JsBlock currentBlock; - - private DynamicContext(@NotNull NamingScope scope, @NotNull NamingScope blockScope, @NotNull JsBlock block) { - this.currentScope = scope; - this.currentBlock = block; - this.blockScope = blockScope; - } - - @NotNull - public DynamicContext innerScope(@NotNull JsScope scope) { - return new DynamicContext(currentScope.innerScope(scope), blockScope, currentBlock); - } - - @NotNull - public NamingScope getScope() { - return blockScope; - } - - @NotNull - public DynamicContext innerBlock(@NotNull JsBlock block) { - return new DynamicContext(currentScope, currentScope, block); - } - - @NotNull - public TemporaryVariable declareTemporary(@NotNull JsExpression initExpression) { - JsName temporaryName = blockScope.declareTemporary(); - JsVars temporaryDeclaration = AstUtil.newVar(temporaryName, null); - jsBlock().addVarDeclaration(temporaryDeclaration); - return new TemporaryVariable(temporaryName, initExpression); - } - - - @NotNull - public JsScope jsScope() { - return currentScope.jsScope(); - } - - @NotNull - public JsBlock jsBlock() { - return currentBlock; - } -} \ No newline at end of file diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/Namer.java b/js.backend/src/org/jetbrains/k2js/translate/context/Namer.java deleted file mode 100644 index c92af4d1bac..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/Namer.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context; - -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.backend.js.ast.JsScope; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; - -/** - * @author Pavel Talanov - *

- * Encapuslates different types of constants and naming conventions. - */ -public final class Namer { - - private static final String INITIALIZE_METHOD_NAME = "initialize"; - private static final String CLASS_OBJECT_NAME = "Class"; - private static final String TRAIT_OBJECT_NAME = "Trait"; - private static final String NAMESPACE_OBJECT_NAME = "Namespace"; - private static final String OBJECT_OBJECT_NAME = "object"; - private static final String SETTER_PREFIX = "set_"; - private static final String GETTER_PREFIX = "get_"; - private static final String BACKING_FIELD_PREFIX = "$"; - private static final String SUPER_METHOD_NAME = "super_init"; - private static final String KOTLIN_OBJECT_NAME = "Kotlin"; - private static final String ANONYMOUS_NAMESPACE = "Anonymous"; - private static final String RECEIVER_PARAMETER_NAME = "receiver"; - - @NotNull - public static String getReceiverParameterName() { - return RECEIVER_PARAMETER_NAME; - } - - @NotNull - public static String getAnonymousNamespaceName() { - return ANONYMOUS_NAMESPACE; - } - - @NotNull - public static JsNameRef initializeMethodReference() { - return AstUtil.newQualifiedNameRef(INITIALIZE_METHOD_NAME); - } - - @NotNull - public static String superMethodName() { - return SUPER_METHOD_NAME; - } - - @NotNull - public static String nameForClassesVariable() { - return "classes"; - } - - @NotNull - public static String getNameForAccessor(@NotNull String propertyName, boolean isGetter) { - if (isGetter) { - return getNameForGetter(propertyName); - } else { - return getNameForSetter(propertyName); - } - } - - public static String getKotlinBackingFieldName(String propertyName) { - return getNameWithPrefix(propertyName, BACKING_FIELD_PREFIX); - } - - public static String getNameForGetter(String propertyName) { - return getNameWithPrefix(propertyName, GETTER_PREFIX); - } - - public static String getNameForSetter(String propertyName) { - return getNameWithPrefix(propertyName, SETTER_PREFIX); - } - - private static String getNameWithPrefix(String name, String prefix) { - return prefix + name; - } - - public static Namer newInstance(@NotNull JsScope rootScope) { - return new Namer(rootScope); - } - - @NotNull - private final JsName kotlinName; - @NotNull - private final JsScope kotlinScope; - @NotNull - private final JsName className; - @NotNull - private final JsName traitName; - @NotNull - private final JsName namespaceName; - @NotNull - private final JsName objectName; - - private Namer(@NotNull JsScope rootScope) { - kotlinName = rootScope.declareName(KOTLIN_OBJECT_NAME); - kotlinScope = new JsScope(rootScope, "Kotlin standard object"); - traitName = kotlinScope.declareName(TRAIT_OBJECT_NAME); - namespaceName = kotlinScope.declareName(NAMESPACE_OBJECT_NAME); - className = kotlinScope.declareName(CLASS_OBJECT_NAME); - objectName = kotlinScope.declareName(OBJECT_OBJECT_NAME); - } - - @NotNull - public JsNameRef classCreationMethodReference() { - return kotlin(createMethodReference(className)); - } - - @NotNull - public JsNameRef traitCreationMethodReference() { - return kotlin(createMethodReference(traitName)); - } - - @NotNull - public JsNameRef namespaceCreationMethodReference() { - return kotlin(createMethodReference(namespaceName)); - } - - @NotNull - public JsNameRef objectCreationMethodReference() { - return kotlin(createMethodReference(objectName)); - } - - @NotNull - private JsNameRef createMethodReference(@NotNull JsName name) { - JsNameRef qualifier = name.makeRef(); - JsNameRef reference = AstUtil.newQualifiedNameRef("create"); - AstUtil.setQualifier(reference, qualifier); - return reference; - } - - @NotNull - private JsNameRef kotlin(@NotNull JsNameRef reference) { - JsNameRef kotlinReference = kotlinName.makeRef(); - AstUtil.setQualifier(reference, kotlinReference); - return reference; - } - - @NotNull - public JsNameRef kotlinObject() { - return kotlinName.makeRef(); - } - - @NotNull - public JsNameRef isOperationReference() { - return kotlin(AstUtil.newQualifiedNameRef("isType")); - } - - @NotNull - /*package*/ JsScope getKotlinScope() { - return kotlinScope; - } -} diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/NamingScope.java b/js.backend/src/org/jetbrains/k2js/translate/context/NamingScope.java deleted file mode 100644 index 650f0ffb5b1..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/NamingScope.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context; - -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsScope; -import org.jetbrains.annotations.NotNull; - -/** - * @author Pavel Talanov - *

- * Basically a wrapper around JsScope. - */ -public final class NamingScope { - - @NotNull - public static NamingScope rootScope(@NotNull JsScope rootScope) { - return new NamingScope(rootScope); - } - - @NotNull - private final JsScope scope; - - private NamingScope(@NotNull JsScope correspondingScope) { - this.scope = correspondingScope; - } - - @NotNull - public NamingScope innerScope(@NotNull String scopeName) { - JsScope innerJsScope = new JsScope(jsScope(), scopeName); - return new NamingScope(innerJsScope); - } - - @NotNull - public NamingScope innerScope(@NotNull JsScope correspondingScope) { - return new NamingScope(correspondingScope); - } - - @NotNull - /*package*/ JsName declareUnobfuscatableName(@NotNull String name) { - JsName declaredName = scope.declareName(name); - declaredName.setObfuscatable(false); - return declaredName; - } - - @NotNull - /*package*/ JsName declareObfuscatableName(@NotNull String name) { - return scope.declareName(mayBeObfuscateName(name, true)); - } - - //TODO: temporary solution - @NotNull - private String mayBeObfuscateName(@NotNull String name, boolean shouldObfuscate) { - if (!shouldObfuscate) { - return name; - } - return doObfuscate(name); - } - - @NotNull - private String doObfuscate(@NotNull String name) { - int obfuscate = 0; - String result = name; - while (true) { - JsName existingNameWithSameIdent = scope.findExistingName(result); - boolean isDuplicate = (existingNameWithSameIdent != null) && (scope.ownsName(existingNameWithSameIdent)); - - if (!isDuplicate) break; - - result = name + "$" + obfuscate; - obfuscate++; - } - return result; - } - - public JsName declareTemporary() { - return scope.declareTemporary(); - } - - @NotNull - public JsScope jsScope() { - return scope; - } -} diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/StandardClasses.java b/js.backend/src/org/jetbrains/k2js/translate/context/StandardClasses.java deleted file mode 100644 index b1d0e5e8fef..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/StandardClasses.java +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context; - -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsScope; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; - -import java.util.HashMap; -import java.util.Map; - -import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getFQName; - -/** - * @author Pavel Talanov - *

- * Provides a mechanism to bind some of the kotlin/java declations with library implementations. - * Makes sense only for those declaration that cannot be annotated. (Use library annotation in this case) - */ -public final class StandardClasses { - - private final class Builder { - - @Nullable - private /*var*/ String currentFQName = null; - @Nullable - private /*var*/ String currentObjectName = null; - - @NotNull - public Builder forFQ(@NotNull String classFQName) { - currentFQName = classFQName; - return this; - } - - @NotNull - public Builder kotlinClass(@NotNull String kotlinName) { - kotlinTopLevelObject(kotlinName); - constructor(); - return this; - } - - private void kotlinTopLevelObject(@NotNull String kotlinName) { - assert currentFQName != null; - currentObjectName = kotlinName; - declareKotlinObject(currentFQName, kotlinName); - } - - @NotNull - public Builder kotlinFunction(@NotNull String kotlinName) { - kotlinTopLevelObject(kotlinName); - return this; - } - - @NotNull - private Builder constructor() { - assert currentFQName != null; - assert currentObjectName != null; - declareInner(currentFQName, "", currentObjectName); - return this; - } - - @NotNull - public Builder methods(@NotNull String... methodNames) { - assert currentFQName != null; - declareMethods(currentFQName, methodNames); - return this; - } - - @NotNull - public Builder properties(@NotNull String... propertyNames) { - assert currentFQName != null; - declareReadonlyProperties(currentFQName, propertyNames); - return this; - } - } - - @NotNull - public static StandardClasses bindImplementations(@NotNull JsScope kotlinObjectScope) { - StandardClasses standardClasses = new StandardClasses(kotlinObjectScope); - declareJetObjects(standardClasses); - return standardClasses; - } - - private static void declareJetObjects(@NotNull StandardClasses standardClasses) { - - standardClasses.declare().forFQ("jet.Iterator").kotlinClass("ArrayIteratorIntrinsic") - .methods("next").properties("hasNext"); - - standardClasses.declare().forFQ("jet.IntRange").kotlinClass("NumberRange") - .methods("iterator", "contains").properties("start", "size", "end", "reversed"); - - standardClasses.declare().forFQ("jet.sure").kotlinFunction("sure"); - - standardClasses.declare().forFQ("jet.Any.toString").kotlinFunction("toString"); - - standardClasses.declare().forFQ("java.util.Collections..max").kotlinFunction("collectionsMax"); - } - - - @NotNull - private final JsScope kotlinScope; - - - @NotNull - private final Map standardObjects = new HashMap(); - - @NotNull - private final Map scopeMap = new HashMap(); - - private StandardClasses(@NotNull JsScope kotlinScope) { - this.kotlinScope = kotlinScope; - } - - private void declareTopLevelObjectInScope(@NotNull JsScope scope, @NotNull Map map, - @NotNull String fullQualifiedName, @NotNull String name) { - JsName declaredName = scope.declareName(name); - declaredName.setObfuscatable(false); - map.put(fullQualifiedName, declaredName); - scopeMap.put(fullQualifiedName, new JsScope(scope, "scope for " + name)); - } - - private void declareKotlinObject(@NotNull String fullQualifiedName, @NotNull String kotlinLibName) { - declareTopLevelObjectInScope(kotlinScope, standardObjects, fullQualifiedName, kotlinLibName); - } - - private void declareInner(@NotNull String fullQualifiedClassName, - @NotNull String shortMethodName, - @NotNull String javascriptName) { - JsScope classScope = scopeMap.get(fullQualifiedClassName); - assert classScope != null; - String fullQualifiedMethodName = fullQualifiedClassName + "." + shortMethodName; - JsName declaredName = classScope.declareName(javascriptName); - declaredName.setObfuscatable(false); - standardObjects.put(fullQualifiedMethodName, declaredName); - } - - private void declareMethods(@NotNull String classFQName, - @NotNull String... methodNames) { - for (String methodName : methodNames) { - declareInner(classFQName, methodName, methodName); - } - } - - private void declareReadonlyProperties(@NotNull String classFQName, - @NotNull String... propertyNames) { - for (String propertyName : propertyNames) { - declareInner(classFQName, propertyName, propertyName); - } - } - - public boolean isStandardObject(@NotNull DeclarationDescriptor descriptor) { - return standardObjects.containsKey(getFQName(descriptor)); - } - - @NotNull - public JsName getStandardObjectName(@NotNull DeclarationDescriptor descriptor) { - return standardObjects.get(getFQName(descriptor)); - } - - @NotNull - private Builder declare() { - return new Builder(); - } -} diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/StaticContext.java b/js.backend/src/org/jetbrains/k2js/translate/context/StaticContext.java deleted file mode 100644 index 32a0065efb2..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/StaticContext.java +++ /dev/null @@ -1,478 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context; - -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.backend.js.ast.JsProgram; -import com.google.dart.compiler.backend.js.ast.JsRootScope; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.types.JetStandardLibrary; -import org.jetbrains.k2js.translate.context.generator.Generator; -import org.jetbrains.k2js.translate.context.generator.Rule; -import org.jetbrains.k2js.translate.intrinsic.Intrinsics; -import org.jetbrains.k2js.translate.utils.AnnotationsUtils; - -import java.util.Set; - -import static org.jetbrains.k2js.translate.utils.AnnotationsUtils.*; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.*; - -/** - * @author Pavel Talanov - *

- * Aggregates all the static parts of the context. - */ -public final class StaticContext { - - public static StaticContext generateStaticContext(@NotNull JetStandardLibrary library, - @NotNull BindingContext bindingContext) { - JsProgram program = new JsProgram("main"); - JsRootScope jsRootScope = program.getRootScope(); - Namer namer = Namer.newInstance(jsRootScope); - Aliaser aliaser = Aliaser.newInstance(); - NamingScope scope = NamingScope.rootScope(jsRootScope); - Intrinsics intrinsics = Intrinsics.standardLibraryIntrinsics(library); - StandardClasses standardClasses = - StandardClasses.bindImplementations(namer.getKotlinScope()); - return new StaticContext(program, bindingContext, aliaser, - namer, intrinsics, standardClasses, scope); - } - - @NotNull - private final JsProgram program; - - @NotNull - private final BindingContext bindingContext; - - @NotNull - private final Aliaser aliaser; - - @NotNull - private final Namer namer; - - @NotNull - private final Intrinsics intrinsics; - - @NotNull - private final StandardClasses standardClasses; - - @NotNull - private final NamingScope rootScope; - - @NotNull - private final Generator names = new NameGenerator(); - @NotNull - private final Generator scopes = new ScopeGenerator(); - @NotNull - private final Generator qualifiers = new QualifierGenerator(); - @NotNull - private final Generator qualifierIsNull = new QualifierIsNullGenerator(); - - - //TODO: too many parameters in constructor - private StaticContext(@NotNull JsProgram program, @NotNull BindingContext bindingContext, - @NotNull Aliaser aliaser, - @NotNull Namer namer, @NotNull Intrinsics intrinsics, - @NotNull StandardClasses standardClasses, @NotNull NamingScope rootScope) { - this.program = program; - this.bindingContext = bindingContext; - this.aliaser = aliaser; - this.namer = namer; - this.intrinsics = intrinsics; - this.rootScope = rootScope; - this.standardClasses = standardClasses; - } - - @NotNull - public JsProgram getProgram() { - return program; - } - - @NotNull - public BindingContext getBindingContext() { - return bindingContext; - } - - @NotNull - public Aliaser getAliaser() { - return aliaser; - } - - @NotNull - public Intrinsics getIntrinsics() { - return intrinsics; - } - - @NotNull - public Namer getNamer() { - return namer; - } - - @NotNull - public NamingScope getRootScope() { - return rootScope; - } - - @NotNull - public StandardClasses getStandardClasses() { - return standardClasses; - } - - @NotNull - public NamingScope getScopeForDescriptor(@NotNull DeclarationDescriptor descriptor) { - NamingScope namingScope = scopes.get(descriptor); - assert namingScope != null : "Must have a scope for descriptor"; - return namingScope; - } - - @NotNull - public JsName getNameForDescriptor(@NotNull DeclarationDescriptor descriptor) { - JsName name = names.get(descriptor.getOriginal()); - assert name != null : "Must have name for descriptor"; - return name; - } - - private final class NameGenerator extends Generator { - public NameGenerator() { - Rule namesForStandardClasses = new Rule() { - @Override - @Nullable - public JsName apply(@NotNull DeclarationDescriptor data) { - if (!standardClasses.isStandardObject(data)) { - return null; - } - return standardClasses.getStandardObjectName(data); - } - }; - Rule namespacesShouldBeDefinedInRootScope = new Rule() { - @Override - @Nullable - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof NamespaceDescriptor)) { - return null; - } - String nameForNamespace = getNameForNamespace((NamespaceDescriptor) descriptor); - return getRootScope().declareUnobfuscatableName(nameForNamespace); - } - }; - Rule memberDeclarationsInsideParentsScope = new Rule() { - @Override - @Nullable - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - NamingScope namingScope = getEnclosingScope(descriptor); - return namingScope.declareObfuscatableName(descriptor.getName()); - } - }; - Rule constructorHasTheSameNameAsTheClass = new Rule() { - @Override - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof ConstructorDescriptor)) { - return null; - } - ClassDescriptor containingClass = getContainingClass(descriptor); - assert containingClass != null : "Can't have constructor without a class"; - return getNameForDescriptor(containingClass); - } - }; - Rule accessorsHasNamesWithSpecialPrefixes = new Rule() { - @Override - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof PropertyAccessorDescriptor)) { - return null; - } - boolean isGetter = descriptor instanceof PropertyGetterDescriptor; - String propertyName = ((PropertyAccessorDescriptor) descriptor).getCorrespondingProperty().getName(); - String accessorName = Namer.getNameForAccessor(propertyName, isGetter); - NamingScope enclosingScope = getEnclosingScope(descriptor); - return enclosingScope.declareObfuscatableName(accessorName); - } - }; - - Rule namesAnnotatedAsLibraryHasUnobfuscatableNames = new Rule() { - @Override - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - //TODO: refactor - String name = null; - AnnotationDescriptor annotation = getAnnotationByName(descriptor, LIBRARY_ANNOTATION_FQNAME); - if (annotation != null) { - name = AnnotationsUtils.getAnnotationStringParameter(descriptor, LIBRARY_ANNOTATION_FQNAME); - name = (!name.isEmpty()) ? name : descriptor.getName(); - } else { - ClassDescriptor containingClass = getContainingClass(descriptor); - if (containingClass == null) return null; - if (getAnnotationByName(containingClass, LIBRARY_ANNOTATION_FQNAME) != null) { - name = descriptor.getName(); - } - } - if (name != null) { - return getEnclosingScope(descriptor).declareUnobfuscatableName(name); - } - return null; - } - }; - Rule propertiesCorrespondToSpeciallyTreatedBackingFieldNames = new Rule() { - @Override - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof PropertyDescriptor)) { - return null; - } - NamingScope enclosingScope = getEnclosingScope(descriptor); - return enclosingScope.declareObfuscatableName(Namer.getKotlinBackingFieldName(descriptor.getName())); - } - }; - //TODO: hack! - Rule toStringHack = new Rule() { - @Override - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof FunctionDescriptor)) { - return null; - } - if (!descriptor.getName().equals("toString")) { - return null; - } - if (((FunctionDescriptor) descriptor).getValueParameters().isEmpty()) { - return getEnclosingScope(descriptor).declareUnobfuscatableName("toString"); - } - return null; - } - - }; - Rule namesForNativeObjectsAreUnobfuscatable = new Rule() { - @Override - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - String name = null; - AnnotationDescriptor annotation = getAnnotationByName(descriptor, NATIVE_ANNOTATION_FQNAME); - if (annotation != null) { - name = AnnotationsUtils.getAnnotationStringParameter(descriptor, NATIVE_ANNOTATION_FQNAME); - name = (!name.isEmpty()) ? name : descriptor.getName(); - } else { - ClassDescriptor containingClass = getContainingClass(descriptor); - if (containingClass == null) return null; - if (getAnnotationByName(containingClass, NATIVE_ANNOTATION_FQNAME) != null) { - name = descriptor.getName(); - } - } - if (name != null) { - return getEnclosingScope(descriptor).declareUnobfuscatableName(name); - } - return null; - - } - }; - Rule overridingDescriptorsReferToOriginalName = new Rule() { - @Override - public JsName apply(@NotNull DeclarationDescriptor descriptor) { - //TODO: refactor - if (descriptor instanceof FunctionDescriptor) { - Set overriddenDescriptors = ((FunctionDescriptor) descriptor).getOverriddenDescriptors(); - if (overriddenDescriptors.isEmpty()) { - return null; - } else { - //assert overriddenDescriptors.size() == 1; - //TODO: for now translator can't deal with multiple inheritance good enough - for (FunctionDescriptor overriddenDescriptor : overriddenDescriptors) { - return getNameForDescriptor(overriddenDescriptor); - } - } - } - return null; - } - }; - addRule(namesForStandardClasses); - addRule(constructorHasTheSameNameAsTheClass); - addRule(namesAnnotatedAsLibraryHasUnobfuscatableNames); - addRule(namesForNativeObjectsAreUnobfuscatable); - addRule(toStringHack); - addRule(propertiesCorrespondToSpeciallyTreatedBackingFieldNames); - addRule(namespacesShouldBeDefinedInRootScope); - addRule(accessorsHasNamesWithSpecialPrefixes); - addRule(overridingDescriptorsReferToOriginalName); - addRule(memberDeclarationsInsideParentsScope); - } - } - - private NamingScope getEnclosingScope(@NotNull DeclarationDescriptor descriptor) { - DeclarationDescriptor containingDeclaration = getContainingDeclaration(descriptor); - return getScopeForDescriptor(containingDeclaration.getOriginal()); - } - - - private final class ScopeGenerator extends Generator { - - public ScopeGenerator() { - Rule generateNewScopesForClassesWithNoAncestors = new Rule() { - @Override - public NamingScope apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof ClassDescriptor)) { - return null; - } - if (getSuperclass((ClassDescriptor) descriptor) == null) { - return getRootScope().innerScope("Scope for class " + descriptor.getName()); - } - return null; - } - }; - Rule generateInnerScopesForDerivedClasses = new Rule() { - @Override - public NamingScope apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof ClassDescriptor)) { - return null; - } - ClassDescriptor superclass = getSuperclass((ClassDescriptor) descriptor); - if (superclass == null) { - return null; - } - return getScopeForDescriptor(superclass).innerScope("Scope for class " + descriptor.getName()); - } - }; - Rule generateNewScopesForNamespaceDescriptors = new Rule() { - @Override - public NamingScope apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof NamespaceDescriptor)) { - return null; - } - return getRootScope().innerScope("Namespace " + descriptor.getName()); - } - }; - Rule generateInnerScopesForMembers = new Rule() { - @Override - public NamingScope apply(@NotNull DeclarationDescriptor descriptor) { - NamingScope enclosingScope = getEnclosingScope(descriptor); - return enclosingScope.innerScope("Scope for member " + descriptor.getName()); - } - }; - addRule(generateNewScopesForClassesWithNoAncestors); - addRule(generateInnerScopesForDerivedClasses); - addRule(generateNewScopesForNamespaceDescriptors); - addRule(generateInnerScopesForMembers); - } - } - - @Nullable - public JsNameRef getQualifierForDescriptor(@NotNull DeclarationDescriptor descriptor) { - if (qualifierIsNull.get(descriptor) != null) { - return null; - } - return qualifiers.get(descriptor.getOriginal()); - } - - private final class QualifierGenerator extends Generator { - public QualifierGenerator() { - Rule namespacesHaveNoQualifiers = new Rule() { - @Override - public JsNameRef apply(@NotNull DeclarationDescriptor descriptor) { - if (!standardClasses.isStandardObject(descriptor)) { - return null; - } - return namer.kotlinObject(); - } - }; - Rule namespaceLevelDeclarationsHaveEnclosingNamespacesNamesAsQualifier = new Rule() { - @Override - public JsNameRef apply(@NotNull DeclarationDescriptor descriptor) { - DeclarationDescriptor containingDeclaration = getContainingDeclaration(descriptor); - if (!(containingDeclaration instanceof NamespaceDescriptor)) { - return null; - } - JsName containingDeclarationName = getNameForDescriptor(containingDeclaration); - return containingDeclarationName.makeRef(); - } - }; - Rule constructorHaveTheSameQualifierAsTheClass = new Rule() { - @Override - public JsNameRef apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof ConstructorDescriptor)) { - return null; - } - ClassDescriptor containingClass = getContainingClass(descriptor); - assert containingClass != null : "Can't have constructor without a class"; - return getQualifierForDescriptor(containingClass); - } - }; - Rule libraryObjectsHaveKotlinQualifier = new Rule() { - - @Override - public JsNameRef apply(@NotNull DeclarationDescriptor descriptor) { - if (getAnnotationByName(descriptor, AnnotationsUtils.LIBRARY_ANNOTATION_FQNAME) != null) { - return namer.kotlinObject(); - } - return null; - } - }; - Rule membersOfAnnotatedClassesHaveKotlinQualifier = new Rule() { - @Override - public JsNameRef apply(@NotNull DeclarationDescriptor descriptor) { - ClassDescriptor containingClass = getContainingClass(descriptor); - if (containingClass == null) { - return null; - } - if (getAnnotationByName(descriptor, LIBRARY_ANNOTATION_FQNAME) != null) { - return namer.kotlinObject(); - } - return null; - } - }; - addRule(libraryObjectsHaveKotlinQualifier); - addRule(membersOfAnnotatedClassesHaveKotlinQualifier); - addRule(constructorHaveTheSameQualifierAsTheClass); - addRule(namespacesHaveNoQualifiers); - addRule(namespaceLevelDeclarationsHaveEnclosingNamespacesNamesAsQualifier); - } - } - - private class QualifierIsNullGenerator extends Generator { - - private QualifierIsNullGenerator() { - Rule propertiesHaveNoQualifiers = new Rule() { - @Override - public Boolean apply(@NotNull DeclarationDescriptor descriptor) { - if (!(descriptor instanceof PropertyDescriptor)) { - return null; - } - return true; - } - }; - Rule variableAsFunctionsHaveNoQualifiers = new Rule() { - @Override - public Boolean apply(@NotNull DeclarationDescriptor descriptor) { - if (!isVariableAsFunction(descriptor)) { - return null; - } - return true; - } - }; - //TODO: hack! - Rule nativeObjectsHaveNoQualifiers = new Rule() { - @Override - public Boolean apply(@NotNull DeclarationDescriptor descriptor) { - if (!AnnotationsUtils.isNativeObject(descriptor)) { - return null; - } - return true; - } - }; - addRule(propertiesHaveNoQualifiers); - addRule(variableAsFunctionsHaveNoQualifiers); - addRule(nativeObjectsHaveNoQualifiers); - } - } -} \ No newline at end of file diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/TemporaryVariable.java b/js.backend/src/org/jetbrains/k2js/translate/context/TemporaryVariable.java deleted file mode 100644 index 265d2653d7b..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/TemporaryVariable.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; - -/** - * @author Pavel Talanov - */ -public final class TemporaryVariable { - - @NotNull - private final JsExpression assignmentExpression; - @NotNull - private final JsName variableName; - - /*package*/ TemporaryVariable(@NotNull JsName temporaryName, @NotNull JsExpression initExpression) { - this.variableName = temporaryName; - this.assignmentExpression = AstUtil.newAssignment(variableName.makeRef(), initExpression); - } - - @NotNull - public JsNameRef reference() { - return variableName.makeRef(); - } - - @NotNull - public JsName name() { - return variableName; - } - - @NotNull - public JsExpression assignmentExpression() { - return assignmentExpression; - } -} \ No newline at end of file diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/generator/Generator.java b/js.backend/src/org/jetbrains/k2js/translate/context/generator/Generator.java deleted file mode 100644 index 720e3a8d7e1..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/generator/Generator.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context.generator; - -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; - -import java.util.List; -import java.util.Map; - -/** - * @author Pavel Talanov - */ -public class Generator { - - - @NotNull - private final Map values = Maps.newHashMap(); - @NotNull - private final List> rules = Lists.newArrayList(); - - public void addRule(@NotNull Rule rule) { - rules.add(rule); - } - - @Nullable - public V get(@NotNull DeclarationDescriptor descriptor) { - V result = values.get(descriptor); - if (result != null) { - return result; - } - result = generate(descriptor); - values.put(descriptor, result); - return result; - } - - @Nullable - private V generate(@NotNull DeclarationDescriptor descriptor) { - V result = null; - for (Rule rule : rules) { - result = rule.apply(descriptor); - if (result != null) { - return result; - } - } - return result; - } -} diff --git a/js.backend/src/org/jetbrains/k2js/translate/context/generator/Rule.java b/js.backend/src/org/jetbrains/k2js/translate/context/generator/Rule.java deleted file mode 100644 index e3550578ef5..00000000000 --- a/js.backend/src/org/jetbrains/k2js/translate/context/generator/Rule.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context.generator; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; - -/** - * @author Pavel Talanov - */ -public interface Rule { - - @Nullable - V apply(@NotNull DeclarationDescriptor descriptor); -} diff --git a/js.backend/translator.iml b/js.backend/translator.iml deleted file mode 100644 index 169033213b3..00000000000 --- a/js.backend/translator.iml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/js.examples/js.examples.iml b/js.examples/js.examples.iml deleted file mode 100644 index dd784a152e2..00000000000 --- a/js.examples/js.examples.iml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/js.examples/src/html5/creatures/creatures.js b/js.examples/src/html5/creatures/creatures.js deleted file mode 100644 index a83e29d65ad..00000000000 --- a/js.examples/src/html5/creatures/creatures.js +++ /dev/null @@ -1,545 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function () { - var Vector = Kotlin.Class.create({initialize:function (x, y) { - this.$x = x; - this.$y = y; - }, get_x:function () { - return this.$x; - }, get_y:function () { - return this.$y; - }, plus:function (v) { - { - return creatures.v_0(this.get_x() + v.get_x(), this.get_y() + v.get_y()); - } - }, minus:function () { - { - return creatures.v_0(-this.get_x(), -this.get_y()); - } - }, minus$0:function (v) { - { - return creatures.v_0(this.get_x() - v.get_x(), this.get_y() - v.get_y()); - } - }, times:function (koef) { - { - return creatures.v_0(this.get_x() * koef, this.get_y() * koef); - } - }, distanceTo:function (v) { - { - return Math.sqrt(this.minus$0(v).get_sqr()); - } - }, rotatedBy:function (theta) { - { - var sin = Math.sin(theta); - var cos = Math.cos(theta); - return creatures.v_0(this.get_x() * cos - this.get_y() * sin, this.get_x() * sin + this.get_y() * cos); - } - }, isInRect:function (topLeft, size) { - { - return this.get_x() >= topLeft.get_x() && this.get_x() <= topLeft.get_x() + size.get_x() && this.get_y() >= topLeft.get_y() && this.get_y() <= topLeft.get_y() + size.get_y(); - } - }, get_sqr:function () { - { - return this.get_x() * this.get_x() + this.get_y() * this.get_y(); - } - }, get_normalized:function () { - { - return this.times(1 / Math.sqrt(this.get_sqr())); - } - } - }); - var RadialGradientGenerator = Kotlin.Class.create({initialize:function (context) { - this.$context = context; - this.$gradients = new Kotlin.ArrayList; - this.$current = 0; - { - this.newColorStops([ - [0, '#F59898'], - [0.5, '#F57373'], - [1, '#DB6B6B'] - ]); - this.newColorStops([ - [0.39, 'rgb(140,167,209)'], - [0.7, 'rgb(104,139,209)'], - [0.85, 'rgb(67,122,217)'] - ]); - this.newColorStops([ - [0, 'rgb(255,222,255)'], - [0.5, 'rgb(255,185,222)'], - [1, 'rgb(230,154,185)'] - ]); - this.newColorStops([ - [0, 'rgb(255,209,114)'], - [0.5, 'rgb(255,174,81)'], - [1, 'rgb(241,145,54)'] - ]); - this.newColorStops([ - [0, 'rgb(132,240,135)'], - [0.5, 'rgb(91,240,96)'], - [1, 'rgb(27,245,41)'] - ]); - this.newColorStops([ - [0, 'rgb(250,147,250)'], - [0.5, 'rgb(255,80,255)'], - [1, 'rgb(250,0,217)'] - ]); - } - }, get_context:function () { - return this.$context; - }, get_gradients:function () { - return this.$gradients; - }, get_current:function () { - return this.$current; - }, set_current:function (tmp$0) { - this.$current = tmp$0; - }, newColorStops:function (colorStops) { - { - this.get_gradients().add(colorStops); - } - }, getNext:function () { - { - var result = this.get_gradients().get(this.get_current()); - this.set_current((this.get_current() + 1) % this.get_gradients().size()); - return result; - } - } - }); - var CanvasState = Kotlin.Class.create({initialize:function (canvas) { - this.$canvas = canvas; - this.$width = this.get_canvas().width; - this.$height = this.get_canvas().height; - this.$context = getContext(); - this.$valid = false; - this.$shapes = new Kotlin.ArrayList; - this.$selection = null; - this.$dragOff = new creatures.Vector_0(0, 0); - this.$interval = 1000 / 30; - { - var tmp$4; - var tmp$3; - var tmp$2; - var tmp$1; - var tmp$0_0; - $(this.get_canvas()).mousedown((tmp$0_0 = this , function (it) { - { - var tmp$0; - tmp$0_0.set_valid(false); - tmp$0_0.set_selection(null); - var mousePos = tmp$0_0.mousePos_0(it); - { - tmp$0 = tmp$0_0.get_shapes().iterator(); - while (tmp$0.hasNext()) { - var shape = tmp$0.next(); - { - if (shape.contains(mousePos)) { - tmp$0_0.set_dragOff(mousePos.minus$0(shape.get_pos())); - shape.set_selected(true); - tmp$0_0.set_selection(shape); - break; - } - } - } - } - } - } - )); - $(this.get_canvas()).mousemove((tmp$1 = this , function (it) { - { - if (tmp$1.get_selection() != null) { - Kotlin.sure(tmp$1.get_selection()).set_pos(tmp$1.mousePos_0(it).minus$0(tmp$1.get_dragOff())); - tmp$1.set_valid(false); - } - } - } - )); - $(this.get_canvas()).mouseup((tmp$2 = this , function (it) { - { - if (tmp$2.get_selection() != null) { - Kotlin.sure(tmp$2.get_selection()).set_selected(false); - } - tmp$2.set_selection(null); - tmp$2.set_valid(false); - } - } - )); - $(this.get_canvas()).dblclick((tmp$3 = this , function (it) { - { - var newCreature = new creatures.Creature_0(tmp$3.mousePos_0(it), tmp$3); - tmp$3.addShape(newCreature); - tmp$3.set_valid(false); - } - } - )); - setInterval((tmp$4 = this , function () { - { - tmp$4.draw(); - } - } - ), this.get_interval()); - } - }, get_canvas:function () { - return this.$canvas; - }, get_width:function () { - return this.$width; - }, set_width:function (tmp$0) { - this.$width = tmp$0; - }, get_height:function () { - return this.$height; - }, set_height:function (tmp$0) { - this.$height = tmp$0; - }, get_size:function () { - { - return creatures.v_0(this.get_width(), this.get_height()); - } - }, get_context:function () { - return this.$context; - }, get_valid:function () { - return this.$valid; - }, set_valid:function (tmp$0) { - this.$valid = tmp$0; - }, get_shapes:function () { - return this.$shapes; - }, set_shapes:function (tmp$0) { - this.$shapes = tmp$0; - }, get_selection:function () { - return this.$selection; - }, set_selection:function (tmp$0) { - this.$selection = tmp$0; - }, get_dragOff:function () { - return this.$dragOff; - }, set_dragOff:function (tmp$0) { - this.$dragOff = tmp$0; - }, get_interval:function () { - return this.$interval; - }, mousePos_0:function (e) { - { - var offset = new creatures.Vector_0(0, 0); - var element = this.get_canvas(); - while (element != null) { - var el = Kotlin.sure(element); - offset = offset.plus(new creatures.Vector_0(el.offsetLeft, el.offsetTop)); - element = el.offsetParent; - } - return (new creatures.Vector_0(e.pageX, e.pageY)).minus$0(offset); - } - }, addShape:function (shape) { - { - this.get_shapes().add(shape); - this.set_valid(false); - } - }, clear:function () { - { - this.get_context().fillStyle = '#FFFFFF'; - this.get_context().fillRect(0, 0, this.get_width(), this.get_height()); - this.get_context().strokeStyle = '#000000'; - this.get_context().lineWidth = 4; - this.get_context().strokeRect(0, 0, this.get_width(), this.get_height()); - } - }, draw:function () { - { - var tmp$0; - if (this.get_valid()) - return; - this.clear(); - { - tmp$0 = creatures.reversed(this.get_shapes()).iterator(); - while (tmp$0.hasNext()) { - var shape = tmp$0.next(); - { - shape.draw(this); - } - } - } - creatures.get_Kotlin().draw(this); - this.set_valid(true); - } - } - }); - var Shape = Kotlin.Class.create({initialize:function () { - this.$selected = false; - }, draw:function (state) { - }, contains:function (mousePos) { - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_selected:function () { - return this.$selected; - }, set_selected:function (tmp$0) { - this.$selected = tmp$0; - }, shadowed:function (receiver, shadowOffset, alpha, render) { - { - receiver.save(); - receiver.shadowColor = 'rgba(100, 100, 100, ' + alpha + ')'; - receiver.shadowBlur = 5; - receiver.shadowOffsetX = shadowOffset.get_x(); - receiver.shadowOffsetY = shadowOffset.get_y(); - render.call(receiver); - receiver.restore(); - } - }, fillPath:function (receiver, constructPath) { - { - receiver.beginPath(); - constructPath.call(receiver); - receiver.closePath(); - receiver.fill(); - } - } - }); - var Creature = Kotlin.Class.create(Shape, {initialize:function (pos, state) { - this.$pos = pos; - this.$state = state; - this.super_init(); - this.$shadowOffset = creatures.v_0(-5, 5); - this.$colorStops = creatures.get_gradientGenerator().getNext(); - this.$relSize = 0.05; - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_state:function () { - return this.$state; - }, get_shadowOffset:function () { - return this.$shadowOffset; - }, get_colorStops:function () { - return this.$colorStops; - }, get_relSize:function () { - return this.$relSize; - }, get_radius:function () { - { - return this.get_state().get_width() * this.get_relSize(); - } - }, get_position:function () { - var tmp$0; - if (this.get_selected()) - tmp$0 = this.get_pos().minus$0(this.get_shadowOffset()); - else - tmp$0 = this.get_pos(); - { - return tmp$0; - } - }, get_directionToLogo:function () { - { - return creatures.get_Kotlin().get_centre().minus$0(this.get_position()).get_normalized(); - } - }, contains:function (mousePos) { - { - return this.get_pos().distanceTo(mousePos) < this.get_radius(); - } - }, circlePath:function (receiver, position, rad) { - { - receiver.arc(position.get_x(), position.get_y(), rad, 0, 2 * Math.PI, false); - } - }, fillCircle:function (receiver, position, rad) { - { - var tmp$0; - this.fillPath(receiver, (tmp$0 = this , function () { - { - tmp$0.circlePath(receiver, position, rad); - } - } - )); - } - }, draw:function (state) { - { - var context = state.get_context(); - if (!this.get_selected()) { - this.drawCreature(context); - } - else { - this.drawCreatureWithShadow(context); - } - } - }, drawCreature:function (context) { - { - var tmp$0; - context.fillStyle = this.getGradient(context); - this.fillPath(context, (tmp$0 = this , function () { - { - tmp$0.tailPath(context); - tmp$0.circlePath(this, tmp$0.get_position(), tmp$0.get_radius()); - } - } - )); - this.drawEye(context); - } - }, getGradient:function (context) { - { - var tmp$0; - var gradientCentre = this.get_position().plus(this.get_directionToLogo().times(this.get_radius() / 4)); - var gradient = context.createRadialGradient(gradientCentre.get_x(), gradientCentre.get_y(), 1, gradientCentre.get_x(), gradientCentre.get_y(), 2 * this.get_radius()); - { - tmp$0 = Kotlin.arrayIterator(this.get_colorStops()); - while (tmp$0.hasNext()) { - var colorStop = tmp$0.next(); - { - gradient.addColorStop(colorStop[0], colorStop[1]); - } - } - } - return gradient; - } - }, tailPath:function (context) { - { - var tailDirection = this.get_directionToLogo().minus(); - var tailPos = this.get_position().plus(tailDirection.times(this.get_radius()).times(1)); - var tailSize = this.get_radius() * 1.6; - var angle = Math.PI / 6; - var p1 = tailPos.plus(tailDirection.rotatedBy(angle).times(tailSize)); - var p2 = tailPos.plus(tailDirection.rotatedBy(-angle).times(tailSize)); - var middlePoint = this.get_position().plus(tailDirection.times(this.get_radius()).times(1)); - context.moveTo(tailPos.get_x(), tailPos.get_y()); - context.lineTo(p1.get_x(), p1.get_y()); - context.quadraticCurveTo(middlePoint.get_x(), middlePoint.get_y(), p2.get_x(), p2.get_y()); - context.lineTo(tailPos.get_x(), tailPos.get_y()); - } - }, drawEye:function (context) { - { - var eyePos = this.get_directionToLogo().times(this.get_radius()).times(0.6).plus(this.get_position()); - var eyeRadius = this.get_radius() / 3; - var eyeLidRadius = eyeRadius / 2; - context.fillStyle = '#FFFFFF'; - this.fillCircle(context, eyePos, eyeRadius); - context.fillStyle = '#000000'; - this.fillCircle(context, eyePos, eyeLidRadius); - } - }, drawCreatureWithShadow:function (context) { - { - var tmp$0_0; - this.shadowed(context, this.get_shadowOffset(), 0.7, (tmp$0_0 = this , function () { - { - var tmp$0; - context.fillStyle = tmp$0_0.getGradient(context); - tmp$0_0.fillPath(this, (tmp$0 = tmp$0_0 , function () { - { - tmp$0.tailPath(context); - tmp$0.circlePath(context, tmp$0.get_position(), tmp$0.get_radius()); - } - } - )); - } - } - )); - this.drawEye(context); - } - } - }); - var Logo = Kotlin.Class.create(Shape, {initialize:function (pos) { - this.$pos = pos; - this.super_init(); - this.$relSize = 0.25; - this.$shadowOffset = creatures.v_0(-3, 3); - this.$imageSize = creatures.v_0(377, 393); - this.$size = this.get_imageSize().times(this.get_relSize()); - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_relSize:function () { - return this.$relSize; - }, get_shadowOffset:function () { - return this.$shadowOffset; - }, get_imageSize:function () { - return this.$imageSize; - }, get_size:function () { - return this.$size; - }, set_size:function (tmp$0) { - this.$size = tmp$0; - }, get_position:function () { - var tmp$0; - if (this.get_selected()) - tmp$0 = this.get_pos().minus$0(this.get_shadowOffset()); - else - tmp$0 = this.get_pos(); - { - return tmp$0; - } - }, drawLogo:function (state) { - { - this.set_size(this.get_imageSize().times(state.get_size().get_x() / this.get_imageSize().get_x()).times(this.get_relSize())); - state.get_context().drawImage(getKotlinLogo(), 0, 0, this.get_imageSize().get_x(), this.get_imageSize().get_y(), this.get_position().get_x(), this.get_position().get_y(), this.get_size().get_x(), this.get_size().get_y()); - } - }, draw:function (state) { - { - var context = state.get_context(); - if (this.get_selected()) { - var tmp$0; - this.shadowed(context, this.get_shadowOffset(), 0.2, (tmp$0 = this , function () { - { - tmp$0.drawLogo(state); - } - } - )); - } - else { - this.drawLogo(state); - } - } - }, contains:function (mousePos) { - { - return mousePos.isInRect(this.get_pos(), this.get_size()); - } - }, get_centre:function () { - { - return this.get_pos().plus(this.get_size().times(0.5)); - } - } - }); - return {Shape_0:Shape, Logo_0:Logo, Creature_0:Creature, RadialGradientGenerator_0:RadialGradientGenerator, CanvasState_0:CanvasState, Vector_0:Vector}; - } - (); - var creatures = Kotlin.Namespace.create({initialize:function () { - creatures.$Kotlin = new creatures.Logo_0(creatures.v_0(300, 100)); - creatures.$gradientGenerator = new creatures.RadialGradientGenerator_0(getContext()); - }, get_Kotlin:function () { - return creatures.$Kotlin; - }, get_gradientGenerator:function () { - return creatures.$gradientGenerator; - }, v_0:function (x, y) { - { - return new creatures.Vector_0(x, y); - } - }, main:function () { - { - var state = new creatures.CanvasState_0(getCanvas()); - state.addShape(creatures.get_Kotlin()); - state.addShape(new creatures.Creature_0(state.get_size().times(0.25), state)); - state.addShape(new creatures.Creature_0(state.get_size().times(0.75), state)); - setTimeout(function () { - { - state.set_valid(false); - } - } - ); - } - }, reversed:function (receiver) { - { - var result = new Kotlin.ArrayList; - var i = receiver.size(); - while (i > 0) { - result.add(receiver.get(--i)); - } - return result; - } - } - }, classes); - creatures.initialize(); -} - -var args = []; -creatures.main(args); diff --git a/js.examples/src/html5/creatures/kotlinlogo.png b/js.examples/src/html5/creatures/kotlinlogo.png deleted file mode 100644 index 5394223b3d6..00000000000 Binary files a/js.examples/src/html5/creatures/kotlinlogo.png and /dev/null differ diff --git a/js.examples/src/html5/creatures/main.kt b/js.examples/src/html5/creatures/main.kt deleted file mode 100644 index 46e0d92b8c2..00000000000 --- a/js.examples/src/html5/creatures/main.kt +++ /dev/null @@ -1,331 +0,0 @@ -/* -In this example strange creatures are watching the kotlin logo. You can drag'n'drop them as well as the logo. -Doubleclick to add more creatures but be careful. They may be watching you! -*/ -package creatures -// importing some of the API defined -import jquery.* -import html5.* -import java.util.ArrayList -import js.* -import js.Math -import js.setInterval -import html5.getCanvas -import html5.getKotlinLogo -import jquery.jq -import js.setTimeout -import java.util.List - - -abstract class Shape() { - - abstract fun draw(state : CanvasState) - // these two abstract methods defines that our shapes can be dragged - abstract fun contains(mousePos : Vector) : Boolean - abstract var pos : Vector - - var selected : Boolean = false - - // a couple of helper extension methods we'll be using in the derived classes - fun Context.shadowed(shadowOffset : Vector, alpha : Double, render : Context.() -> Unit) { - save() - shadowColor = "rgba(100, 100, 100, $alpha)" - shadowBlur = 5.0 - shadowOffsetX = shadowOffset.x - shadowOffsetY = shadowOffset.y - render() - restore() - } - - fun Context.fillPath(constructPath : Context.() -> Unit) { - beginPath() - constructPath() - closePath() - fill() - } -} - -val Kotlin = Logo(v(300.0, 100.0)) - -class Logo(override var pos : Vector) : Shape() -{ - val relSize : Double = 0.25 - val shadowOffset = v(-3.0, 3.0) - val imageSize = v(377.0, 393.0) - var size : Vector = imageSize * relSize - // get-only properties like this saves you lots of typing and are very expressive - val position : Vector - get() = if (selected) pos - shadowOffset else pos - - - fun drawLogo(state : CanvasState) { - size = imageSize * (state.size.x / imageSize.x) * relSize - // getKotlinLogo() is a 'magic' function here defined only for purposes of demonstration but in fact it just find an element containing the logo - state.context.drawImage(getKotlinLogo(), 0.0, 0.0, imageSize.x, imageSize.y, position.x, position.y, size.x, size.y) - } - - override fun draw(state : CanvasState) { - val context = state.context - if (selected) { - // using helper we defined in Shape class - context.shadowed(shadowOffset, 0.2) { - drawLogo(state) - } - } else { - drawLogo(state) - } - } - - override fun contains(mousePos: Vector): Boolean = mousePos.isInRect(pos, size) - - val centre : Vector - get() = pos + size * 0.5 -} - -val gradientGenerator = RadialGradientGenerator(getContext()) - -class Creature(override var pos : Vector, val state : CanvasState) : Shape() { - - val shadowOffset = v(-5.0, 5.0) - val colorStops = gradientGenerator.getNext() - val relSize = 0.05 - // these properties have no backing fields and in java/javascript they could be represented as little helper functions - val radius : Double - get() = state.width * relSize - val position : Vector - get() = if (selected) pos - shadowOffset else pos - val directionToLogo : Vector - get() = (Kotlin.centre - position).normalized - - //notice how the infix call can make some expressions extremely expressive - override fun contains(mousePos : Vector) = pos distanceTo mousePos < radius - - // defining more nice extension functions - fun Context.circlePath(position : Vector, rad : Double) { - arc(position.x, position.y, rad, 0.0, 2 * Math.PI, false) - } - - //notice we can use an extension function we just defined inside another extension function - fun Context.fillCircle(position : Vector, rad : Double) { - fillPath { - circlePath(position, rad) - } - } - - override fun draw(state : CanvasState) { - val context = state.context - if (!selected) { - drawCreature(context) - } else { - drawCreatureWithShadow(context) - } - } - - fun drawCreature(context : Context) { - context.fillStyle = getGradient(context) - context.fillPath { - tailPath(context) - circlePath(position, radius) - } - drawEye(context) - } - - fun getGradient(context : Context) : CanvasGradient { - val gradientCentre = position + directionToLogo * (radius / 4) - val gradient = context.createRadialGradient(gradientCentre.x, gradientCentre.y, 1.0, gradientCentre.x, gradientCentre.y, 2 * radius) - for (colorStop in colorStops) { - gradient.addColorStop(colorStop._1, colorStop._2) - } - return gradient - } - - fun tailPath(context : Context) { - val tailDirection = -directionToLogo - val tailPos = position + tailDirection * radius * 1.0 - val tailSize = radius * 1.6 - val angle = Math.PI / 6.0 - val p1 = tailPos + tailDirection.rotatedBy(angle) * tailSize - val p2 = tailPos + tailDirection.rotatedBy(-angle) * tailSize - val middlePoint = position + tailDirection * radius * 1.0 - context.moveTo(tailPos.x, tailPos.y) - context.lineTo(p1.x, p1.y) - context.quadraticCurveTo(middlePoint.x, middlePoint.y, p2.x, p2.y) - context.lineTo(tailPos.x, tailPos.y) - } - - fun drawEye(context : Context) { - val eyePos = directionToLogo * radius * 0.6 + position - val eyeRadius = radius / 3 - val eyeLidRadius = eyeRadius / 2 - context.fillStyle = "#FFFFFF" - context.fillCircle(eyePos, eyeRadius) - context.fillStyle = "#000000" - context.fillCircle(eyePos, eyeLidRadius) - } - - fun drawCreatureWithShadow(context : Context) { - context.shadowed(shadowOffset, 0.7) { - context.fillStyle = getGradient(context) - fillPath { - tailPath(context) - context.circlePath(position, radius) - } - } - drawEye(context) - } -} - -class CanvasState(val canvas : Canvas) { - var width = canvas.width - var height = canvas.height - val size : Vector - get() = v(width, height) - val context = getContext() - var valid = false - var shapes = ArrayList() - var selection : Shape? = null - var dragOff = Vector() - val interval = 1000 / 30 - - { - jq(canvas).mousedown { - valid = false - selection = null - val mousePos = mousePos(it) - for (shape in shapes) { - if (mousePos in shape) { - dragOff = mousePos - shape.pos - shape.selected = true - selection = shape - break - } - } - } - - jq(canvas).mousemove { - if (selection != null) { - selection.sure().pos = mousePos(it) - dragOff - valid = false - } - } - - jq(canvas).mouseup { - if (selection != null) { - selection.sure().selected = false - } - selection = null - valid = false - } - - jq(canvas).dblclick { - val newCreature = Creature(mousePos(it), this @CanvasState) - addShape(newCreature) - valid = false - } - - setInterval({ - draw() - }, interval) - } - - fun mousePos(e : MouseEvent) : Vector { - var offset = Vector() - var element : DomElement? = canvas - while (element != null) { - val el : DomElement = element.sure() - offset += Vector(el.offsetLeft, el.offsetTop) - element = el.offsetParent - } - return Vector(e.pageX, e.pageY) - offset - } - - fun addShape(shape : Shape) { - shapes.add(shape) - valid = false - } - - fun clear() { - context.fillStyle = "#FFFFFF" - context.fillRect(0.0, 0.0, width, height) - context.strokeStyle = "#000000" - context.lineWidth = 4.0 - context.strokeRect(0.0, 0.0, width, height) - } - - fun draw() { - if (valid) return - - clear() - for (shape in shapes.reversed()) { - shape.draw(this) - } - Kotlin.draw(this) - valid = true - } -} - -class RadialGradientGenerator(val context : Context) { - val gradients = ArrayList>() - var current = 0 - - fun newColorStops(vararg colorStops : #(Double, String)) { - gradients.add(colorStops) - } - - { - newColorStops(#(0.0, "#F59898"), #(0.5, "#F57373"), #(1.0, "#DB6B6B")) - newColorStops(#(0.39, "rgb(140,167,209)"), #(0.7, "rgb(104,139,209)"), #(0.85, "rgb(67,122,217)")) - newColorStops(#(0.0, "rgb(255,222,255)"), #(0.5, "rgb(255,185,222)"), #(1.0, "rgb(230,154,185)")) - newColorStops(#(0.0, "rgb(255,209,114)"), #(0.5, "rgb(255,174,81)"), #(1.0, "rgb(241,145,54)")) - newColorStops(#(0.0, "rgb(132,240,135)"), #(0.5, "rgb(91,240,96)"), #(1.0, "rgb(27,245,41)")) - newColorStops(#(0.0, "rgb(250,147,250)"), #(0.5, "rgb(255,80,255)"), #(1.0, "rgb(250,0,217)")) - } - - fun getNext() : Array<#(Double, String)> { - val result = gradients.get(current) - current = (current + 1) % gradients.size() - return result - } -} - -fun v(x : Double, y : Double) = Vector(x, y) - -class Vector(val x : Double = 0.0, val y : Double = 0.0) { - fun plus(v : Vector) = v(x + v.x, y + v.y) - fun minus() = v(-x, -y) - fun minus(v : Vector) = v(x - v.x, y - v.y) - fun times(koef : Double) = v(x * koef, y * koef) - fun distanceTo(v : Vector) = Math.sqrt((this - v).sqr) - fun rotatedBy(theta : Double) : Vector { - val sin = Math.sin(theta) - val cos = Math.cos(theta) - return v(x * cos - y * sin, x * sin + y * cos) - } - - fun isInRect(topLeft : Vector, size : Vector) = (x >= topLeft.x) && (x <= topLeft.x + size.x) && - (y >= topLeft.y) && (y <= topLeft.y + size.y) - - val sqr : Double - get() = x * x + y * y - val normalized : Vector - get() = this * (1.0 / Math.sqrt(sqr)) -} - -fun main() { - val state = CanvasState(getCanvas()) - state.addShape(Kotlin) - state.addShape(Creature(state.size * 0.25, state)) - state.addShape(Creature(state.size * 0.75, state)) - setTimeout({ - state.valid = false - }) -} - -fun List.reversed() : List { - val result = ArrayList() - var i = size() - while (i > 0) { - result.add(get(--i)) - } - return result -} \ No newline at end of file diff --git a/js.examples/src/html5/creatures/template.html b/js.examples/src/html5/creatures/template.html deleted file mode 100644 index 466bfa8168f..00000000000 --- a/js.examples/src/html5/creatures/template.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - - - \ No newline at end of file diff --git a/js.examples/src/html5/fancyLines/fancylines.js b/js.examples/src/html5/fancyLines/fancylines.js deleted file mode 100644 index 27e7e39a3a3..00000000000 --- a/js.examples/src/html5/fancyLines/fancylines.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function () { - var FancyLines = Kotlin.Class.create({initialize:function () { - this.$context = getContext(); - this.$height = getCanvas().height; - this.$width = getCanvas().width; - this.$x = this.get_width() * Math.random(); - this.$y = this.get_height() * Math.random(); - this.$hue = 0; - }, get_context:function () { - return this.$context; - }, get_height:function () { - return this.$height; - }, get_width:function () { - return this.$width; - }, get_x:function () { - return this.$x; - }, set_x:function (tmp$0) { - this.$x = tmp$0; - }, get_y:function () { - return this.$y; - }, set_y:function (tmp$0) { - this.$y = tmp$0; - }, get_hue:function () { - return this.$hue; - }, set_hue:function (tmp$0) { - this.$hue = tmp$0; - }, line:function () { - { - this.get_context().save(); - this.get_context().beginPath(); - this.get_context().lineWidth = 20 * Math.random(); - this.get_context().moveTo(this.get_x(), this.get_y()); - this.set_x(this.get_width() * Math.random()); - this.set_y(this.get_height() * Math.random()); - this.get_context().bezierCurveTo(this.get_width() * Math.random(), this.get_height() * Math.random(), this.get_width() * Math.random(), this.get_height() * Math.random(), this.get_x(), this.get_y()); - this.set_hue(this.get_hue() + Math.random() * 10); - this.get_context().strokeStyle = 'hsl(' + this.get_hue() + ', 50%, 50%)'; - this.get_context().shadowColor = 'white'; - this.get_context().shadowBlur = 10; - this.get_context().stroke(); - this.get_context().restore(); - } - }, blank:function () { - { - this.get_context().fillStyle = 'rgba(255,255,1,0.1)'; - this.get_context().fillRect(0, 0, this.get_width(), this.get_height()); - } - }, run:function () { - { - var tmp$1; - var tmp$0; - setInterval((tmp$0 = this , function () { - { - tmp$0.line(); - } - } - ), 40); - setInterval((tmp$1 = this , function () { - { - tmp$1.blank(); - } - } - ), 100); - } - } - }); - return {FancyLines_0:FancyLines}; - } - (); - var fancylines = Kotlin.Namespace.create({initialize:function () { - }, main:function () { - { - $(function () { - { - (new fancylines.FancyLines_0).run(); - } - } - ); - } - } - }, classes); - fancylines.initialize(); -} - -var args = []; -fancylines.main(args); diff --git a/js.examples/src/html5/fancyLines/template.html b/js.examples/src/html5/fancyLines/template.html deleted file mode 100644 index 64a717ea926..00000000000 --- a/js.examples/src/html5/fancyLines/template.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - \ No newline at end of file diff --git a/js.examples/src/html5/fancyLines/test.kt b/js.examples/src/html5/fancyLines/test.kt deleted file mode 100644 index 892bc4695cc..00000000000 --- a/js.examples/src/html5/fancyLines/test.kt +++ /dev/null @@ -1,64 +0,0 @@ -/* -This example is based on example from html5 canvas2D docs: - http://www.w3.org/TR/2dcontext/ -Note that only a subset of the api is supported for now. -*/ - -package fancylines - -import js.*; -import html5.*; -import jquery.*; - -fun main() { - //jq is a name for JQuery function - jq { - FancyLines().run(); - } -} - -class FancyLines() { - // we use two 'magic' functions here getContext() and getCanvas() - val context = getContext(); - val height = getCanvas().height; - val width = getCanvas().width; - var x = width * Math.random(); - var y = height * Math.random(); - var hue = 0; - - fun line() { - context.save(); - - context.beginPath(); - - context.lineWidth = 20.0 * Math.random(); - context.moveTo(x, y); - - x = width * Math.random(); - y = height * Math.random(); - - context.bezierCurveTo(width * Math.random(), height * Math.random(), - width * Math.random(), height * Math.random(), x, y); - - hue += Math.random() * 10; - - context.strokeStyle = "hsl($hue, 50%, 50%)"; - - context.shadowColor = "white"; - context.shadowBlur = 10.0; - - context.stroke(); - - context.restore(); - } - - fun blank() { - context.fillStyle = "rgba(255,255,1,0.1)"; - context.fillRect(0.0, 0.0, width, height); - } - - fun run() { - setInterval({line()}, 40); - setInterval({blank()}, 100); - } -} \ No newline at end of file diff --git a/js.examples/src/html5/floatingText/hello.js b/js.examples/src/html5/floatingText/hello.js deleted file mode 100644 index 289ebedd579..00000000000 --- a/js.examples/src/html5/floatingText/hello.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function () { - var HelloKotlin = Kotlin.Class.create({initialize:function () { - this.$relX = 0.2 + 0.2 * Math.random(); - this.$relY = 0.4 + 0.2 * Math.random(); - this.$relXVelocity = this.randomVelocity(); - this.$relYVelocity = this.randomVelocity(); - this.$message = 'Hello, Kotlin!'; - this.$textHeightInPixels = 60; - { - hello.get_context().font = 'bold ' + this.get_textHeightInPixels() + 'px Georgia, serif'; - } - this.$textWidthInPixels = hello.get_context().measureText(this.get_message()).width; - }, get_relX:function () { - return this.$relX; - }, set_relX:function (tmp$0) { - this.$relX = tmp$0; - }, get_relY:function () { - return this.$relY; - }, set_relY:function (tmp$0) { - this.$relY = tmp$0; - }, get_absX:function () { - { - return this.get_relX() * hello.get_width(); - } - }, get_absY:function () { - { - return this.get_relY() * hello.get_height(); - } - }, get_relXVelocity:function () { - return this.$relXVelocity; - }, set_relXVelocity:function (tmp$0) { - this.$relXVelocity = tmp$0; - }, get_relYVelocity:function () { - return this.$relYVelocity; - }, set_relYVelocity:function (tmp$0) { - this.$relYVelocity = tmp$0; - }, get_message:function () { - return this.$message; - }, get_textHeightInPixels:function () { - return this.$textHeightInPixels; - }, get_textWidthInPixels:function () { - return this.$textWidthInPixels; - }, draw:function () { - { - hello.get_context().save(); - this.move(); - hello.get_context().shadowColor = '#000000'; - hello.get_context().shadowBlur = 5; - hello.get_context().shadowOffsetX = -4; - hello.get_context().shadowOffsetY = 4; - hello.get_context().fillStyle = 'rgb(242,160,110)'; - hello.get_context().fillText(this.get_message(), this.get_absX(), this.get_absY()); - hello.get_context().restore(); - } - }, move:function () { - { - var relTextWidth = this.get_textWidthInPixels() / hello.get_width(); - if (this.get_relX() > 1 - relTextWidth - this.get_abs(this.get_relXVelocity()) || this.get_relX() < this.get_abs(this.get_relXVelocity())) { - this.set_relXVelocity(this.get_relXVelocity() * -1); - } - var relTextHeight = this.get_textHeightInPixels() / hello.get_height(); - if (this.get_relY() > 1 - this.get_abs(this.get_relYVelocity()) || this.get_relY() < this.get_abs(this.get_relYVelocity()) + relTextHeight) { - this.set_relYVelocity(this.get_relYVelocity() * -1); - } - this.set_relX(this.get_relX() + this.get_relXVelocity()); - this.set_relY(this.get_relY() + this.get_relYVelocity()); - } - }, randomVelocity:function () { - var tmp$0; - if (Math.random() < 0.5) - tmp$0 = 1; - else - tmp$0 = -1; - { - return 0.03 * Math.random() * tmp$0; - } - }, get_abs:function (receiver) { - var tmp$0; - if (receiver > 0) - tmp$0 = receiver; - else - tmp$0 = -receiver; - { - return tmp$0; - } - } - }); - return {HelloKotlin_0:HelloKotlin}; - } - (); - var hello = Kotlin.Namespace.create({initialize:function () { - hello.$context = getContext(); - hello.$height = getCanvas().height; - hello.$width = getCanvas().width; - }, get_context:function () { - return hello.$context; - }, get_height:function () { - return hello.$height; - }, get_width:function () { - return hello.$width; - }, renderBackground:function () { - { - hello.get_context().save(); - hello.get_context().fillStyle = '#5C7EED'; - hello.get_context().fillRect(0, 0, hello.get_width(), hello.get_height()); - hello.get_context().restore(); - } - }, main:function () { - { - var interval = 50; - var logos = Kotlin.arrayFromFun(3, function (it) { - { - return new hello.HelloKotlin_0; - } - } - ); - $(function () { - { - setInterval(function () { - { - var tmp$0; - hello.renderBackground(); - { - tmp$0 = Kotlin.arrayIterator(logos); - while (tmp$0.hasNext()) { - var logo = tmp$0.next(); - { - logo.draw(); - } - } - } - } - } - , interval); - } - } - ); - } - } - }, classes); - hello.initialize(); -} - -var args = []; -hello.main(args); diff --git a/js.examples/src/html5/floatingText/template.html b/js.examples/src/html5/floatingText/template.html deleted file mode 100644 index 557ab5c8b6f..00000000000 --- a/js.examples/src/html5/floatingText/template.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - \ No newline at end of file diff --git a/js.examples/src/html5/floatingText/test.kt b/js.examples/src/html5/floatingText/test.kt deleted file mode 100644 index e5bca3ea4d9..00000000000 --- a/js.examples/src/html5/floatingText/test.kt +++ /dev/null @@ -1,91 +0,0 @@ -/* - This example is just simple text floating around. If u are using chrome, there is a bug that spoil the visuals. -*/ -package hello - -import js.* -import html5.* -import jquery.* - -val context = getContext() -val height = getCanvas().height -val width = getCanvas().width - -// class representing a floating text -class HelloKotlin() { - var relX = 0.2 + 0.2 * Math.random() - var relY = 0.4 + 0.2 * Math.random() - - val absX : Double - get() = (relX * width) - val absY : Double - get() = (relY * height) - - var relXVelocity = randomVelocity() - var relYVelocity = randomVelocity() - - - val message = "Hello, Kotlin!" - val textHeightInPixels = 60 - { - context.font = "bold ${textHeightInPixels}px Georgia, serif" - } - val textWidthInPixels = context.measureText(message).width - - fun draw() { - context.save() - move() - // if you using chrome chances are good you wont see the shadow - context.shadowColor = "#000000" - context.shadowBlur = 5.0 - context.shadowOffsetX = -4.0 - context.shadowOffsetY = 4.0 - context.fillStyle = "rgb(242,160,110)" - context.fillText(message, absX, absY) - context.restore() - } - - fun move() { - val relTextWidth = textWidthInPixels / width - if (relX > (1.0 - relTextWidth - relXVelocity.abs) || relX < relXVelocity.abs) { - relXVelocity *= -1 - } - val relTextHeight = textHeightInPixels / height - if (relY > (1.0 - relYVelocity.abs) || relY < relYVelocity.abs + relTextHeight) { - relYVelocity *= -1 - } - relX += relXVelocity - relY += relYVelocity - } - - fun randomVelocity() = 0.03 * Math.random() * (if (Math.random() < 0.5) 1 else -1) - - - val Double.abs : Double - get() = if (this > 0) this else -this -} - -fun renderBackground() { - context.save() - context.fillStyle = "#5C7EED" - context.fillRect(0.0, 0.0, width, height) - context.restore() -} - -fun main() { - val interval = 50 - // we pass a literal that constructs a new HelloKotlin object - val logos = Array(3) { - HelloKotlin() - } - jq { - setInterval({ - renderBackground() - for (logo in logos) { - logo.draw() - } - }, interval) - } -} - - diff --git a/js.examples/src/html5/interactive/interactive.js b/js.examples/src/html5/interactive/interactive.js deleted file mode 100644 index e87a2d66315..00000000000 --- a/js.examples/src/html5/interactive/interactive.js +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function () { - var Vector = Kotlin.Class.create({initialize:function (x, y) { - this.$x = x; - this.$y = y; - }, get_x:function () { - return this.$x; - }, set_x:function (tmp$0) { - this.$x = tmp$0; - }, get_y:function () { - return this.$y; - }, set_y:function (tmp$0) { - this.$y = tmp$0; - }, plus:function (v) { - { - return interactive.v_0(this.get_x() + v.get_x(), this.get_y() + v.get_y()); - } - }, minus:function (v) { - { - return interactive.v_0(this.get_x() - v.get_x(), this.get_y() - v.get_y()); - } - }, times:function (coef) { - { - return interactive.v_0(this.get_x() * coef, this.get_y() * coef); - } - }, distanceTo:function (v) { - { - return Math.sqrt(this.minus(v).get_sqr()); - } - }, isInRect:function (topLeft, size) { - { - return this.get_x() >= topLeft.get_x() && this.get_x() <= topLeft.get_x() + size.get_x() && this.get_y() >= topLeft.get_y() && this.get_y() <= topLeft.get_y() + size.get_y(); - } - }, get_sqr:function () { - { - return this.get_x() * this.get_x() + this.get_y() * this.get_y(); - } - } - }); - var CanvasState = Kotlin.Class.create({initialize:function (canvas) { - this.$canvas = canvas; - this.$width = this.get_canvas().width; - this.$height = this.get_canvas().height; - this.$context = getContext(); - this.$valid = false; - this.$shapes = new Kotlin.ArrayList; - this.$selection = null; - this.$dragOff = new interactive.Vector_0(0, 0); - this.$interval = 1000 / 30; - this.$size = 20; - { - var tmp$4; - var tmp$3; - var tmp$2; - var tmp$1; - var tmp$0_0; - $(this.get_canvas()).mousedown((tmp$0_0 = this , function (it) { - { - var tmp$0; - tmp$0_0.set_valid(false); - tmp$0_0.set_selection(null); - var mousePos = tmp$0_0.mousePos_0(it); - { - tmp$0 = tmp$0_0.get_shapes().iterator(); - while (tmp$0.hasNext()) { - var shape = tmp$0.next(); - { - if (shape.contains(mousePos)) { - tmp$0_0.set_dragOff(mousePos.minus(shape.get_pos())); - shape.set_selected(true); - tmp$0_0.set_selection(shape); - break; - } - } - } - } - } - } - )); - $(this.get_canvas()).mousemove((tmp$1 = this , function (it) { - { - if (tmp$1.get_selection() != null) { - Kotlin.sure(tmp$1.get_selection()).set_pos(tmp$1.mousePos_0(it).minus(tmp$1.get_dragOff())); - tmp$1.set_valid(false); - } - } - } - )); - $(this.get_canvas()).mouseup((tmp$2 = this , function (it) { - { - if (tmp$2.get_selection() != null) { - Kotlin.sure(tmp$2.get_selection()).set_selected(false); - } - tmp$2.set_selection(null); - tmp$2.set_valid(false); - } - } - )); - $(this.get_canvas()).dblclick((tmp$3 = this , function (it) { - { - var redTransparentCircle = new interactive.Circle_0(tmp$3.mousePos_0(it), tmp$3.get_size(), 'rgba(200, 100, 100, 0.3)'); - tmp$3.addShape(redTransparentCircle); - tmp$3.set_valid(false); - } - } - )); - interactive.doWithPeriod(this.get_interval(), (tmp$4 = this , function () { - { - tmp$4.draw(); - } - } - )); - } - }, get_canvas:function () { - return this.$canvas; - }, get_width:function () { - return this.$width; - }, get_height:function () { - return this.$height; - }, get_context:function () { - return this.$context; - }, get_valid:function () { - return this.$valid; - }, set_valid:function (tmp$0) { - this.$valid = tmp$0; - }, get_shapes:function () { - return this.$shapes; - }, set_shapes:function (tmp$0) { - this.$shapes = tmp$0; - }, get_selection:function () { - return this.$selection; - }, set_selection:function (tmp$0) { - this.$selection = tmp$0; - }, get_dragOff:function () { - return this.$dragOff; - }, set_dragOff:function (tmp$0) { - this.$dragOff = tmp$0; - }, get_interval:function () { - return this.$interval; - }, get_size:function () { - return this.$size; - }, mousePos_0:function (e) { - { - var offset = new interactive.Vector_0(0, 0); - var element = this.get_canvas(); - while (element != null) { - var el = Kotlin.sure(element); - offset = offset.plus(new interactive.Vector_0(el.offsetLeft, el.offsetTop)); - element = el.offsetParent; - } - return (new interactive.Vector_0(e.pageX, e.pageY)).minus(offset); - } - }, addShape:function (shape) { - { - this.get_shapes().add(shape); - this.set_valid(false); - } - }, clear:function () { - { - this.get_context().fillStyle = '#FFFFFF'; - this.get_context().fillRect(0, 0, this.get_width(), this.get_height()); - this.get_context().strokeStyle = '#000000'; - this.get_context().lineWidth = 4; - this.get_context().strokeRect(0, 0, this.get_width(), this.get_height()); - } - }, draw:function () { - { - var tmp$0; - if (this.get_valid()) - return; - this.clear(); - { - tmp$0 = this.get_shapes().iterator(); - while (tmp$0.hasNext()) { - var shape = tmp$0.next(); - { - shape.draw(this); - } - } - } - this.set_valid(true); - } - } - }); - var Shape = Kotlin.Class.create({initialize:function () { - this.$selected = false; - }, draw:function (state) { - }, contains:function (mousePos) { - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_selected:function () { - return this.$selected; - }, set_selected:function (tmp$0) { - this.$selected = tmp$0; - } - }); - var JB = Kotlin.Class.create(Shape, {initialize:function (pos, relSize) { - this.$pos = pos; - this.$relSize = relSize; - this.super_init(); - this.$imageSize = interactive.v_0(704, 254); - this.$canvasSize = this.get_imageSize().times(this.get_relSize()); - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_relSize:function () { - return this.$relSize; - }, set_relSize:function (tmp$0) { - this.$relSize = tmp$0; - }, get_imageSize:function () { - return this.$imageSize; - }, get_canvasSize:function () { - return this.$canvasSize; - }, draw:function (state) { - { - var context = state.get_context(); - context.drawImage(getKotlinLogo(), 0, 0, this.get_imageSize().get_x(), this.get_imageSize().get_y(), this.get_pos().get_x(), this.get_pos().get_y(), this.get_canvasSize().get_x(), this.get_canvasSize().get_y()); - } - }, contains:function (mousePos) { - { - return mousePos.isInRect(this.get_pos(), this.get_canvasSize()); - } - } - }); - var Rectangle = Kotlin.Class.create(Shape, {initialize:function (pos, size) { - this.$pos = pos; - this.$size = size; - this.super_init(); - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_size:function () { - return this.$size; - }, set_size:function (tmp$0) { - this.$size = tmp$0; - }, draw:function (state) { - { - var context = state.get_context(); - context.fillStyle = 'rgba(0,255,0,.6)'; - context.fillRect(this.get_pos().get_x(), this.get_pos().get_y(), this.get_size().get_x(), this.get_size().get_y()); - if (this.get_selected()) { - context.strokeStyle = '#FF0000'; - context.lineWidth = 2; - context.strokeRect(this.get_pos().get_x(), this.get_pos().get_y(), this.get_size().get_x(), this.get_size().get_y()); - } - } - }, contains:function (mousePos) { - { - return mousePos.isInRect(this.get_pos(), this.get_size()); - } - } - }); - var Circle = Kotlin.Class.create(Shape, {initialize:function (pos, radius, fillColor) { - this.$pos = pos; - this.$radius = radius; - this.$fillColor = fillColor; - this.super_init(); - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_radius:function () { - return this.$radius; - }, set_radius:function (tmp$0) { - this.$radius = tmp$0; - }, get_fillColor:function () { - return this.$fillColor; - }, set_fillColor:function (tmp$0) { - this.$fillColor = tmp$0; - }, draw:function (state) { - { - var context = state.get_context(); - context.shadowColor = 'white'; - context.shadowBlur = 10; - context.fillStyle = this.get_fillColor(); - context.beginPath(); - context.arc(this.get_pos().get_x(), this.get_pos().get_y(), this.get_radius(), 0, 2 * Math.PI, false); - context.closePath(); - context.fill(); - } - }, contains:function (mousePos) { - { - return this.get_pos().distanceTo(mousePos) < this.get_radius(); - } - } - }); - return {Shape_0:Shape, JB_0:JB, Rectangle_0:Rectangle, Circle_0:Circle, CanvasState_0:CanvasState, Vector_0:Vector}; - } - (); - var interactive = Kotlin.Namespace.create({initialize:function () { - interactive.$state = new interactive.CanvasState_0(getCanvas()); - }, get_state:function () { - return interactive.$state; - }, doWithPeriod:function (period, f) { - { - setInterval(f, period); - } - }, v_0:function (x, y) { - { - return new interactive.Vector_0(x, y); - } - }, main:function () { - { - var state = new interactive.CanvasState_0(getCanvas()); - state.addShape(new interactive.JB_0(interactive.v_0(1, 1), 0.3)); - setTimeout(function () { - { - state.set_valid(false); - } - } - ); - } - } - }, classes); - interactive.initialize(); -} - -var args = []; -interactive.main(args); diff --git a/js.examples/src/html5/interactive/jbLogo.png b/js.examples/src/html5/interactive/jbLogo.png deleted file mode 100644 index 759aa8ae05a..00000000000 Binary files a/js.examples/src/html5/interactive/jbLogo.png and /dev/null differ diff --git a/js.examples/src/html5/interactive/main.kt b/js.examples/src/html5/interactive/main.kt deleted file mode 100644 index 86eb1c1fdfc..00000000000 --- a/js.examples/src/html5/interactive/main.kt +++ /dev/null @@ -1,183 +0,0 @@ -package interactive; - -import jquery.*; -import html5.*; -import java.util.ArrayList; -import js.*; -import js.Math; -import js.setInterval -import html5.getCanvas -import html5.getKotlinLogo -import jquery.jq -import js.setTimeout - -val state = CanvasState(getCanvas()); - -fun doWithPeriod(period : Int, f : ()->Unit) { - setInterval(f, period); -} - -abstract class Shape() { - abstract fun draw(state : CanvasState); - abstract fun contains(mousePos : Vector) : Boolean; - abstract var pos : Vector; - var selected : Boolean = false; -} - -class Circle(override var pos : Vector, - var radius : Double = 1.0, - var fillColor : String = "#AAAAAA") : Shape() { - - override fun draw(state : CanvasState) { - val context = state.context; - context.shadowColor = "white"; - context.shadowBlur = 10.0; - context.fillStyle = fillColor; - context.beginPath(); - context.arc(pos.x, pos.y, radius, 0.0, 2 * Math.PI, false); - context.closePath(); - context.fill(); - } - - override fun contains(mousePos : Vector) = pos.distanceTo(mousePos) < radius; -} - -class Rectangle(override var pos : Vector, - var size : Vector) : Shape() -{ - override fun draw(state : CanvasState) { - val context = state.context; - context.fillStyle = "rgba(0,255,0,.6)"; - context.fillRect(pos.x, pos.y, size.x, size.y); - if (selected) { - context.strokeStyle = "#FF0000" - context.lineWidth = 2.0; - context.strokeRect(pos.x, pos.y, size.x, size.y) - } - } - - override fun contains(mousePos : Vector) = mousePos.isInRect(pos, size); -} - -class JB(override var pos : Vector, - var relSize : Double = 0.3) : Shape() -{ - - val imageSize = v(704.0, 254.0) - val canvasSize = imageSize * relSize - - override fun draw(state : CanvasState) { - val context = state.context; - context.drawImage(getKotlinLogo(), 0.0, 0.0, imageSize.x, imageSize.y, pos.x, pos.y, canvasSize.x, canvasSize.y) - } - - override fun contains(mousePos: Vector): Boolean = mousePos.isInRect(pos, canvasSize) -} - -class CanvasState(val canvas : Canvas) { - val width = canvas.width; - val height = canvas.height; - val context = getContext(); - var valid = false; - var shapes = ArrayList(); - var selection : Shape? = null; - var dragOff = Vector(); - val interval = 1000 / 30; - val size = 20.0; - - { - jq(canvas).mousedown { - valid = false; - selection = null; - val mousePos = mousePos(it); - for (shape in shapes) { - if (mousePos in shape) { - dragOff = mousePos - shape.pos; - shape.selected = true; - selection = shape; - break; - } - } - } - - jq(canvas).mousemove { - if (selection != null) { - selection.sure().pos = mousePos(it) - dragOff; - valid = false; - } - } - - jq(canvas).mouseup { - if (selection != null) { - selection.sure().selected = false; - } - selection = null; - valid = false; - } - - jq(canvas).dblclick { - val redTransparentCircle = Circle(mousePos(it), size, "rgba(200, 100, 100, 0.3)"); - addShape(redTransparentCircle); - valid = false; - } - - doWithPeriod(interval) { - draw(); - } - } - - fun mousePos(e : MouseEvent) : Vector { - var offset = Vector(); - var element : DomElement? = canvas; - while (element != null) { - val el : DomElement = element.sure(); - offset += Vector(el.offsetLeft, el.offsetTop); - element = el.offsetParent; - } - return Vector(e.pageX, e.pageY) - offset; - } - - fun addShape(shape : Shape) { - shapes.add(shape); - valid = false; - } - - fun clear() { - context.fillStyle = "#FFFFFF" - context.fillRect(0.0, 0.0, width, height) - context.strokeStyle = "#000000" - context.lineWidth = 4.0; - context.strokeRect(0.0, 0.0, width, height) - } - - fun draw() { - if (valid) return - - clear(); - for (shape in shapes) { - shape.draw(this); - } - valid = true; - } -} - -fun v(x : Double, y : Double) = Vector(x, y); - -class Vector(var x : Double = 0.0, var y : Double = 0.0) { - fun plus(v : Vector) = v(x + v.x, y + v.y); - fun minus(v : Vector) = v(x - v.x, y - v.y); - fun times(coef : Double) = v(x * coef, y * coef); - fun distanceTo(v : Vector) = Math.sqrt((this - v).sqr); - fun isInRect(topLeft : Vector, size : Vector) = (x >= topLeft.x) && (x <= topLeft.x + size.x) && - (y >= topLeft.y) && (y <= topLeft.y + size.y) - val sqr : Double - get() = x * x + y * y; -} - -fun main() { - val state = CanvasState(getCanvas()); - state.addShape(JB(v(1.0, 1.0))); - setTimeout({ - state.valid = false - }) -} \ No newline at end of file diff --git a/js.examples/src/html5/interactive/template.html b/js.examples/src/html5/interactive/template.html deleted file mode 100644 index d976e3dafc2..00000000000 --- a/js.examples/src/html5/interactive/template.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - - \ No newline at end of file diff --git a/js.examples/src/html5/interactive/template_copy.html b/js.examples/src/html5/interactive/template_copy.html deleted file mode 100644 index d3319ca6c00..00000000000 --- a/js.examples/src/html5/interactive/template_copy.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - \ No newline at end of file diff --git a/js.examples/src/html5/interactive/tutorial.js b/js.examples/src/html5/interactive/tutorial.js deleted file mode 100644 index fb48f04ce7b..00000000000 --- a/js.examples/src/html5/interactive/tutorial.js +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -// By Simon Sarris -// www.simonsarris.com -// sarris@acm.org -// -// Last update December 2011 -// -// Free to use and distribute at will -// So long as you are nice to people, etc - -// Constructor for Shape objects to hold data for all drawn objects. -// For now they will just be defined as rectangles. -function Shape(x, y, w, h, fill) { - // This is a very simple and unsafe constructor. All we're doing is checking if the values exist. - // "x || 0" just means "if there is a value for x, use that. Otherwise use 0." - // But we aren't checking anything else! We could put "Lalala" for the value of x - this.x = x || 0; - this.y = y || 0; - this.w = w || 1; - this.h = h || 1; - this.fill = fill || '#AAAAAA'; -} - -// Draws this shape to a given context -Shape.prototype.draw = function (ctx) { - ctx.fillStyle = this.fill; - ctx.fillRect(this.x, this.y, this.w, this.h); -} - -// Determine if a point is inside the shape's bounds -Shape.prototype.contains = function (mx, my) { - // All we have to do is make sure the Mouse X,Y fall in the area between - // the shape's X and (X + Height) and its Y and (Y + Height) - return (this.x <= mx) && (this.x + this.w >= mx) && - (this.y <= my) && (this.y + this.h >= my); -} - -function CanvasState(canvas) { - // **** First some setup! **** - - this.canvas = canvas; - this.width = canvas.width; - this.height = canvas.height; - this.ctx = canvas.getContext('2d'); - // This complicates things a little but but fixes mouse co-ordinate problems - // when there's a border or padding. See getMouse for more detail -// if (document.defaultView && document.defaultView.getComputedStyle) { -// this.stylePaddingLeft = parseInt(document.defaultView.getComputedStyle(canvas, null)['paddingLeft'], 10) || 0; -// this.stylePaddingTop = parseInt(document.defaultView.getComputedStyle(canvas, null)['paddingTop'], 10) || 0; -// this.styleBorderLeft = parseInt(document.defaultView.getComputedStyle(canvas, null)['borderLeftWidth'], 10) || 0; -// this.styleBorderTop = parseInt(document.defaultView.getComputedStyle(canvas, null)['borderTopWidth'], 10) || 0; -// } - // Some pages have fixed-position bars (like the stumbleupon bar) at the top or left of the page - // They will mess up mouse coordinates and this fixes that - var html = document.body.parentNode; - this.htmlTop = html.offsetTop; - this.htmlLeft = html.offsetLeft; - - // **** Keep track of state! **** - - this.valid = false; // when set to false, the canvas will redraw everything - this.shapes = []; // the collection of things to be drawn - this.dragging = false; // Keep track of when we are dragging - // the current selected object. In the future we could turn this into an array for multiple selection - this.selection = null; - this.dragoffx = 0; // See mousedown and mousemove events for explanation - this.dragoffy = 0; - - // **** Then events! **** - - // This is an example of a closure! - // Right here "this" means the CanvasState. But we are making events on the Canvas itself, - // and when the events are fired on the canvas the variable "this" is going to mean the canvas! - // Since we still want to use this particular CanvasState in the events we have to save a reference to it. - // This is our reference! - var myState = this; - - //fixes a problem where double clicking causes text to get selected on the canvas - canvas.addEventListener('selectstart', function (e) { - e.preventDefault(); - return false; - }, false); - // Up, down, and move are for dragging - canvas.addEventListener('mousedown', function (e) { - var mouse = myState.getMouse(e); - var mx = mouse.x; - var my = mouse.y; - var shapes = myState.shapes; - var l = shapes.length; - for (var i = l - 1; i >= 0; i--) { - if (shapes[i].contains(mx, my)) { - var mySel = shapes[i]; - // Keep track of where in the object we clicked - // so we can move it smoothly (see mousemove) - myState.dragoffx = mx - mySel.x; - myState.dragoffy = my - mySel.y; - myState.dragging = true; - myState.selection = mySel; - myState.valid = false; - return; - } - } - // havent returned means we have failed to select anything. - // If there was an object selected, we deselect it - if (myState.selection) { - myState.selection = null; - myState.valid = false; // Need to clear the old selection border - } - }, true); - canvas.addEventListener('mousemove', function (e) { - if (myState.dragging) { - var mouse = myState.getMouse(e); - // We don't want to drag the object by its top-left corner, we want to drag it - // from where we clicked. Thats why we saved the offset and use it here - myState.selection.x = mouse.x - myState.dragoffx; - myState.selection.y = mouse.y - myState.dragoffy; - myState.valid = false; // Something's dragging so we must redraw - } - }, true); - canvas.addEventListener('mouseup', function (e) { - myState.dragging = false; - }, true); - // double click for making new shapes - canvas.addEventListener('dblclick', function (e) { - var mouse = myState.getMouse(e); - myState.addShape(new Shape(mouse.x - 10, mouse.y - 10, 20, 20, 'rgba(0,255,0,.6)')); - }, true); - - // **** Options! **** - - this.selectionColor = '#CC0000'; - this.selectionWidth = 2; - this.interval = 30; - setInterval(function () { - myState.draw(); - }, myState.interval); -} - -CanvasState.prototype.addShape = function (shape) { - this.shapes.push(shape); - this.valid = false; -} - -CanvasState.prototype.clear = function () { - this.ctx.clearRect(0, 0, this.width, this.height); -} - -// While draw is called as often as the INTERVAL variable demands, -// It only ever does something if the canvas gets invalidated by our code -CanvasState.prototype.draw = function () { - // if our state is invalid, redraw and validate! - if (!this.valid) { - var ctx = this.ctx; - var shapes = this.shapes; - this.clear(); - - // ** Add stuff you want drawn in the background all the time here ** - - // draw all shapes - var l = shapes.length; - for (var i = 0; i < l; i++) { - var shape = shapes[i]; - // We can skip the drawing of elements that have moved off the screen: - if (shape.x > this.width || shape.y > this.height || - shape.x + shape.w < 0 || shape.y + shape.h < 0) continue; - shapes[i].draw(ctx); - } - - // draw selection - // right now this is just a stroke along the edge of the selected Shape - if (this.selection != null) { - ctx.strokeStyle = this.selectionColor; - ctx.lineWidth = this.selectionWidth; - var mySel = this.selection; - ctx.strokeRect(mySel.x, mySel.y, mySel.w, mySel.h); - } - - // ** Add stuff you want drawn on top all the time here ** - - this.valid = true; - } -} - - -// Creates an object with x and y defined, set to the mouse position relative to the state's canvas -// If you wanna be super-correct this can be tricky, we have to worry about padding and borders -CanvasState.prototype.getMouse = function (e) { - var element = this.canvas, offsetX = 0, offsetY = 0, mx, my; - - // Compute the total offset - if (element.offsetParent !== undefined) { - do { - offsetX += element.offsetLeft; - offsetY += element.offsetTop; - } while ((element = element.offsetParent)); - } - - // Add padding and border style widths to offset - // Also add the offsets in case there's a position:fixed bar -// offsetX += this.stylePaddingLeft + this.styleBorderLeft + this.htmlLeft; - // offsetY += this.stylePaddingTop + this.styleBorderTop + this.htmlTop; - - mx = e.pageX - offsetX; - my = e.pageY - offsetY; - - // We return a simple javascript object (a hash) with x and y defined - return {x:mx, y:my}; -} - -// If you dont want to use -// You could uncomment this init() reference and place the script reference inside the body tag -init(); - -function init() { - var s = new CanvasState(getCanvas()); - s.addShape(new Shape(40, 40, 50, 50)); // The default is gray - s.addShape(new Shape(60, 140, 40, 60, 'lightskyblue')); - // Lets make some partially transparent - s.addShape(new Shape(80, 150, 60, 30, 'rgba(127, 255, 212, .5)')); - s.addShape(new Shape(125, 80, 30, 80, 'rgba(245, 222, 179, .7)')); -} - -// Now go make something amazing! \ No newline at end of file diff --git a/js.examples/src/html5/interactive2/interactive2.js b/js.examples/src/html5/interactive2/interactive2.js deleted file mode 100644 index 93de4ed144b..00000000000 --- a/js.examples/src/html5/interactive2/interactive2.js +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function () { - var Vector = Kotlin.Class.create({initialize:function (x, y) { - this.$x = x; - this.$y = y; - }, get_x:function () { - return this.$x; - }, get_y:function () { - return this.$y; - }, plus:function (v) { - { - return interactive2.v_0(this.get_x() + v.get_x(), this.get_y() + v.get_y()); - } - }, minus:function () { - { - return interactive2.v_0(-this.get_x(), -this.get_y()); - } - }, minus$0:function (v) { - { - return interactive2.v_0(this.get_x() - v.get_x(), this.get_y() - v.get_y()); - } - }, times:function (coef) { - { - return interactive2.v_0(this.get_x() * coef, this.get_y() * coef); - } - }, distanceTo:function (v) { - { - return Math.sqrt(this.minus$0(v).get_sqr()); - } - }, rotatedBy:function (theta) { - { - var sin = Math.sin(theta); - var cos = Math.cos(theta); - return interactive2.v_0(this.get_x() * cos - this.get_y() * sin, this.get_x() * sin + this.get_y() * cos); - } - }, isInRect:function (topLeft, size) { - { - return this.get_x() >= topLeft.get_x() && this.get_x() <= topLeft.get_x() + size.get_x() && this.get_y() >= topLeft.get_y() && this.get_y() <= topLeft.get_y() + size.get_y(); - } - }, get_sqr:function () { - { - return this.get_x() * this.get_x() + this.get_y() * this.get_y(); - } - }, get_normalized:function () { - { - return this.times(1 / Math.sqrt(this.get_sqr())); - } - } - }); - var RadialGradientGenerator = Kotlin.Class.create({initialize:function (context) { - this.$context = context; - this.$gradients = new Kotlin.ArrayList; - this.$current = 0; - { - this.newColorStops([ - [0, '#F59898'], - [0.5, '#F57373'], - [1, '#DB6B6B'] - ]); - this.newColorStops([ - [0.39, 'rgb(140,167,209)'], - [0.7, 'rgb(104,139,209)'], - [0.85, 'rgb(67,122,217)'] - ]); - this.newColorStops([ - [0, 'rgb(255,222,255)'], - [0.5, 'rgb(255,185,222)'], - [1, 'rgb(230,154,185)'] - ]); - this.newColorStops([ - [0, 'rgb(255,209,114)'], - [0.5, 'rgb(255,174,81)'], - [1, 'rgb(241,145,54)'] - ]); - this.newColorStops([ - [0, 'rgb(132,240,135)'], - [0.5, 'rgb(91,240,96)'], - [1, 'rgb(27,245,41)'] - ]); - this.newColorStops([ - [0, 'rgb(250,147,250)'], - [0.5, 'rgb(255,80,255)'], - [1, 'rgb(250,0,217)'] - ]); - } - }, get_context:function () { - return this.$context; - }, get_gradients:function () { - return this.$gradients; - }, get_current:function () { - return this.$current; - }, set_current:function (tmp$0) { - this.$current = tmp$0; - }, newColorStops:function (colorStops) { - { - this.get_gradients().add(colorStops); - } - }, getNext:function () { - { - var result = this.get_gradients().get(this.get_current()); - this.set_current((this.get_current() + 1) % this.get_gradients().size()); - return result; - } - } - }); - var CanvasState = Kotlin.Class.create({initialize:function (canvas) { - this.$canvas = canvas; - this.$width = this.get_canvas().width; - this.$height = this.get_canvas().height; - this.$context = getContext(); - this.$valid = false; - this.$shapes = new Kotlin.ArrayList; - this.$selection = null; - this.$dragOff = new interactive2.Vector_0(0, 0); - this.$interval = 1000 / 30; - { - var tmp$4; - var tmp$3; - var tmp$2; - var tmp$1; - var tmp$0_0; - $(this.get_canvas()).mousedown((tmp$0_0 = this , function (it) { - { - var tmp$0; - tmp$0_0.set_valid(false); - tmp$0_0.set_selection(null); - var mousePos = tmp$0_0.mousePos_0(it); - { - tmp$0 = tmp$0_0.get_shapes().iterator(); - while (tmp$0.hasNext()) { - var shape = tmp$0.next(); - { - if (shape.contains(mousePos)) { - tmp$0_0.set_dragOff(mousePos.minus$0(shape.get_pos())); - shape.set_selected(true); - tmp$0_0.set_selection(shape); - break; - } - } - } - } - } - } - )); - $(this.get_canvas()).mousemove((tmp$1 = this , function (it) { - { - if (tmp$1.get_selection() != null) { - Kotlin.sure(tmp$1.get_selection()).set_pos(tmp$1.mousePos_0(it).minus$0(tmp$1.get_dragOff())); - tmp$1.set_valid(false); - } - } - } - )); - $(this.get_canvas()).mouseup((tmp$2 = this , function (it) { - { - if (tmp$2.get_selection() != null) { - Kotlin.sure(tmp$2.get_selection()).set_selected(false); - } - tmp$2.set_selection(null); - tmp$2.set_valid(false); - } - } - )); - $(this.get_canvas()).dblclick((tmp$3 = this , function (it) { - { - var redTransparentCircle = new interactive2.Creature_0(tmp$3.mousePos_0(it), tmp$3); - tmp$3.addShape(redTransparentCircle); - tmp$3.set_valid(false); - } - } - )); - interactive2.doWithPeriod(this.get_interval(), (tmp$4 = this , function () { - { - tmp$4.draw(); - } - } - )); - } - }, get_canvas:function () { - return this.$canvas; - }, get_width:function () { - return this.$width; - }, get_height:function () { - return this.$height; - }, get_context:function () { - return this.$context; - }, get_valid:function () { - return this.$valid; - }, set_valid:function (tmp$0) { - this.$valid = tmp$0; - }, get_shapes:function () { - return this.$shapes; - }, set_shapes:function (tmp$0) { - this.$shapes = tmp$0; - }, get_selection:function () { - return this.$selection; - }, set_selection:function (tmp$0) { - this.$selection = tmp$0; - }, get_dragOff:function () { - return this.$dragOff; - }, set_dragOff:function (tmp$0) { - this.$dragOff = tmp$0; - }, get_interval:function () { - return this.$interval; - }, mousePos_0:function (e) { - { - var offset = new interactive2.Vector_0(0, 0); - var element = this.get_canvas(); - while (element != null) { - var el = Kotlin.sure(element); - offset = offset.plus(new interactive2.Vector_0(el.offsetLeft, el.offsetTop)); - element = el.offsetParent; - } - return (new interactive2.Vector_0(e.pageX, e.pageY)).minus$0(offset); - } - }, addShape:function (shape) { - { - this.get_shapes().add(shape); - this.set_valid(false); - } - }, clear:function () { - { - this.get_context().fillStyle = '#FFFFFF'; - this.get_context().fillRect(0, 0, this.get_width(), this.get_height()); - this.get_context().strokeStyle = '#000000'; - this.get_context().lineWidth = 4; - this.get_context().strokeRect(0, 0, this.get_width(), this.get_height()); - } - }, draw:function () { - { - var tmp$0; - if (this.get_valid()) - return; - this.clear(); - { - tmp$0 = this.get_shapes().iterator(); - while (tmp$0.hasNext()) { - var shape = tmp$0.next(); - { - shape.draw(this); - } - } - } - this.set_valid(true); - } - } - }); - var Shape = Kotlin.Class.create({initialize:function () { - this.$selected = false; - }, draw:function (state) { - }, contains:function (mousePos) { - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_selected:function () { - return this.$selected; - }, set_selected:function (tmp$0) { - this.$selected = tmp$0; - } - }); - var Creature = Kotlin.Class.create(Shape, {initialize:function (pos, state) { - this.$pos = pos; - this.$state = state; - this.super_init(); - this.$shadowOffset = interactive2.v_0(-5, 5); - this.$colorStops = interactive2.get_gradientGenerator().getNext(); - this.$relSize = 0.05; - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_state:function () { - return this.$state; - }, set_state:function (tmp$0) { - this.$state = tmp$0; - }, get_shadowOffset:function () { - return this.$shadowOffset; - }, get_colorStops:function () { - return this.$colorStops; - }, get_relSize:function () { - return this.$relSize; - }, get_radius:function () { - { - return this.get_state().get_width() * this.get_relSize(); - } - }, get_position:function () { - var tmp$0; - if (this.get_selected()) - tmp$0 = this.get_pos().minus$0(this.get_shadowOffset()); - else - tmp$0 = this.get_pos(); - { - return tmp$0; - } - }, get_directionToLogo:function () { - { - return interactive2.get_JB().get_centre().minus$0(this.get_position()).get_normalized(); - } - }, contains:function (mousePos) { - { - return this.get_pos().distanceTo(mousePos) < this.get_radius(); - } - }, fillCircle:function (receiver, position, rad) { - { - receiver.beginPath(); - receiver.arc(position.get_x(), position.get_y(), rad, 0, 2 * Math.PI, false); - receiver.closePath(); - receiver.fill(); - } - }, draw:function (state) { - { - var context = state.get_context(); - if (!this.get_selected()) { - this.drawCreature(context); - } - else { - this.drawCreatureWithShadow(context); - } - } - }, drawCreature:function (context) { - { - context.fillStyle = this.getGradient(context); - this.fillCircle(context, this.get_position(), this.get_radius()); - this.drawEye(context); - this.drawTail(context); - } - }, getGradient:function (context) { - { - var tmp$0; - var gradientCentre = this.get_position().plus(this.get_directionToLogo().times(this.get_radius() / 4)); - var gradient = context.createRadialGradient(gradientCentre.get_x(), gradientCentre.get_y(), 1, gradientCentre.get_x(), gradientCentre.get_y(), 2 * this.get_radius()); - { - tmp$0 = Kotlin.arrayIterator(this.get_colorStops()); - while (tmp$0.hasNext()) { - var colorStop = tmp$0.next(); - { - gradient.addColorStop(colorStop[0], colorStop[1]); - } - } - } - return gradient; - } - }, drawTail:function (context) { - { - var tailDirection = this.get_directionToLogo().minus(); - var tailPos = this.get_position().plus(tailDirection.times(this.get_radius()).times(0.7)); - var tailSize = this.get_radius() * 1.6; - var angle = Math.PI / 6; - var p1 = tailPos.plus(tailDirection.rotatedBy(angle).times(tailSize)); - var p2 = tailPos.plus(tailDirection.rotatedBy(-angle).times(tailSize)); - context.fillStyle = this.getGradient(context); - context.beginPath(); - context.moveTo(tailPos.get_x(), tailPos.get_y()); - context.lineTo(p1.get_x(), p1.get_y()); - var middlePoint = this.get_position().plus(tailDirection.times(this.get_radius()).times(1)); - context.quadraticCurveTo(middlePoint.get_x(), middlePoint.get_y(), p2.get_x(), p2.get_y()); - context.lineTo(tailPos.get_x(), tailPos.get_y()); - context.closePath(); - context.fill(); - } - }, drawEye:function (context) { - { - var eyePos = this.get_directionToLogo().times(this.get_radius()).times(0.6).plus(this.get_position()); - var eyeRadius = this.get_radius() / 3; - var eyeLidRadius = eyeRadius / 2; - context.fillStyle = '#FFFFFF'; - this.fillCircle(context, eyePos, eyeRadius); - context.fillStyle = '#000000'; - this.fillCircle(context, eyePos, eyeLidRadius); - } - }, drawCreatureWithShadow:function (context) { - { - context.save(); - this.setShadow(context); - context.fillStyle = this.getGradient(context); - this.fillCircle(context, this.get_position(), this.get_radius()); - context.restore(); - this.drawEye(context); - this.drawTail(context); - } - }, setShadow:function (context) { - { - context.shadowColor = 'rgba(100, 100, 100, 0.7)'; - context.shadowBlur = 5; - context.shadowOffsetX = this.get_shadowOffset().get_x(); - context.shadowOffsetY = this.get_shadowOffset().get_y(); - } - } - }); - var Logo = Kotlin.Class.create(Shape, {initialize:function (pos, relSize) { - this.$pos = pos; - this.$relSize = relSize; - this.super_init(); - this.$imageSize = interactive2.v_0(704, 254); - this.$canvasSize = this.get_imageSize().times(this.get_relSize()); - }, get_pos:function () { - return this.$pos; - }, set_pos:function (tmp$0) { - this.$pos = tmp$0; - }, get_relSize:function () { - return this.$relSize; - }, set_relSize:function (tmp$0) { - this.$relSize = tmp$0; - }, get_imageSize:function () { - return this.$imageSize; - }, get_canvasSize:function () { - return this.$canvasSize; - }, draw:function (state) { - { - var context = state.get_context(); - context.drawImage(getKotlinLogo(), 0, 0, this.get_imageSize().get_x(), this.get_imageSize().get_y(), this.get_pos().get_x(), this.get_pos().get_y(), this.get_canvasSize().get_x(), this.get_canvasSize().get_y()); - } - }, contains:function (mousePos) { - { - return mousePos.isInRect(this.get_pos(), this.get_canvasSize()); - } - }, get_centre:function () { - { - return this.get_pos().plus(this.get_canvasSize().times(0.5)); - } - } - }); - return {Shape_0:Shape, Logo_0:Logo, Creature_0:Creature, RadialGradientGenerator_0:RadialGradientGenerator, CanvasState_0:CanvasState, Vector_0:Vector}; - } - (); - var interactive2 = Kotlin.Namespace.create({initialize:function () { - interactive2.$gradientGenerator = new interactive2.RadialGradientGenerator_0(getContext()); - interactive2.$JB = new interactive2.Logo_0(interactive2.v_0(20, 20), 0.3); - }, get_gradientGenerator:function () { - return interactive2.$gradientGenerator; - }, get_JB:function () { - return interactive2.$JB; - }, doWithPeriod:function (period, f) { - { - setInterval(f, period); - } - }, v_0:function (x, y) { - { - return new interactive2.Vector_0(x, y); - } - }, main:function () { - { - var state = new interactive2.CanvasState_0(getCanvas()); - state.addShape(interactive2.get_JB()); - setTimeout(function () { - { - state.set_valid(false); - } - } - ); - } - } - }, classes); - interactive2.initialize(); -} - -var args = []; -interactive2.main(args); diff --git a/js.examples/src/html5/interactive2/jbLogo.png b/js.examples/src/html5/interactive2/jbLogo.png deleted file mode 100644 index 759aa8ae05a..00000000000 Binary files a/js.examples/src/html5/interactive2/jbLogo.png and /dev/null differ diff --git a/js.examples/src/html5/interactive2/main.kt b/js.examples/src/html5/interactive2/main.kt deleted file mode 100644 index e4bacc02865..00000000000 --- a/js.examples/src/html5/interactive2/main.kt +++ /dev/null @@ -1,280 +0,0 @@ -package interactive2; - -import jquery.*; -import html5.*; -import java.util.ArrayList; -import js.*; -import js.Math; -import js.setInterval -import html5.getCanvas -import html5.getKotlinLogo -import jquery.jq -import js.setTimeout - -val gradientGenerator = RadialGradientGenerator(getContext()) -val JB = Logo(v(20.0, 20.0)) - -fun doWithPeriod(period : Int, f : ()->Unit) { - setInterval(f, period); -} - -abstract class Shape() { - abstract fun draw(state : CanvasState); - abstract fun contains(mousePos : Vector) : Boolean; - abstract var pos : Vector; - var selected : Boolean = false; -} - -class Logo(override var pos : Vector, - var relSize : Double = 0.3) - : Shape() -{ - val imageSize = v(704.0, 254.0) - val canvasSize = imageSize * relSize - - override fun draw(state : CanvasState) { - val context = state.context; - context.drawImage(getKotlinLogo(), 0.0, 0.0, imageSize.x, imageSize.y, pos.x, pos.y, canvasSize.x, canvasSize.y) - } - - override fun contains(mousePos: Vector): Boolean = mousePos.isInRect(pos, canvasSize) - - val centre : Vector - get() = pos + canvasSize * 0.5 -} - -class Creature(override var pos : Vector, - var state : CanvasState) : Shape() { - - val shadowOffset = v(-5.0, 5.0) - val colorStops = gradientGenerator.getNext() - val relSize = 0.05; - val radius : Double - get() = state.width * relSize; - - val position : Vector - get() = if (selected) pos - shadowOffset else pos - - val directionToLogo : Vector - get() = (JB.centre - position).normalized - - override fun contains(mousePos : Vector) = pos.distanceTo(mousePos) < radius; - - fun Context.fillCircle(position : Vector, rad : Double) { - beginPath(); - arc(position.x, position.y, rad, 0.0, 2 * Math.PI, false); - closePath(); - fill() - } - - override fun draw(state : CanvasState) { - val context = state.context; - if (!selected) { - drawCreature(context) - } else { - drawCreatureWithShadow(context) - } - } - - fun drawCreature(context : Context) { - context.fillStyle = getGradient(context); - context.fillCircle(position, radius) - drawEye(context) - drawTail(context) - } - - fun getGradient(context : Context) : CanvasGradient { - val gradientCentre = position + directionToLogo * (radius / 4) - val gradient = context.createRadialGradient(gradientCentre.x, gradientCentre.y, 1.0, gradientCentre.x, gradientCentre.y, 2 * radius) - for (colorStop in colorStops) { - gradient.addColorStop(colorStop._1, colorStop._2) - } - return gradient; - } - - fun drawTail(context : Context) { - val tailDirection = -directionToLogo; - val tailPos = position + tailDirection * radius * 0.7 - val tailSize = radius * 1.6 - val angle = Math.PI / 6.0; - val p1 = tailPos + tailDirection.rotatedBy(angle) * tailSize - val p2 = tailPos + tailDirection.rotatedBy(-angle) * tailSize - context.fillStyle = getGradient(context) - context.beginPath() - context.moveTo(tailPos.x, tailPos.y) - context.lineTo(p1.x, p1.y) - val middlePoint = position + tailDirection * radius * 1.0 - context.quadraticCurveTo(middlePoint.x, middlePoint.y, p2.x, p2.y) - context.lineTo(tailPos.x, tailPos.y) - context.closePath() - context.fill() - } - - fun drawEye(context : Context) {; - val eyePos = directionToLogo * radius * 0.6 + position; - val eyeRadius = radius / 3; - val eyeLidRadius = eyeRadius / 2; - context.fillStyle = "#FFFFFF"; - context.fillCircle(eyePos, eyeRadius) - context.fillStyle = "#000000" - context.fillCircle(eyePos, eyeLidRadius) - } - - fun drawCreatureWithShadow(context : Context) { - context.save() - setShadow(context) - context.fillStyle = getGradient(context) - context.fillCircle(position, radius) - context.restore(); - drawEye(context) - drawTail(context) - } - - fun setShadow(context : Context) { - context.shadowColor = "rgba(100, 100, 100, 0.7)"; - context.shadowBlur = 5.0; - context.shadowOffsetX = shadowOffset.x; - context.shadowOffsetY = shadowOffset.y; - } -} - -class CanvasState(val canvas : Canvas) { - val width = canvas.width; - val height = canvas.height; - val context = getContext(); - var valid = false; - var shapes = ArrayList(); - var selection : Shape? = null; - var dragOff = Vector(); - val interval = 1000 / 30; - - { - jq(canvas).mousedown { - valid = false; - selection = null; - val mousePos = mousePos(it); - for (shape in shapes) { - if (mousePos in shape) { - dragOff = mousePos - shape.pos; - shape.selected = true; - selection = shape; - break; - } - } - } - - jq(canvas).mousemove { - if (selection != null) { - selection.sure().pos = mousePos(it) - dragOff; - valid = false; - } - } - - jq(canvas).mouseup { - if (selection != null) { - selection.sure().selected = false; - } - selection = null; - valid = false; - } - - jq(canvas).dblclick { - val redTransparentCircle = Creature(mousePos(it), this @CanvasState); - addShape(redTransparentCircle); - valid = false; - } - - doWithPeriod(interval) { - draw(); - } - } - - fun mousePos(e : MouseEvent) : Vector { - var offset = Vector(); - var element : DomElement? = canvas; - while (element != null) { - val el : DomElement = element.sure(); - offset += Vector(el.offsetLeft, el.offsetTop); - element = el.offsetParent; - } - return Vector(e.pageX, e.pageY) - offset; - } - - fun addShape(shape : Shape) { - shapes.add(shape); - valid = false; - } - - fun clear() { - context.fillStyle = "#FFFFFF" - context.fillRect(0.0, 0.0, width, height) - context.strokeStyle = "#000000" - context.lineWidth = 4.0; - context.strokeRect(0.0, 0.0, width, height) - } - - fun draw() { - if (valid) return - - clear(); - for (shape in shapes) { - shape.draw(this); - } - valid = true; - } -} - -class RadialGradientGenerator(val context : Context) { - val gradients = ArrayList>(); - var current = 0 - - fun newColorStops(vararg colorStops : #(Double, String)) { - gradients.add(colorStops) - } - - { - newColorStops(#(0.0, "#F59898"), #(0.5, "#F57373"), #(1.0, "#DB6B6B")) - newColorStops(#(0.39, "rgb(140,167,209)"), #(0.7, "rgb(104,139,209)"), #(0.85, "rgb(67,122,217)")) - newColorStops(#(0.0, "rgb(255,222,255)"), #(0.5, "rgb(255,185,222)"), #(1.0, "rgb(230,154,185)")) - newColorStops(#(0.0, "rgb(255,209,114)"), #(0.5, "rgb(255,174,81)"), #(1.0, "rgb(241,145,54)")) - newColorStops(#(0.0, "rgb(132,240,135)"), #(0.5, "rgb(91,240,96)"), #(1.0, "rgb(27,245,41)")) - newColorStops(#(0.0, "rgb(250,147,250)"), #(0.5, "rgb(255,80,255)"), #(1.0, "rgb(250,0,217)")) -} - - fun getNext() : Array<#(Double, String)> { - val result = gradients.get(current) - current = (current + 1) % gradients.size() - return result - } -} - -fun v(x : Double, y : Double) = Vector(x, y); - -class Vector(val x : Double = 0.0, val y : Double = 0.0) { - fun plus(v : Vector) = v(x + v.x, y + v.y); - fun minus() = v(-x, -y) - fun minus(v : Vector) = v(x - v.x, y - v.y) - fun times(coef : Double) = v(x * coef, y * coef) - fun distanceTo(v : Vector) = Math.sqrt((this - v).sqr) - fun rotatedBy(theta : Double) : Vector { - val sin = Math.sin(theta) - val cos = Math.cos(theta) - return v(x * cos - y * sin, x * sin + y * cos) - } - - fun isInRect(topLeft : Vector, size : Vector) = (x >= topLeft.x) && (x <= topLeft.x + size.x) && - (y >= topLeft.y) && (y <= topLeft.y + size.y) - - val sqr : Double - get() = x * x + y * y - val normalized : Vector - get() = this * (1.0 / Math.sqrt(sqr)) -} - -fun main() { - val state = CanvasState(getCanvas()); - state.addShape(JB); - setTimeout({ - state.valid = false - }) -} \ No newline at end of file diff --git a/js.examples/src/html5/interactive2/template.html b/js.examples/src/html5/interactive2/template.html deleted file mode 100644 index f7399d7ee00..00000000000 --- a/js.examples/src/html5/interactive2/template.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - - \ No newline at end of file diff --git a/js.lib/jslib.iml b/js.lib/jslib.iml deleted file mode 100644 index d5c07432750..00000000000 --- a/js.lib/jslib.iml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/js.lib/src/core/Dummy.java b/js.lib/src/core/Dummy.java deleted file mode 100644 index 3a72c52114b..00000000000 --- a/js.lib/src/core/Dummy.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package core; - -/** - * @author Pavel Talanov - */ -public final class Dummy { -} diff --git a/js.lib/src/core/annotations.kt b/js.lib/src/core/annotations.kt deleted file mode 100644 index adafe8c4aa9..00000000000 --- a/js.lib/src/core/annotations.kt +++ /dev/null @@ -1,6 +0,0 @@ -package js; - -native -annotation class native(name : String = "") {} -native -annotation class library(name : String = "") {} \ No newline at end of file diff --git a/js.lib/src/core/core.kt b/js.lib/src/core/core.kt deleted file mode 100644 index 8335ca4fa2b..00000000000 --- a/js.lib/src/core/core.kt +++ /dev/null @@ -1,40 +0,0 @@ -package js; - -import js.library -import js.native -import java.util.*; -import java.lang.*; - - - -native -val noImpl : Nothing = throw Exception(); - -library("println") -fun println() {} -library("println") -fun println(s : Any?) {} -library("print") -fun print(s : Any?) {} -library("parseInt") -fun parseInt(s : String) : Int = 0 -library -open class Exception() : Throwable() {} -library -class NumberFormatException() : Exception() {} - -native -fun setTimeout(callback : ()-> Unit) {} - -native -fun setInterval(callback : ()-> Unit, ms : Int) {} -native -fun setInterval(callback : ()-> Unit) {} - - -native -open class DomElement() { - val offsetLeft = 0.0; - val offsetTop = 0.0; - val offsetParent : DomElement? = DomElement(); -} diff --git a/js.lib/src/core/date.kt b/js.lib/src/core/date.kt deleted file mode 100644 index cf551097b6a..00000000000 --- a/js.lib/src/core/date.kt +++ /dev/null @@ -1,6 +0,0 @@ -package js - -native -class Date() { - fun getTime() : Int = js.noImpl -} \ No newline at end of file diff --git a/js.lib/src/core/javalang.kt b/js.lib/src/core/javalang.kt deleted file mode 100644 index cb15d768496..00000000000 --- a/js.lib/src/core/javalang.kt +++ /dev/null @@ -1,12 +0,0 @@ -package java.lang - -import java.util.Iterator; -import js.library - -library -trait Iterable { - fun iterator() : java.util.Iterator = js.noImpl -} - -library("splitString") -public fun String.split(regex : String) : Array = js.noImpl diff --git a/js.lib/src/core/javautil.kt b/js.lib/src/core/javautil.kt deleted file mode 100644 index 954801cbcd6..00000000000 --- a/js.lib/src/core/javautil.kt +++ /dev/null @@ -1,175 +0,0 @@ -package java.util - -import js.*; - - -library("collectionsMax") -public fun max(col : Collection, comp : Comparator) : T = js.noImpl - -library -public trait Comparator { - fun compare(obj1 : T, obj2 : T) : Int; -} - -library("comparator") -public fun comparator(f : (T, T) -> Int) : Comparator = js.noImpl - - -library -public open class Iterator() { - open fun next() : T = js.noImpl - open fun hasNext() : Boolean = js.noImpl -} - -library -val Collections = object { - library("collectionsMax") - public fun max(col : Collection, comp : Comparator) : T = js.noImpl -} - -library -public open class ArrayList() : java.util.List { - override public fun size() : Int = js.noImpl - override public fun isEmpty() : Boolean = js.noImpl - override public fun contains(o : Any?) : Boolean = js.noImpl - override public fun iterator() : Iterator = js.noImpl - // override public fun indexOf(o : Any?) : Int = js.noImpl - // override public fun lastIndexOf(o : Any?) : Int = js.noImpl - // override public fun toArray() : Array = js.noImpl - // override public fun toArray(a : Array) : Array = js.noImpl - override public fun get(index : Int) : E = js.noImpl - override public fun set(index : Int, element : E) : E = js.noImpl - override public fun add(e : E) : Boolean = js.noImpl - override public fun add(index : Int, element : E) : Unit = js.noImpl - override public fun remove(index : Int) : E = js.noImpl - override public fun remove(o : Any?) : Boolean = js.noImpl - override public fun clear() : Unit = js.noImpl - override public fun addAll(c : java.util.Collection) : Boolean = js.noImpl - // override public fun addAll(index : Int, c : java.util.Collection) : Boolean = js.noImpl -} - -library -public trait Collection : java.lang.Iterable { - open fun size() : Int - open fun isEmpty() : Boolean - open fun contains(o : Any?) : Boolean - override fun iterator() : java.util.Iterator - // open fun toArray() : Array - // open fun toArray(a : Array) : Array - open fun add(e : E) : Boolean - open fun remove(o : Any?) : Boolean - //open fun containsAll(c : java.util.Collection<*>) : Boolean - open fun addAll(c : java.util.Collection) : Boolean - //open fun removeAll(c : java.util.Collection<*>) : Boolean - //open fun retainAll(c : java.util.Collection<*>) : Boolean - open fun clear() : Unit -} - -library -public trait List : Collection { - override fun size() : Int - override fun isEmpty() : Boolean - override fun contains(o : Any?) : Boolean - override fun iterator() : java.util.Iterator - // override fun toArray() : Array - // Simulate Java's array covariance - // override fun toArray(a : Array) : Array - override fun add(e : E) : Boolean - override fun remove(o : Any?) : Boolean - // override fun containsAll(c : java.util.Collection<*>) : Boolean - override fun addAll(c : java.util.Collection) : Boolean - // open fun addAll(index : Int, c : java.util.Collection) : Boolean - // override fun removeAll(c : java.util.Collection<*>) : Boolean - // override fun retainAll(c : java.util.Collection<*>) : Boolean - override fun clear() : Unit - open fun get(index : Int) : E - open fun set(index : Int, element : E) : E - open fun add(index : Int, element : E) : Unit - open fun remove(index : Int) : E - // open fun indexOf(o : Any?) : Int - // open fun lastIndexOf(o : Any?) : Int -} - -library -public trait Set : Collection { - override fun size() : Int - override fun isEmpty() : Boolean - override fun contains(o : Any?) : Boolean - override fun iterator() : java.util.Iterator - // override fun toArray() : Array - // override fun toArray(a : Array) : Array - override fun add(e : E) : Boolean - override fun remove(o : Any?) : Boolean - //override fun containsAll(c : java.util.Collection<*>) : Boolean - override fun addAll(c : java.util.Collection) : Boolean - //override fun retainAll(c : java.util.Collection<*>) : Boolean - //override fun removeAll(c : java.util.Collection<*>) : Boolean - override fun clear() : Unit -} - -library -public open class HashSet() : java.util.Set { - override public fun iterator() : java.util.Iterator = js.noImpl - override public fun size() : Int = js.noImpl - override public fun isEmpty() : Boolean = js.noImpl - override public fun contains(o : Any?) : Boolean = js.noImpl - override public fun add(e : E) : Boolean = js.noImpl - override public fun remove(o : Any?) : Boolean = js.noImpl - override public fun clear() : Unit = js.noImpl - override fun addAll(c : java.util.Collection) : Boolean = js.noImpl -} - -library -public trait Map { - open fun size() : Int - open fun isEmpty() : Boolean - open fun containsKey(key : Any?) : Boolean - open fun containsValue(value : Any?) : Boolean - open fun get(key : Any?) : V? - open fun put(key : K, value : V) : V? - open fun remove(key : Any?) : V? - open fun putAll(m : java.util.Map) : Unit - open fun clear() : Unit - open fun keySet() : java.util.Set - open fun values() : java.util.Collection -} - -library -public open class HashMap() : java.util.Map { - override public fun size() : Int = js.noImpl - override public fun isEmpty() : Boolean = js.noImpl - override public fun get(key : Any?) : V = js.noImpl - override public fun containsKey(key : Any?) : Boolean = js.noImpl - override public fun put(key : K, value : V) : V = js.noImpl - override public fun putAll(m : java.util.Map) : Unit = js.noImpl - override public fun remove(key : Any?) : V? = js.noImpl - override public fun clear() : Unit = js.noImpl - override public fun containsValue(value : Any?) : Boolean = js.noImpl - override public fun keySet() : java.util.Set = js.noImpl - override public fun values() : java.util.Collection = js.noImpl -} - -library -public open class LinkedList() : List { - override public fun iterator() : java.util.Iterator = js.noImpl - override public fun isEmpty() : Boolean = js.noImpl - override public fun contains(o : Any?) : Boolean = js.noImpl - override public fun size() : Int = js.noImpl - override public fun add(e : E) : Boolean = js.noImpl - override public fun remove(o : Any?) : Boolean = js.noImpl - override public fun addAll(c : java.util.Collection) : Boolean = js.noImpl - override public fun clear() : Unit = js.noImpl - override public fun get(index : Int) : E = js.noImpl - override public fun set(index : Int, element : E) : E = js.noImpl - override public fun add(index : Int, element : E) : Unit = js.noImpl - override public fun remove(index : Int) : E = js.noImpl - public fun poll() : E? = js.noImpl - public fun peek() : E? = js.noImpl - public fun offer(e : E) : Boolean = js.noImpl -} - -library -public class StringBuilder() { - public fun append(obj : Any) : StringBuilder = js.noImpl - public fun toString() : String = js.noImpl -} \ No newline at end of file diff --git a/js.lib/src/core/json.kt b/js.lib/src/core/json.kt deleted file mode 100644 index df624aad0be..00000000000 --- a/js.lib/src/core/json.kt +++ /dev/null @@ -1,18 +0,0 @@ -package js - -import java.util.*; -import js.library - -native -class Json() { - -} - -library("jsonSet") -fun Json.set(paramName : String, value : Any?) : Unit {} - -library("jsonGet") -fun Json.get(paramName : String) : Any? = null - -library("jsonFromTuples") -fun json(vararg pairs : Tuple2) = Json() diff --git a/js.lib/src/core/math.kt b/js.lib/src/core/math.kt deleted file mode 100644 index 3566b782aa6..00000000000 --- a/js.lib/src/core/math.kt +++ /dev/null @@ -1,32 +0,0 @@ -package js; - -import js.native - -native -class MathClass() { - val PI : Double = 1.0; - fun random() : Double = 0.0; - fun abs(value : Double) = 0.0 - fun acos(value : Double) = 0.0 - fun asin(value : Double) = 0.0 - fun atan(value : Double) = 0.0 - fun atan2(x : Double, y : Double) = 0.0 - fun cos(value : Double) = 0.0 - fun sin(value : Double) = 0.0 - fun exp(value : Double) = 0.0 - fun max(vararg values : Double) = 0.0 - fun max(vararg values : Int) : Int = js.noImpl - fun min(vararg values : Int) : Int = js.noImpl - fun min(vararg values : Double) = 0.0 - fun sqrt(value : Double) = 0.0 - fun tan(value : Double) = 0.0 - fun log(value : Double) = 0.0 - fun pow(base : Double, exp : Double) = 0.0 - fun round(value : Double) = 0.0 - fun floor(value : Double) = 0.0 - fun ceil(value : Double) = 0.0 - -} - -native -val Math = MathClass(); \ No newline at end of file diff --git a/js.lib/src/html5/canvas.kt b/js.lib/src/html5/canvas.kt deleted file mode 100644 index 014de6b0cb2..00000000000 --- a/js.lib/src/html5/canvas.kt +++ /dev/null @@ -1,130 +0,0 @@ -package html5 - -import js.native -import js.DomElement - -native -class Context() { - fun save() { - } - fun restore() { - } - - fun scale(x : Double, y : Double) { - } - fun rotate(angle : Double) { - } - fun translate(x : Double, y : Double) { - } - - fun clearRect(x : Double, y : Double, w : Double, h : Double) { - } - fun fillRect(x : Double, y : Double, w : Double, h : Double) { - } - fun strokeRect(x : Double, y : Double, w : Double, h : Double) { - } - - var globalAlpha : Double = 1.0; - var strokeStyle : Any = "" - var fillStyle : Any = "" - var lineWidth : Double = 1.0 - var shadowOffsetX : Double = 0.0 - var shadowOffsetY : Double = 0.0 - var shadowBlur : Double = 0.0 - var shadowColor : String = "" - var font : String = "" - - fun beginPath() { - } - fun moveTo(x : Double, y : Double) { - } - fun closePath() { - } - - fun lineTo(x : Double, y : Double) { - } - fun quadraticCurveTo(cpx : Double, cpy : Double, x : Double, y : Double) { - } - fun bezierCurveTo(cp1x : Double, cp1y : Double, cp2x : Double, cp2y : Double, x : Double, y : Double) { - } - fun arcTo(x1 : Double, y1 : Double, x2 : Double, y2 : Double, radius : Double) { - } - fun arc(x : Double, y : Double, radius : Double, startAngle : Double, endAngle : Double, anticlockwise : Boolean) { - } - - fun rect(x : Double, y : Double, w : Double, h : Double) { - } - fun fill() { - } - fun stroke() { - } - - fun fillText(text : String, x : Double, y : Double) { - } - fun fillText(text : String, x : Double, y : Double, maxWidth : Double) { - } - fun strokeText(text : String, x : Double, y : Double) { - } - fun strokeText(text : String, x : Double, y : Double, maxWidth : Double) { - } - - fun measureText(text : String) : TextMetrics = TextMetrics(); - - fun drawImage(image : HTMLImageElement, dx : Double, dy : Double) { - } - fun drawImage(image : HTMLImageElement, dx: Double, dy: Double, dw: Double, dh: Double) { - } - fun drawImage(image : HTMLImageElement, sx: Double, sy: Double, - sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { - } - - fun createLinearGradient(x0 : Double, y0 : Double, x1 : Double, y1 : Double) : CanvasGradient = CanvasGradient() - fun createRadialGradient(x0 : Double, y0 : Double, r0 : Double, x1 : Double, y1 : Double, r1 : Double) : CanvasGradient = CanvasGradient(); - - fun getImageData(sx : Int, sy : Int, sw : Int, sh : Int) : ImageData = js.noImpl - fun putImageData(data : ImageData, dx : Int, dy : Int) : Unit = js.noImpl -} - -native -open class HTMLImageElement() : DomElement() { -} - -native -class CanvasGradient() { - fun addColorStop(offset : Double, color : String) { - } -} - -native -class ImageData() { - // readonly attribute unsigned long width; - // readonly attribute unsigned long height; - // readonly attribute Uint8ClampedArray data; - val width : Int = js.noImpl - val height : Int = js.noImpl - val data : Array = js.noImpl -} - - -native -class Canvas() : DomElement() { - var width : Int = js.noImpl; - var height : Int = js.noImpl; - - //DOMString toDataURL(in optional DOMString type, in any... args); - fun toDataURL() : String = js.noImpl - fun toDataURL(typ : String) : String = js.noImpl -} - -native -class TextMetrics() { - val width : Int = 0 -} - -/*custom helpers*/ -native -fun getContext() : Context = Context(); -native -fun getCanvas() : Canvas = Canvas(); -native -fun getKotlinLogo() : HTMLImageElement = HTMLImageElement(); \ No newline at end of file diff --git a/js.lib/src/html5/files.kt b/js.lib/src/html5/files.kt deleted file mode 100644 index 8e05d2af4ef..00000000000 --- a/js.lib/src/html5/files.kt +++ /dev/null @@ -1,37 +0,0 @@ -package html5.files - -import js.native - -native -class FileReader() { - var onloadend : ((FileReaderEvent)->Unit)? = js.noImpl // - fun readAsDataURL(blob : Blob) = js.noImpl - val result : File = js.noImpl -} - -native -class FileReaderEvent() { - val target : FileReader = js.noImpl -} - -native -class FileList() { - fun item(index : Int) : File? = js.noImpl - val length : Int = js.noImpl -} - -native -class File() : Blob() { - val name : String = js.noImpl - // readonly attribute Date lastModifiedDate; -} - -native -open class Blob() { - val size : Int = js.noImpl - val `type` : String = js.noImpl - //Blob slice(optional long long start, - //optional long long end, - //optional DOMString contentType); - // -} diff --git a/js.lib/src/html5/image.kt b/js.lib/src/html5/image.kt deleted file mode 100644 index dc1ec502959..00000000000 --- a/js.lib/src/html5/image.kt +++ /dev/null @@ -1,25 +0,0 @@ -package html5 - -import js.Exception -import js.native -import js.DomElement -import html5.files.FileList - -native -class HTMLInputElement() : DomElement() { - val files : FileList = js.noImpl - var onchange : (HTMLInputElementEvent)->Unit = js.noImpl -} - -native -class HTMLInputElementEvent() { - val target : HTMLInputElement = js.noImpl -} - -native -class Image() : HTMLImageElement() { - var height : Int = js.noImpl - var width : Int = js.noImpl - var src : String = js.noImpl - var onload : ()->Unit = js.noImpl -} \ No newline at end of file diff --git a/js.lib/src/jquery/common.kt b/js.lib/src/jquery/common.kt deleted file mode 100644 index 54ad3feb9dd..00000000000 --- a/js.lib/src/jquery/common.kt +++ /dev/null @@ -1,72 +0,0 @@ -package jquery; - -import js.*; -import js.DomElement - -native -class JQuery() { - fun addClass(className : String) : JQuery = js.noImpl; - fun addClass(f : DomElement.(Int, String)->String) = js.noImpl; - - fun attr(attrName : String) = ""; - fun attr(attrName : String, value : String) = this; - - fun html() : String = ""; - fun html(s : String) = this; - fun html(f : DomElement.(Int, String)->String) = this; - - - fun hasClass(className : String) = true - fun removeClass(className : String) = this - fun height() = 0 - fun width() = 0 - - fun click() = this; - - fun mousedown(handler : DomElement.(MouseEvent)->Unit) = this; - fun mouseup(handler : DomElement.(MouseEvent)->Unit) = this; - fun mousemove(handler : DomElement.(MouseEvent)->Unit) = this; - - fun dblclick(handler : DomElement.(MouseClickEvent)->Unit) = this; - fun click(handler : DomElement.(MouseClickEvent)->Unit) = this; - - fun load(handler : DomElement.()->Unit) = this; - fun change(handler : DomElement.()->Unit) = this; - - fun append(str : String) = this; - fun ready(handler : ()->Unit) = this; - fun text(text : String) = this; - fun slideUp() = this; - fun hover(handlerInOut : DomElement.() -> Unit) = this; - fun hover(handlerIn : DomElement.() -> Unit, handlerOut : DomElement.() -> Unit) = this; - fun next() : JQuery = js.noImpl - fun parent() : JQuery = js.noImpl -} - -native -open class MouseEvent() { - val pageX : Double = 0.0; - val pageY : Double = 0.0; - fun preventDefault() {} - fun isDefaultPrevented() : Boolean = true; -} - -native -class MouseClickEvent() : MouseEvent() { - val which : Int = 0; -} - - - -native("$") -fun jq(selector : String) = JQuery(); -native("$") -fun jq(selector : String, context : DomElement) = JQuery(); -native("$") -fun jq(callback : () -> Unit) = JQuery(); -native("$") -fun jq(obj : JQuery) = JQuery(); -native("$") -fun jq(el : DomElement) = JQuery(); -native("$") -fun jq() = JQuery(); diff --git a/js.lib/src/jquery/ui.kt b/js.lib/src/jquery/ui.kt deleted file mode 100644 index ffccbe1f983..00000000000 --- a/js.lib/src/jquery/ui.kt +++ /dev/null @@ -1,20 +0,0 @@ -package jquery.ui - - -//jquery UI -import jquery.JQuery -import js.native -import js.Json - -native -fun JQuery.buttonset() : JQuery = js.noImpl; -native -fun JQuery.dialog() : JQuery = js.noImpl; -native -fun JQuery.button() : JQuery = js.noImpl; -native -fun JQuery.accordion() : JQuery = js.noImpl -native -fun JQuery.draggable(params : Json) : JQuery = js.noImpl -native -fun JQuery.selectable() : JQuery = js.noImpl diff --git a/js.lib/src/raphael/raphael.kt b/js.lib/src/raphael/raphael.kt deleted file mode 100644 index ef74659206b..00000000000 --- a/js.lib/src/raphael/raphael.kt +++ /dev/null @@ -1,63 +0,0 @@ -package raphael - -import js.*; -import js.*; - -native -open class Element() { - - fun attr(name : String, value : Any?) : Element = this - fun attr(nameToValue : Json) : Element = this - - fun click(handler : Element.()-> Unit) = this; - - fun mouseover(handler : Element.() -> Unit) = this - fun mouseout(handler : Element.() -> Unit) = this - - - fun getTotalLength() : Double = 0.0 - fun getPointAtLength(length : Double) : Point = js.noImpl - - fun animate(params : Json, ms : Int, callback : ()-> Unit) : Element = js.noImpl - fun animate(params : Json, ms : Int, s : String) : Element = js.noImpl - fun animate(params : Json, ms : Int) : Element = js.noImpl - //fun mouse -} - -native -class Set() : Element() { - fun push(el : Element) = js.noImpl -} - -native -class Paper() { - fun path(pathString : String) : Element = Element(); - fun path() : Element = Element(); - - fun ellipse(x : Int, y : Int, rx : Int, ry : Int) : Element = js.noImpl - fun circle(x : Int, y : Int, r : Int) : Element = js.noImpl - fun set() : Set = js.noImpl - - val customAttributes : Json = Json(); -} - -native("Raphael") -fun Raphael(elementId : String, width : Int, height : Int) : Paper = Paper(); -native("Raphael") -fun Raphael(elementId : String, width : Int, height : Int, initFun : Paper.() -> Unit) : Unit = js.noImpl - -native -fun getColor() : Color = js.noImpl -native -fun resetColors() = js.noImpl - -native -class Color() { -} - -native -class Point() { - val x = 0 - val y = 0 - val alpha = 0 -} diff --git a/js.tests/js.tests.iml b/js.tests/js.tests.iml deleted file mode 100644 index e25eea390b5..00000000000 --- a/js.tests/js.tests.iml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/js.tests/test/org/jetbrains/k2js/test/AbstractExpressionTest.java b/js.tests/test/org/jetbrains/k2js/test/AbstractExpressionTest.java deleted file mode 100644 index 95f3eb9bbb0..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/AbstractExpressionTest.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public abstract class AbstractExpressionTest extends TranslationTest { - - private final String SUITE = "expression/"; - - @Override - protected String suiteDirectoryName() { - return SUITE; - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/ArrayListTest.java b/js.tests/test/org/jetbrains/k2js/test/ArrayListTest.java deleted file mode 100644 index 7e3f7506cab..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/ArrayListTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.mozilla.javascript.JavaScriptException; - -/** - * @author Pavel Talanov - */ -public final class ArrayListTest extends JavaClassesTest { - - final private static String MAIN = "arrayList/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testEmptyList() throws Exception { - testFooBoxIsTrue("emptyList.kt"); - } - - public void testAccess() throws Exception { - testFooBoxIsTrue("access.kt"); - } - - public void testIsEmpty() throws Exception { - testFooBoxIsTrue("isEmpty.kt"); - } - - public void testArrayAccess() throws Exception { - testFooBoxIsTrue("arrayAccess.kt"); - } - - public void testIterate() throws Exception { - testFooBoxIsTrue("iterate.kt"); - } - - public void testRemove() throws Exception { - testFooBoxIsTrue("remove.kt"); - } - - public void testIndexOOB() throws Exception { - try { - testFooBoxIsTrue("indexOOB.kt"); - fail(); - } catch (JavaScriptException e) { - - } - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/BaseTest.java b/js.tests/test/org/jetbrains/k2js/test/BaseTest.java deleted file mode 100644 index 71875def517..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/BaseTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import com.intellij.openapi.project.Project; -import com.intellij.testFramework.UsefulTestCase; -import org.jetbrains.annotations.NonNls; -import org.jetbrains.jet.JetTestUtils; -import org.jetbrains.jet.compiler.JetCoreEnvironment; - -/** - * @author Pavel Talanov - */ -public abstract class BaseTest extends UsefulTestCase { - @NonNls - protected JetCoreEnvironment myEnvironment; - - public Project getProject() { - return myEnvironment.getProject(); - } - - @Override - protected void setUp() throws Exception { - super.setUp(); - // createEnvironmentWithMockJdk(); - } - - @Override - protected void tearDown() throws Exception { - myEnvironment = null; - super.tearDown(); - } - - protected void createEnvironmentWithMockJdk() { - myEnvironment = JetTestUtils.createEnvironmentWithMockJdk(getTestRootDisposable()); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/BasicClassTest.java b/js.tests/test/org/jetbrains/k2js/test/BasicClassTest.java deleted file mode 100644 index 29df4e4922c..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/BasicClassTest.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -//TODO: remove class -public class BasicClassTest extends TranslationTest { - - final private static String MAIN = "class/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testClassWithoutNamespace() throws Exception { - testFunctionOutput("classWithoutNamespace.kt", "Anonymous", "box", true); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/ClassInheritanceTest.java b/js.tests/test/org/jetbrains/k2js/test/ClassInheritanceTest.java deleted file mode 100644 index ed2d3369c68..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/ClassInheritanceTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class ClassInheritanceTest extends TranslationTest { - - final private static String MAIN = "inheritance/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testInitializersOfBasicClassExecute() throws Exception { - testFunctionOutput("initializersOfBasicClassExecute.kt", "foo", "box", 3); - } - - public void testMethodOverride() throws Exception { - testFooBoxIsTrue("methodOverride.kt"); - } - - public void testInitializationOrder() throws Exception { - testFooBoxIsTrue("initializationOrder.kt"); - } - - public void testComplexInitializationOrder() throws Exception { - testFooBoxIsTrue("complexInitializationOrder.kt"); - } - - public void testValuePassedToAncestorConstructor() throws Exception { - testFooBoxIsTrue("valuePassedToAncestorConstructor.kt"); - } - - public void testBaseClassDefinedAfterDerived() throws Exception { - testFooBoxIsTrue("baseClassDefinedAfterDerived.kt"); - } - - public void testDefinitionOrder() throws Exception { - testFooBoxIsTrue("definitionOrder.kt"); - } -} - - diff --git a/js.tests/test/org/jetbrains/k2js/test/ConditionalTest.java b/js.tests/test/org/jetbrains/k2js/test/ConditionalTest.java deleted file mode 100644 index 8eaec5f933c..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/ConditionalTest.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.mozilla.javascript.JavaScriptException; - -/** - * @author Pavel Talanov - */ -//TODO: remove class -public class ConditionalTest extends AbstractExpressionTest { - - final private static String MAIN = "conditional/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testIfElseAsExpressionWithThrow() throws Exception { - try { - testFooBoxIsTrue("ifAsExpressionWithThrow.kt"); - fail(); - } catch (JavaScriptException e) { - - } - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/ExampleTestSuite.java b/js.tests/test/org/jetbrains/k2js/test/ExampleTestSuite.java deleted file mode 100644 index 329f749e1da..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/ExampleTestSuite.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import com.intellij.testFramework.UsefulTestCase; -import junit.framework.Test; -import org.jetbrains.annotations.NotNull; - -public final class ExampleTestSuite extends UsefulTestCase { - - public static Test suite() { - return Suite.suiteForDirectory("examples/", new Suite.SingleFileTester() { - @Override - public void performTest(@NotNull Suite test, @NotNull String filename) throws Exception { - test.testFunctionOutput(filename, "Anonymous", "box", "OK"); - } - }); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/ExtensionFunctionTest.java b/js.tests/test/org/jetbrains/k2js/test/ExtensionFunctionTest.java deleted file mode 100644 index 783d67f71ec..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/ExtensionFunctionTest.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class ExtensionFunctionTest extends TranslationTest { - final private static String MAIN = "extensionFunction/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testIntExtension() throws Exception { - testFooBoxIsTrue("intExtension.kt"); - } - - public void testExtensionWithImplicitReceiver() throws Exception { - testFooBoxIsTrue("extensionWithImplicitReceiver.kt"); - } - - public void testExtensionFunctionOnExpression() throws Exception { - testFooBoxIsTrue("extensionFunctionOnExpression.kt"); - } - - public void testExtensionUsedInsideClass() throws Exception { - testFooBoxIsTrue("extensionUsedInsideClass.kt"); - } - - public void testVirtualExtension() throws Exception { - testFooBoxIsTrue("virtualExtension.kt"); - } - - public void testVirtualExtensionOverride() throws Exception { - testFooBoxIsTrue("virtualExtensionOverride.kt"); - } - - public void testExtensionLiteralPassedToFunction() throws Exception { - testFooBoxIsTrue("extensionLiteralPassedToFunction.kt"); - } - - public void testExtensionInsideFunctionLiteral() throws Exception { - testFooBoxIsTrue("extensionInsideFunctionLiteral.kt"); - } - - public void testGenericExtension() throws Exception { - testFooBoxIsOk("generic.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/ExtensionPropertyTest.java b/js.tests/test/org/jetbrains/k2js/test/ExtensionPropertyTest.java deleted file mode 100644 index 983dd8ab86f..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/ExtensionPropertyTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class ExtensionPropertyTest extends TranslationTest { - final private static String MAIN = "extensionProperty/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testSimplePropertyWithGetter() throws Exception { - testFooBoxIsTrue("simplePropertyWithGetter.kt"); - } - - public void testPropertyWithGetterAndSetter() throws Exception { - testFooBoxIsTrue("propertyWithGetterAndSetter.kt"); - } - - public void testAbsExtension() throws Exception { - testFooBoxIsTrue("absExtension.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/ForTest.java b/js.tests/test/org/jetbrains/k2js/test/ForTest.java deleted file mode 100644 index 6c469fc070e..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/ForTest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class ForTest extends AbstractExpressionTest { - - final private static String MAIN = "for/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testForIteratesOverArray() throws Exception { - testFooBoxIsTrue("forIteratesOverArray.kt"); - } - - public void testForOnEmptyArray() throws Exception { - testFooBoxIsTrue("forOnEmptyArray.kt"); - } -} \ No newline at end of file diff --git a/js.tests/test/org/jetbrains/k2js/test/FunctionTest.java b/js.tests/test/org/jetbrains/k2js/test/FunctionTest.java deleted file mode 100644 index c339e7343af..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/FunctionTest.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public class FunctionTest extends AbstractExpressionTest { - - final private static String MAIN = "function/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testFunctionUsedBeforeDeclaration() throws Exception { - testFooBoxIsTrue("functionUsedBeforeDeclaration.kt"); - } - - public void testFunctionWithTwoParametersCall() throws Exception { - testFooBoxIsTrue("functionWithTwoParametersCall.kt"); - } - - public void testFunctionLiteral() throws Exception { - testFooBoxIsTrue("functionLiteral.kt"); - } - - public void testAdderClosure() throws Exception { - testFooBoxIsTrue("adderClosure.kt"); - } - - public void testLoopClosure() throws Exception { - testFooBoxIsTrue("loopClosure.kt"); - } - - public void testFunctionLiteralAsParameter() throws Exception { - testFooBoxIsTrue("functionLiteralAsParameter.kt"); - } - - public void testClosureWithParameter() throws Exception { - testFooBoxIsOk("closureWithParameter.kt"); - } - - public void testClosureWithParameterAndBoxing() throws Exception { - testFooBoxIsOk("closureWithParameterAndBoxing.jet"); - } - - public void testEnclosingThis() throws Exception { - testFunctionOutput("enclosingThis.kt", "Anonymous", "box", "OK"); - } - - - public void testImplicitItParameter() throws Exception { - testFooBoxIsTrue("implicitItParameter.kt"); - } - - - public void testDefaultParameters() throws Exception { - testFooBoxIsTrue("defaultParameters.kt"); - } - - - public void testFunctionLiteralAsLastParameter() throws Exception { - testFooBoxIsTrue("functionLiteralAsLastParameter.kt"); - } - - - public void testNamedArguments() throws Exception { - testFooBoxIsTrue("namedArguments.kt"); - } - - - public void testExpressionAsFunction() throws Exception { - testFooBoxIsTrue("expressionAsFunction.kt"); - } - - - public void testVararg() throws Exception { - testFooBoxIsTrue("vararg.kt"); - } - - - public void testkt921() throws Exception { - try { - checkOutput("KT-921.kt", ""); - } catch (Throwable e) { - System.out.println(e); - } - } - - public void testFunctionInsideFunction() throws Exception { - testFooBoxIsTrue("functionInsideFunction.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/JavaClassesTest.java b/js.tests/test/org/jetbrains/k2js/test/JavaClassesTest.java deleted file mode 100644 index 7f66ee62d5c..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/JavaClassesTest.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -@SuppressWarnings("FieldCanBeLocal") -public abstract class JavaClassesTest extends TranslationTest { - - private final String SUITE = "java/"; - - @Override - protected String suiteDirectoryName() { - return SUITE; - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/KotlinLibTest.java b/js.tests/test/org/jetbrains/k2js/test/KotlinLibTest.java deleted file mode 100644 index ea94e687ba9..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/KotlinLibTest.java +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.mozilla.javascript.Context; -import org.mozilla.javascript.Scriptable; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * @author Pavel Talanov - */ -public final class KotlinLibTest extends TranslationTest { - - final private static String MAIN = "kotlinLib/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - private void runPropertyTypeCheck(String objectName, Map> propertyToType) - throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath()), new RhinoPropertyTypesChecker(objectName, propertyToType)); - } - - - public void testKotlinJsLibRunsWithRhino() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath()), new RhinoResultChecker() { - @Override - public void runChecks(Context context, Scriptable scope) throws Exception { - //do nothing - } - }); - } - - //TODO: refactor - public void testCreatedTraitIsJSObject() throws Exception { - final Map> propertyToType - = new HashMap>(); - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("trait.js")), - new RhinoPropertyTypesChecker("foo", propertyToType)); - } - - - public void testCreatedNamespaceIsJSObject() throws Exception { - final Map> propertyToType - = new HashMap>(); - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("namespace.js")), - new RhinoPropertyTypesChecker("foo", propertyToType)); - } - - // - // TODO:Refactor calls to function result checker with test - public void testNamespaceHasDeclaredFunction() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("namespace.js")), - new RhinoFunctionResultChecker("test", true)); - } - - - public void testNamespaceHasDeclaredClasses() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("namespaceWithClasses.js")), - new RhinoFunctionResultChecker("test", true)); - } - - - public void testIsSameType() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("isSameType.js")), - new RhinoFunctionResultChecker("test", true)); - } - - - public void testIsAncestorType() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("isAncestorType.js")), - new RhinoFunctionResultChecker("test", true)); - } - - - public void testIsComplexTest() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("isComplexTest.js")), - new RhinoFunctionResultChecker("test", true)); - } - - - public void testCommaExpression() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("commaExpression.js")), - new RhinoFunctionResultChecker("test", true)); - } - - - public void testArray() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("array.js")), - new RhinoFunctionResultChecker("test", true)); - } - - - public void testHashMap() throws Exception { - runRhinoTest(Arrays.asList(kotlinLibraryPath(), cases("hashMap.js")), - new RhinoFunctionResultChecker("test", true)); - } - -} diff --git a/js.tests/test/org/jetbrains/k2js/test/MiscTest.java b/js.tests/test/org/jetbrains/k2js/test/MiscTest.java deleted file mode 100644 index d56a8371b78..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/MiscTest.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - *

- * This class contains tests that do not fall in any particular category - * most probably because that functionality has very little support - */ -public final class MiscTest extends AbstractExpressionTest { - final private static String MAIN = "misc/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testLocalPropertys() throws Exception { - testFunctionOutput("localProperty.jet", "foo", "box", 50); - } - - public void testIntRange() throws Exception { - // checkOutput("intRange.kt", " "); - testFooBoxIsTrue("intRange.kt"); - } - - - public void testSafecallComputesExpressionOnlyOnce() throws Exception { - testFooBoxIsTrue("safecallComputesExpressionOnlyOnce.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/MultiFileTest.java b/js.tests/test/org/jetbrains/k2js/test/MultiFileTest.java deleted file mode 100644 index 76738d49285..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/MultiFileTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class MultiFileTest extends TranslationTest { - - final private static String MAIN = "multiFile/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testFunctionsVisibleFromOtherFile() throws Exception { - testFooBoxIsTrue("functionsVisibleFromOtherFile"); - } - - public void testClassesInheritedFromOtherFile() throws Exception { - testFooBoxIsTrue("classesInheritedFromOtherFile"); - } - - @Override - public void testFooBoxIsTrue(String dirName) throws Exception { - testMultiFile(dirName, "foo", "box", true); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/MultiNamespaceTest.java b/js.tests/test/org/jetbrains/k2js/test/MultiNamespaceTest.java deleted file mode 100644 index 8d7d473d636..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/MultiNamespaceTest.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public class MultiNamespaceTest extends TranslationTest { - final private static String MAIN = "multiNamespace/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testFunctionsVisibleFromOtherNamespace() throws Exception { - testFooBoxIsTrue("functionsVisibleFromOtherNamespace"); - } - - public void testClassesInheritedFromOtherNamespace() throws Exception { - testFooBoxIsTrue("classesInheritedFromOtherNamespace"); - } - - @Override - public void testFooBoxIsTrue(String dirName) throws Exception { - testMultiFile(dirName, "foo", "box", true); - } -} - diff --git a/js.tests/test/org/jetbrains/k2js/test/NameClashesTest.java b/js.tests/test/org/jetbrains/k2js/test/NameClashesTest.java deleted file mode 100644 index 67f563d2430..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/NameClashesTest.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class NameClashesTest extends TranslationTest { - - private static final String MAIN = "nameClashes/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testMethodOverload() throws Exception { - testFooBoxIsTrue("methodOverload.kt"); - } -} \ No newline at end of file diff --git a/js.tests/test/org/jetbrains/k2js/test/ObjectTest.java b/js.tests/test/org/jetbrains/k2js/test/ObjectTest.java deleted file mode 100644 index f0824057fdc..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/ObjectTest.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class ObjectTest extends TranslationTest { - - private static final String MAIN = "object/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - - public void testObjectWithMethods() throws Exception { - testFooBoxIsTrue("objectWithMethods.kt"); - } - - - public void testObjectDeclaration() throws Exception { - testFooBoxIsTrue("objectDeclaration.kt"); - } - - - public void testObjectInMethod() throws Exception { - testFooBoxIsTrue("objectInMethod.kt"); - } -} \ No newline at end of file diff --git a/js.tests/test/org/jetbrains/k2js/test/OperatorOverloadingTest.java b/js.tests/test/org/jetbrains/k2js/test/OperatorOverloadingTest.java deleted file mode 100644 index d36e34ed211..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/OperatorOverloadingTest.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class OperatorOverloadingTest extends TranslationTest { - - final private static String MAIN = "operatorOverloading/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - - public void testPlusOverload() throws Exception { - testFooBoxIsTrue("plusOverload.kt"); - } - - - public void testPostfixInc() throws Exception { - testFooBoxIsTrue("postfixIncOverload.kt"); - } - - - public void testPrefixDecOverload() throws Exception { - testFooBoxIsTrue("prefixDecOverload.kt"); - } - - - public void testPrefixIncReturnsCorrectValue() throws Exception { - testFooBoxIsTrue("prefixIncReturnsCorrectValue.kt"); - } - - - public void testOverloadedCallOnProperty() throws Exception { - testFooBoxIsTrue("overloadedCallOnProperty.kt"); - } - - - public void testPostfixOnProperty() throws Exception { - testFooBoxIsTrue("postfixOnProperty.kt"); - } - - - public void testOperatorOverloadOnPropertyCallGetterAndSetterOnlyOnce() throws Exception { - testFooBoxIsTrue("operatorOverloadOnPropertyCallGetterAndSetterOnlyOnce.kt"); - } - - - public void testUnaryOnIntProperty() throws Exception { - testFooBoxIsTrue("unaryOnIntProperty.kt"); - } - - - public void testUnaryOnIntPropertyAsStatement() throws Exception { - testFooBoxIsTrue("unaryOnIntProperty2.kt"); - } - - - public void testBinaryDivOverload() throws Exception { - testFooBoxIsTrue("binaryDivOverload.kt"); - } - - - public void testPlusAssignNoReassign() throws Exception { - testFooBoxIsTrue("plusAssignNoReassign.kt"); - } - - public void testNotOverload() throws Exception { - testFooBoxIsTrue("notOverload.kt"); - } - - - public void testCompareTo() throws Exception { - testFooBoxIsTrue("compareTo.kt"); - } - - - public void testPlusAndMinusAsAnExpression() throws Exception { - testFooBoxIsTrue("plusAndMinusAsAnExpression.kt"); - } - - - public void testUsingModInCaseModAssignNotAvailable() throws Exception { - testFooBoxIsTrue("usingModInCaseModAssignNotAvailable.kt"); - } - - public void testOverloadPlusAssignArrayList() throws Exception { - testFooBoxIsOk("overloadPlusAssignArrayList.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/PatternMatchingTest.java b/js.tests/test/org/jetbrains/k2js/test/PatternMatchingTest.java deleted file mode 100644 index d9ff84c1b0e..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/PatternMatchingTest.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.mozilla.javascript.JavaScriptException; - -/** - * @author Pavel Talanov - */ -public final class PatternMatchingTest extends TranslationTest { - - final private static String MAIN = "patternMatching/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - - public void testWhenType() throws Exception { - testFooBoxIsTrue("whenType.kt"); - } - - - public void testWhenNotType() throws Exception { - testFooBoxIsTrue("whenNotType.kt"); - } - - - public void testWhenExecutesOnlyOnce() throws Exception { - testFooBoxIsTrue("whenExecutesOnlyOnce.kt"); - } - - - public void testWhenValue() throws Exception { - testFooBoxIsTrue("whenValue.kt"); - } - - - public void testWhenNotValue() throws Exception { - testFooBoxIsTrue("whenNotValue.kt"); - } - - - public void testWhenValueOrType() throws Exception { - testFooBoxIsTrue("whenValueOrType.kt"); - } - - - public void testWhenWithIf() throws Exception { - testFooBoxIsTrue("whenWithIf.kt"); - } - - - public void testMultipleCases() throws Exception { - testFunctionOutput("multipleCases.kt", "foo", "box", 2.0); - } - - - public void testMatchNullableType() throws Exception { - testFooBoxIsTrue("matchNullableType.kt"); - } - - - public void testWhenAsExpression() throws Exception { - testFooBoxIsTrue("whenAsExpression.kt"); - } - - public void whenAsExpressionWithThrow() throws Exception { - try { - testFooBoxIsTrue("whenAsExpressionWithThrow.kt"); - fail(); - } catch (JavaScriptException e) { - } - } -} \ No newline at end of file diff --git a/js.tests/test/org/jetbrains/k2js/test/PropertyAccessTest.java b/js.tests/test/org/jetbrains/k2js/test/PropertyAccessTest.java deleted file mode 100644 index d08b4b1dd52..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/PropertyAccessTest.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class PropertyAccessTest extends TranslationTest { - - final private static String MAIN = "propertyAccess/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - - public void testAccessToInstanceProperty() throws Exception { - testFooBoxIsTrue("accessToInstanceProperty.kt"); - } - - - public void testTwoClassesWithProperties() throws Exception { - testFooBoxIsTrue("twoClassesWithProperties.kt"); - } - - - public void testSetter() throws Exception { - testFunctionOutput("setter.kt", "foo", "f", 99.0); - } - - - public void testCustomGetter() throws Exception { - testFooBoxIsTrue("customGetter.kt"); - } - - - public void testCustomSetter() throws Exception { - testFooBoxIsTrue("customSetter.kt"); - } - - - public void testSafeCall() throws Exception { - testFooBoxIsTrue("safeCall.kt"); - } - - - //TODO: place safecalls under distinkt category - public void testSafeCallReturnsNullIfFails() throws Exception { - testFooBoxIsTrue("safeCallReturnsNullIfFails.kt"); - } - - - public void testNamespacePropertyInitializer() throws Exception { - testFooBoxIsTrue("namespacePropertyInitializer.kt"); - } - - - public void testNamespacePropertySet() throws Exception { - testFooBoxIsTrue("namespacePropertySet.kt"); - } - - public void testNamespaceCustomAccessors() throws Exception { - testFooBoxIsTrue("namespaceCustomAccessors.kt"); - } - - - public void testClassUsesNamespaceProperties() throws Exception { - testFooBoxIsTrue("classUsesNamespaceProperties.kt"); - } - - - public void testSafeAccess() throws Exception { - testFooBoxIsTrue("safeAccess.kt"); - } - - public void testSafeExtensionFunctionCall() throws Exception { - testFooBoxIsOk("safeExtensionFunctionCall.kt"); - } - - public void testExtensionLiteralSafeCall() throws Exception { - testFooBoxIsTrue("extensionLiteralSafeCall.kt"); - } - -} diff --git a/js.tests/test/org/jetbrains/k2js/test/RTTITest.java b/js.tests/test/org/jetbrains/k2js/test/RTTITest.java deleted file mode 100644 index 03ea3e85b9c..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/RTTITest.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public class RTTITest extends TranslationTest { - - final private static String MAIN = "rtti/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testIsSameClass() throws Exception { - testFooBoxIsTrue("isSameClass.kt"); - } - - public void testNotIsOtherClass() throws Exception { - testFooBoxIsTrue("notIsOtherClass.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/RangeTest.java b/js.tests/test/org/jetbrains/k2js/test/RangeTest.java deleted file mode 100644 index fe3b89d2756..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/RangeTest.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class RangeTest extends TranslationTest { - - final private static String MAIN = "range/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - - public void testExplicitRange() throws Exception { - testFooBoxIsTrue("explicitRange.kt"); - } - - - public void testRangeSugarSyntax() throws Exception { - testFooBoxIsTrue("rangeSugarSyntax.kt"); - } - - - public void testIntInRange() throws Exception { - testFooBoxIsTrue("intInRange.kt"); - } - - public void testIteratingOverRanges() throws Exception { - testFooBoxIsTrue("iteratingOverRanges.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/RhinoFunctionResultChecker.java b/js.tests/test/org/jetbrains/k2js/test/RhinoFunctionResultChecker.java deleted file mode 100644 index 5bd63ab7f78..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/RhinoFunctionResultChecker.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.jetbrains.annotations.Nullable; -import org.mozilla.javascript.Context; -import org.mozilla.javascript.Scriptable; - -import static org.junit.Assert.assertTrue; - -/** - * @author Pavel Talanov - */ -public final class RhinoFunctionResultChecker implements RhinoResultChecker { - - private final String namespaceName; - private final String functionName; - private final Object expectedResult; - - public RhinoFunctionResultChecker(@Nullable String namespaceName, String functionName, Object expectedResult) { - this.namespaceName = namespaceName; - this.functionName = functionName; - this.expectedResult = expectedResult; - } - - public RhinoFunctionResultChecker(String functionName, Object expectedResult) { - this(null, functionName, expectedResult); - } - - @Override - public void runChecks(Context context, Scriptable scope) throws Exception { - Object result = evaluateFunction(context, scope); - assertTrue("Result is not what expected! Expected: " + expectedResult + " Evaluated : " + result, - result.equals(expectedResult)); - String report = namespaceName + "." + functionName + "() = " + Context.toString(result); - System.out.println(report); - } - - private Object evaluateFunction(Context cx, Scriptable scope) { - return cx.evaluateString(scope, functionCallString(), "function call", 0, null); - } - - private String functionCallString() { - String result = functionName + "()"; - if (namespaceName != null) { - result = namespaceName + "." + result; - } - return result; - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/RhinoPropertyTypesChecker.java b/js.tests/test/org/jetbrains/k2js/test/RhinoPropertyTypesChecker.java deleted file mode 100644 index 4787fc0f8e0..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/RhinoPropertyTypesChecker.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.mozilla.javascript.Context; -import org.mozilla.javascript.NativeObject; -import org.mozilla.javascript.Scriptable; - -import java.util.Map; - -import static org.junit.Assert.assertTrue; - -/** - * @author Pavel Talanov - */ -public final class RhinoPropertyTypesChecker implements RhinoResultChecker { - - final private String objectName; - final private Map> propertyToType; - - public RhinoPropertyTypesChecker(String objectName, Map> propertyToType) { - this.objectName = objectName; - this.propertyToType = propertyToType; - } - - @Override - public void runChecks(Context context, Scriptable scope) throws Exception { - NativeObject object = RhinoUtils.extractObject(objectName, scope); - verifyObjectHasExpectedPropertiesOfExpectedTypes(object, propertyToType); - } - - private void verifyObjectHasExpectedPropertiesOfExpectedTypes - (NativeObject object, Map> nameToClassMap) { - for (Map.Entry> entry : nameToClassMap.entrySet()) { - String name = entry.getKey(); - Class expectedClass = entry.getValue(); - assertTrue(object + " must contain key " + name, object.containsKey(name)); - assertTrue(object + "'s property " + name + " must be of type " + expectedClass, - expectedClass.isInstance(object.get(name))); - } - } - -} diff --git a/js.tests/test/org/jetbrains/k2js/test/RhinoResultChecker.java b/js.tests/test/org/jetbrains/k2js/test/RhinoResultChecker.java deleted file mode 100644 index 273895ed8a8..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/RhinoResultChecker.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.mozilla.javascript.Context; -import org.mozilla.javascript.Scriptable; - -/** - * @author Pavel Talanov - */ -public interface RhinoResultChecker { - public void runChecks(Context context, Scriptable scope) throws Exception; -} diff --git a/js.tests/test/org/jetbrains/k2js/test/RhinoSystemOutputChecker.java b/js.tests/test/org/jetbrains/k2js/test/RhinoSystemOutputChecker.java deleted file mode 100644 index 388041c14f5..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/RhinoSystemOutputChecker.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.k2js.utils.GenerationUtils; -import org.mozilla.javascript.Context; -import org.mozilla.javascript.Scriptable; - -import java.util.List; - -import static org.junit.Assert.assertTrue; - -/** - * @author Pavel Talanov - */ -public final class RhinoSystemOutputChecker implements RhinoResultChecker { - - private final List arguments; - private final String expectedResult; - - public RhinoSystemOutputChecker(String expectedResult, List arguments) { - this.expectedResult = expectedResult; - this.arguments = arguments; - } - - @Override - public void runChecks(@NotNull Context context, @NotNull Scriptable scope) - throws Exception { - runMain(context, scope); - String result = getSystemOutput(context, scope); - String trimmedExpected = trimSpace(expectedResult); - String trimmedActual = trimSpace(result); - // System.out.println(trimmedActual); - // System.out.println(trimmedExpected); - assertTrue("Returned:\n" + trimmedActual + "END_OF_RETURNED\nExpected:\n" + trimmedExpected - + "END_OF_EXPECTED\n", trimmedExpected.equals(trimmedActual)); - } - - private String getSystemOutput(@NotNull Context context, @NotNull Scriptable scope) { - Object output = context.evaluateString(scope, "Kotlin.System.output()", "test", 0, null); - assertTrue("Output should be a string.", output instanceof String); - return (String) output; - } - - private void runMain(Context context, Scriptable scope) { - String callToMain = GenerationUtils.generateCallToMain("Anonymous", arguments); - context.evaluateString(scope, callToMain, "function call", 0, null); - } - - public String trimSpace(String s) { - String[] choppedUpString = s.trim().split("\\s"); - StringBuilder sb = new StringBuilder(); - for (String word : choppedUpString) { - sb.append(word); - } - return sb.toString(); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/RhinoUtils.java b/js.tests/test/org/jetbrains/k2js/test/RhinoUtils.java deleted file mode 100644 index 6ddf610539d..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/RhinoUtils.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.mozilla.javascript.NativeObject; -import org.mozilla.javascript.Scriptable; - -import static org.junit.Assert.assertTrue; - -/** - * @author Pavel Talanov - */ -public final class RhinoUtils { - - private RhinoUtils() { - - } - - public static NativeObject extractObject(String objectName, Scriptable scope) { - Object nativeObject = scope.get(objectName, scope); - assertTrue(objectName + " should be JSON Object", nativeObject instanceof NativeObject); - return (NativeObject) nativeObject; - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/SimpleTestSuite.java b/js.tests/test/org/jetbrains/k2js/test/SimpleTestSuite.java deleted file mode 100644 index 6f8f741ca4f..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/SimpleTestSuite.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import com.intellij.testFramework.UsefulTestCase; -import junit.framework.Test; -import org.jetbrains.annotations.NotNull; - -/** - * @author Pavel Talanov - */ -public final class SimpleTestSuite extends UsefulTestCase { - - public static Test suite() { - return Suite.suiteForDirectory("simple/", new Suite.SingleFileTester() { - @Override - public void performTest(@NotNull Suite test, @NotNull String filename) throws Exception { - test.testFooBoxIsTrue(filename); - } - }); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/StandardClassesTest.java b/js.tests/test/org/jetbrains/k2js/test/StandardClassesTest.java deleted file mode 100644 index 95b2cbedcf1..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/StandardClassesTest.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public class StandardClassesTest extends TranslationTest { - final private static String MAIN = "standardClasses/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - - public void testArray() throws Exception { - testFooBoxIsTrue("array.kt"); - } - - - public void testArrayAccess() throws Exception { - testFooBoxIsTrue("arrayAccess.kt"); - } - - - public void testArrayIsFilledWithNulls() throws Exception { - testFooBoxIsTrue("arrayIsFilledWithNulls.kt"); - } - - - public void testArrayFunctionConstructor() throws Exception { - testFooBoxIsTrue("arrayFunctionConstructor.kt"); - } - - - public void testArraySize() throws Exception { - testFooBoxIsTrue("arraySize.kt"); - } - - //TODO: this feature in not supported for some time - //TODO: support it. Probably configurable. -// (expected = JavaScriptException.class) -// public void arrayThrowsExceptionOnOOBaccess() throws Exception { -// testFooBoxIsTrue("arrayThrowsExceptionOnOOBaccess.kt"); -// } - - - public void testArraysIterator() throws Exception { - testFooBoxIsTrue("arraysIterator.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/StringTest.java b/js.tests/test/org/jetbrains/k2js/test/StringTest.java deleted file mode 100644 index bf45441f9e7..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/StringTest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public class StringTest extends AbstractExpressionTest { - - final private static String MAIN = "string/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testStringConstant() throws Exception { - testFooBoxIsTrue("stringConstant.kt"); - } - - public void testStringAssignment() throws Exception { - testFooBoxIsTrue("stringAssignment.kt"); - } - - public void testIntInTemplate() throws Exception { - testFunctionOutput("intInTemplate.kt", "foo", "box", "my age is 3"); - } - - public void testStringInTemplate() throws Exception { - testFunctionOutput("stringInTemplate.kt", "foo", "box", "oHelloo"); - } - - public void testMultipleExpressionInTemplate() throws Exception { - testFunctionOutput("multipleExpressionsInTemplate.kt", "foo", "box", "left = 3\nright = 2\nsum = 5\n"); - } - - public void testToStringMethod() throws Exception { - testFooBoxIsTrue("objectToStringCallInTemplate.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/Suite.java b/js.tests/test/org/jetbrains/k2js/test/Suite.java deleted file mode 100644 index 095557125af..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/Suite.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import junit.framework.Test; -import org.jetbrains.annotations.NotNull; - -/** - * @author Pavel Talanov - */ -//TODO: this class has strange behaviour. Should be refactored. -public final class Suite extends TranslationTest { - - private String name; - private final SingleFileTester tester; - private final String testMain; - - public Suite(@NotNull String testName, - @NotNull String suiteDirName, - @NotNull final SingleFileTester tester) { - this.name = testName; - this.tester = tester; - this.testMain = suiteDirName; - } - - public Suite() { - this("dummy", "dummy", new SingleFileTester() { - @Override - public void performTest(@NotNull Suite test, @NotNull String filename) throws Exception { - //do nothing - } - }); - } - - //NOTE: just to avoid warning - public void testNothing() { - } - - @Override - protected String mainDirectory() { - return testMain; - } - - public void runTest() throws Exception { - tester.performTest(this, name); - } - - public static Test suiteForDirectory(@NotNull final String mainName, @NotNull final SingleFileTester testMethod) { - - return TranslatorTestCaseBuilder.suiteForDirectory("translator\\testFiles\\", - mainName + casesDirectoryName(), true, new TranslatorTestCaseBuilder.NamedTestFactory() { - @NotNull - @Override - public Test createTest(@NotNull String name) { - return (new Suite(name, mainName, testMethod)); - } - }); - } - - protected static interface SingleFileTester { - void performTest(@NotNull Suite test, @NotNull String filename) throws Exception; - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/TraitTest.java b/js.tests/test/org/jetbrains/k2js/test/TraitTest.java deleted file mode 100644 index f58d18d038f..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/TraitTest.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class TraitTest extends TranslationTest { - - final private static String MAIN = "trait/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - - public void testTraitAddsFunctionsToClass() throws Exception { - testFooBoxIsTrue("traitAddsFunctionsToClass.kt"); - } - - - public void testClassDerivesFromClassAndTrait() throws Exception { - testFooBoxIsTrue("classDerivesFromClassAndTrait.kt"); - } - - - public void testClassDerivesFromTraitAndClass() throws Exception { - testFooBoxIsTrue("classDerivesFromTraitAndClass.kt"); - } - - - public void testExample() throws Exception { - testFooBoxIsTrue("example.kt"); - } - - - public void testTraitExtendsTrait() throws Exception { - testFooBoxIsTrue("traitExtendsTrait.kt"); - } - - - public void testTraitExtendsTwoTraits() throws Exception { - testFooBoxIsTrue("traitExtendsTwoTraits.kt"); - } - - - public void testFunDelegation() throws Exception { - testFooBoxIsOk("funDelegation.jet"); - } - - - public void testDefinitionOrder() throws Exception { - testFooBoxIsTrue("definitionOrder.kt"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/TranslationTest.java b/js.tests/test/org/jetbrains/k2js/test/TranslationTest.java deleted file mode 100644 index f46514ed2e4..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/TranslationTest.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import org.jetbrains.k2js.facade.K2JSTranslator; -import org.mozilla.javascript.Context; -import org.mozilla.javascript.Scriptable; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileReader; -import java.io.IOException; -import java.nio.MappedByteBuffer; -import java.nio.channels.FileChannel; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -//TODO: spread the test* methods amongst classes that actually use them - -/** - * @author Pavel Talanov - */ -public abstract class TranslationTest extends BaseTest { - - private final static String TEST_FILES = "translator/testFiles/"; - private static final String CASES = "cases/"; - private static final String OUT = "out/"; - private static final String KOTLIN_JS_LIB = TEST_FILES + "kotlin_lib.js"; - private static final String EXPECTED = "expected/"; - - protected String kotlinLibraryPath() { - return KOTLIN_JS_LIB; - } - - protected static String casesDirectoryName() { - return CASES; - } - - private static String outDirectoryName() { - return OUT; - } - - protected abstract String mainDirectory(); - - private String testFilesPath() { - return TEST_FILES + suiteDirectoryName() + mainDirectory(); - } - - protected String suiteDirectoryName() { - return ""; - } - - private String getOutputPath() { - return testFilesPath() + outDirectoryName(); - } - - protected String getInputPath() { - return testFilesPath() + casesDirectoryName(); - } - - private String getExpectedPath() { - return testFilesPath() + expectedDirectoryName(); - } - - private String expectedDirectoryName() { - return EXPECTED; - } - - protected void testFunctionOutput(String filename, String namespaceName, - String functionName, Object expectedResult) throws Exception { - translateFile(filename); - runRhinoTest(generateFilenameList(getOutputFilePath(filename)), - new RhinoFunctionResultChecker(namespaceName, functionName, expectedResult)); - } - - protected void testMultiFile(String dirName, String namespaceName, - String functionName, Object expectedResult) throws Exception { - translateFilesInDir(dirName); - runRhinoTest(generateFilenameList(getOutputFilePath(dirName + ".kt")), - new RhinoFunctionResultChecker(namespaceName, functionName, expectedResult)); - } - - protected void translateFile(String filename) throws Exception { - K2JSTranslator.testTranslateFile(getInputFilePath(filename), - getOutputFilePath(filename)); - } - - protected void translateFilesInDir(String dirName) throws Exception { - String dirPath = getInputFilePath(dirName); - File dir = new File(dirPath); - List fullFilePaths = new ArrayList(); - for (String fileName : dir.list()) { - fullFilePaths.add(getInputFilePath(dirName) + "\\" + fileName); - } - assert dir.isDirectory(); - K2JSTranslator.testTranslateFiles(fullFilePaths, - getOutputFilePath(dirName + ".kt")); - } - - protected List generateFilenameList(String inputFile) { - return Arrays.asList(kotlinLibraryPath(), inputFile); - } - - //TODO: refactor filename generation logic - protected String getOutputFilePath(String filename) { - return getOutputPath() + convertToDotJsFile(filename); - } - - private String convertToDotJsFile(String filename) { - return filename.substring(0, filename.lastIndexOf('.')) + ".js"; - } - - private String getInputFilePath(String filename) { - return getInputPath() + filename; - } - - protected String cases(String filename) { - return getInputFilePath(filename); - } - - private String expected(String testName) { - return getExpectedPath() + testName + ".out"; - } - - protected void runFileWithRhino(String inputFile, Context context, Scriptable scope) throws Exception { - FileReader reader = new FileReader(inputFile); - context.evaluateReader(scope, reader, inputFile, 1, null); - reader.close(); - } - - protected void runRhinoTest(List fileNames, RhinoResultChecker checker) throws Exception { - Context context = Context.enter(); - Scriptable scope = context.initStandardObjects(); - for (String filename : fileNames) { - runFileWithRhino(filename, context, scope); - } - checker.runChecks(context, scope); - Context.exit(); - } - - public void testFooBoxIsTrue(String filename) throws Exception { - testFunctionOutput(filename, "foo", "box", true); - } - - public void testFooBoxIsOk(String filename) throws Exception { - testFunctionOutput(filename, "foo", "box", "OK"); - } - - protected void checkOutput(String filename, String expectedResult, String... args) throws Exception { - translateFile(filename); - runRhinoTest(generateFilenameList(getOutputFilePath(filename)), - new RhinoSystemOutputChecker(expectedResult, Arrays.asList(args))); - } - - protected void testWithMain(String testName, String testId, String... args) throws Exception { - checkOutput(testName + ".kt", readFile(expected(testName + testId)), args); - } - - private static String readFile(String path) throws IOException { - FileInputStream stream = new FileInputStream(new File(path)); - try { - FileChannel fc = stream.getChannel(); - MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); - /* Instead of using default, pass in a decoder. */ - return Charset.defaultCharset().decode(bb).toString(); - } finally { - stream.close(); - } - } - - -} diff --git a/js.tests/test/org/jetbrains/k2js/test/TranslatorTestCaseBuilder.java b/js.tests/test/org/jetbrains/k2js/test/TranslatorTestCaseBuilder.java deleted file mode 100644 index ff9a8ed4c78..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/TranslatorTestCaseBuilder.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -import junit.framework.Test; -import junit.framework.TestSuite; -import org.jetbrains.annotations.NotNull; - -import java.io.File; -import java.io.FileFilter; -import java.io.FilenameFilter; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -/** - * @author Pavel Talanov - */ -public abstract class TranslatorTestCaseBuilder { - public static FilenameFilter emptyFilter = new FilenameFilter() { - @Override - public boolean accept(File file, String name) { - return true; - } - }; - - public interface NamedTestFactory { - @NotNull - Test createTest(@NotNull String filename); - } - - @NotNull - public static TestSuite suiteForDirectory(String baseDataDir, @NotNull final String dataPath, - boolean recursive, @NotNull NamedTestFactory factory) { - return suiteForDirectory(baseDataDir, dataPath, recursive, emptyFilter, factory); - } - - @NotNull - public static TestSuite suiteForDirectory(String baseDataDir, @NotNull final String dataPath, boolean recursive, - final FilenameFilter filter, @NotNull NamedTestFactory factory) { - TestSuite suite = new TestSuite(dataPath); - appendTestsInDirectory(baseDataDir, dataPath, recursive, filter, factory, suite); - return suite; - } - - public static void appendTestsInDirectory(String baseDataDir, String dataPath, boolean recursive, - final FilenameFilter filter, NamedTestFactory factory, TestSuite suite) { - final String extensionJet = ".jet"; - final String extensionKt = ".kt"; - final FilenameFilter extensionFilter = new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.endsWith(extensionJet) || name.endsWith(extensionKt); - } - }; - FilenameFilter resultFilter; - if (filter != emptyFilter) { - resultFilter = new FilenameFilter() { - @Override - public boolean accept(File file, String s) { - return extensionFilter.accept(file, s) && filter.accept(file, s); - } - }; - } else { - resultFilter = extensionFilter; - } - File dir = new File(baseDataDir + dataPath); - FileFilter dirFilter = new FileFilter() { - @Override - public boolean accept(File pathname) { - return pathname.isDirectory(); - } - }; - if (recursive) { - File[] files = dir.listFiles(dirFilter); - assert files != null : dir; - List subdirs = Arrays.asList(files); - Collections.sort(subdirs); - for (File subdir : subdirs) { - suite.addTest(suiteForDirectory(baseDataDir, dataPath + "/" + subdir.getName(), recursive, filter, factory)); - } - } - List files = Arrays.asList(dir.listFiles(resultFilter)); - Collections.sort(files); - for (File file : files) { - String fileName = file.getName(); - assert fileName != null; - String extension = fileName.endsWith(extensionJet) ? extensionJet : extensionKt; - suite.addTest(factory.createTest(fileName)); - } - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/TupleTest.java b/js.tests/test/org/jetbrains/k2js/test/TupleTest.java deleted file mode 100644 index d40b350d90f..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/TupleTest.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class TupleTest extends TranslationTest { - - final private static String MAIN = "tuple/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testTwoElements() throws Exception { - testFooBoxIsTrue("twoElements.kt"); - } - - public void testMultipleMembers() throws Exception { - testFooBoxIsTrue("multipleMembers.kt"); - } - - -} - diff --git a/js.tests/test/org/jetbrains/k2js/test/WebDemoExamples1Test.java b/js.tests/test/org/jetbrains/k2js/test/WebDemoExamples1Test.java deleted file mode 100644 index 7490e89ca94..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/WebDemoExamples1Test.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class WebDemoExamples1Test extends TranslationTest { - - final private static String MAIN = "webDemoExamples1/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - - public void testPrintArg() throws Exception { - checkOutput("printArg.kt", "Hello, world!", "Hello, world!"); - } - - - public void testWhileLoop() throws Exception { - checkOutput("whileLoop.kt", "guest1\nguest2\nguest3\nguest4\n", "guest1", "guest2", "guest3", "guest4"); - } - - - public void testIfAsExpression() throws Exception { - checkOutput("ifAsExpression.kt", "20\n", "10", "20"); - } - - - public void testObjectOrientedHello() throws Exception { - checkOutput("objectOrientedHello.kt", "Hello, Pavel!\n", "Pavel"); - } - - - public void testMultiLanguageHello() throws Exception { - checkOutput("multiLanguageHello.kt", "Salut!\n", "FR"); - } - - - public void testNullChecks() throws Exception { - checkOutput("nullChecks.kt", "No number supplied"); - checkOutput("nullChecks.kt", "6", "2", "3"); - } - - - public void testRanges() throws Exception { - checkOutput("ranges.kt", "OK\n" + - " 1 2 3 4 5\n" + - "Out: array has only 3 elements. x = 4\n" + - "Yes: array contains aaa\n" + - "No: array doesn't contains ddd\n", "4"); - - checkOutput("ranges.kt", " 1 2 3 4 5\n" + - "Out: array has only 3 elements. x = 10\n" + - "Yes: array contains aaa\n" + - "No: array doesn't contains ddd\n", "10"); - } - - - public void testForLoop() throws Exception { - checkOutput("forLoop.kt", "a\n" + - "b\n" + - "c\n" + - "\n" + - "a\n" + - "b\n" + - "c\n", "a", "b", "c"); - checkOutput("forLoop.kt", "123\n\n123\n", "123"); - } - - - public void testIsCheck() throws Exception { - checkOutput("isCheck.kt", "3\nnull\n"); - } - - - public void testPatternMatching() throws Exception { - checkOutput("patternMatching.kt", "Greeting\n" + - "One\n" + - "Not a string\n" + - "Unknown\n"); - } -} diff --git a/js.tests/test/org/jetbrains/k2js/test/WebDemoExamples2Test.java b/js.tests/test/org/jetbrains/k2js/test/WebDemoExamples2Test.java deleted file mode 100644 index 1eb409c2b8a..00000000000 --- a/js.tests/test/org/jetbrains/k2js/test/WebDemoExamples2Test.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.test; - -/** - * @author Pavel Talanov - */ -public final class WebDemoExamples2Test extends TranslationTest { - - final private static String MAIN = "webDemoExamples2/"; - - @Override - protected String mainDirectory() { - return MAIN; - } - - public void testBottles() throws Exception { - testWithMain("bottles", "2", "2"); - testWithMain("bottles", ""); - } - - public void testLife() throws Exception { - testWithMain("life", "", "2"); - } - - public void testBuilder() throws Exception { - testWithMain("builder", ""); - testWithMain("builder", "1", "over9000"); - } - - //TODO: comparator LinkedList dependencies -// @Test -// public void maze() throws Exception { -// testWithMain("maze", ""); -// } -} diff --git a/k2js.iml b/k2js.iml deleted file mode 100644 index af012ea065d..00000000000 --- a/k2js.iml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/k2js/.idea/artifacts/k2js_jar.xml b/k2js/.idea/artifacts/k2js_jar.xml deleted file mode 100644 index a4f2e6c0057..00000000000 --- a/k2js/.idea/artifacts/k2js_jar.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - $PROJECT_DIR$/out/artifacts/k2js_jar - - - - - - - - - - - - - \ No newline at end of file diff --git a/k2js/.idea/copyright/apache.xml b/k2js/.idea/copyright/apache.xml deleted file mode 100644 index 647fcdb02ef..00000000000 --- a/k2js/.idea/copyright/apache.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - \ No newline at end of file diff --git a/k2js/.idea/copyright/profiles_settings.xml b/k2js/.idea/copyright/profiles_settings.xml deleted file mode 100644 index ace2e994924..00000000000 --- a/k2js/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/k2js/.idea/dictionaries/Pavel_Talanov.xml b/k2js/.idea/dictionaries/Pavel_Talanov.xml deleted file mode 100644 index 8bede43c190..00000000000 --- a/k2js/.idea/dictionaries/Pavel_Talanov.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - accessors - aliaser - fqname - fqnames - initializers - intrinsics - kotlin - mutator - namer - overloadable - println - - - \ No newline at end of file diff --git a/k2js/.idea/inspectionProfiles/Project_Default.xml b/k2js/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index a76f2aecef0..00000000000 --- a/k2js/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - \ No newline at end of file diff --git a/k2js/.idea/inspectionProfiles/profiles_settings.xml b/k2js/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 3b312839bf2..00000000000 --- a/k2js/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - \ No newline at end of file diff --git a/k2js/.idea/scopes/scope_settings.xml b/k2js/.idea/scopes/scope_settings.xml deleted file mode 100644 index 922003b8433..00000000000 --- a/k2js/.idea/scopes/scope_settings.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/k2js/.idea/workspace.xml b/k2js/.idea/workspace.xml deleted file mode 100644 index 46fab1cea58..00000000000 --- a/k2js/.idea/workspace.xml +++ /dev/null @@ -1,1736 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - org.jetbrains.k2js.translate.* - - - org.jetbrains.k2js.* - - - org.jetbrains.k2js.* - - - org.jetbrains.k2js.* - - - org.jetbrains.k2js.test.* - - - org.jetbrains.k2js.analyze.* - org.jetbrains.k2js.config.* - org.jetbrains.k2js.facade.* - org.jetbrains.k2js.generate.* - org.jetbrains.k2js.test.* - org.jetbrains.k2js.translate.* - org.jetbrains.k2js.utils.* - org.jetbrains.k2js.translate.context.* - org.jetbrains.k2js.translate.declaration.* - org.jetbrains.k2js.translate.expression.* - org.jetbrains.k2js.translate.general.* - org.jetbrains.k2js.translate.initializer.* - org.jetbrains.k2js.translate.intrinsic.* - org.jetbrains.k2js.translate.operation.* - org.jetbrains.k2js.translate.reference.* - org.jetbrains.k2js.translate.utils.* - org.jetbrains.k2js.translate.intrinsic.array.* - org.jetbrains.k2js.translate.intrinsic.primitive.* - org.jetbrains.k2js.translate.intrinsic.string.* - org.jetbrains.k2js.translate.intrinsic.tuple.* - - - org.jetbrains.k2js.test.* - org.jetbrains.k2js.translate.* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Android - - - Class structure - - - Dependency issues - - - General - - - Internationalization issues - - - Java language level migration aids - - - Logging issues - - - Numeric issues - - - OSGi - - - Plugin DevKit - - - Portability issues - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - localhost - 5050 - - - - - - - - - 1319812241928 - 1319812241928 - - - 1327398620289 - 1327398620289 - - - 1327420478272 - 1327420478272 - - - 1327427513473 - 1327427513473 - - - 1329305841490 - 1329305841490 - - - 1329307398273 - 1329307398273 - - - 1329310617071 - 1329310617071 - - - 1329311170761 - 1329311170761 - - - 1329823359830 - 1329823359830 - - - 1329826525434 - 1329826525434 - - - 1329828408220 - 1329828408220 - - - 1329829777595 - 1329829777595 - - - 1329831616053 - 1329831616053 - - - 1329836574441 - 1329836574441 - - - 1329837265452 - 1329837265452 - - - 1329838186967 - 1329838186967 - - - 1329838425571 - 1329838425571 - - - 1329838613308 - 1329838613308 - - - 1329838762745 - 1329838762745 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - k2js:jar - - - - - - - - apache - - - - - - - - No facets are configured - - - - - - - - guava-10.0.1 - - - - - - - - 1.6 - - - - - - - - jslib - - - - - - - - 1.6 - - - - - - - - libs - - - - - - - - - - - - - - - - diff --git a/k2js/build.xml b/k2js/build.xml deleted file mode 100644 index c799c56523e..00000000000 --- a/k2js/build.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/k2js/coverage-error.log b/k2js/coverage-error.log deleted file mode 100644 index 7d64d020a20..00000000000 --- a/k2js/coverage-error.log +++ /dev/null @@ -1,1478 +0,0 @@ -[2011.12.13 16:49:22] (Coverage): Error during class instrumentation: org.jetbrains.k2js.translate.reference.AccessTranslator -java.lang.ClassCircularityError: org/jetbrains/k2js/translate/reference/PropertyAccessTranslator - at java.lang.Class.forName0(Native Method) - at java.lang.Class.forName(Class.java:186) - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1281) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:113) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) - at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) - at java.net.URLClassLoader.access$100(URLClassLoader.java:71) - at java.net.URLClassLoader$1.run(URLClassLoader.java:361) - at java.net.URLClassLoader$1.run(URLClassLoader.java:355) - at java.security.AccessController.doPrivileged(Native Method) - at java.net.URLClassLoader.findClass(URLClassLoader.java:354) - at java.lang.ClassLoader.loadClass(ClassLoader.java:423) - at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) - at java.lang.ClassLoader.loadClass(ClassLoader.java:356) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) - at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) - at java.net.URLClassLoader.access$100(URLClassLoader.java:71) - at java.net.URLClassLoader$1.run(URLClassLoader.java:361) - at java.net.URLClassLoader$1.run(URLClassLoader.java:355) - at java.security.AccessController.doPrivileged(Native Method) - at java.net.URLClassLoader.findClass(URLClassLoader.java:354) - at java.lang.ClassLoader.loadClass(ClassLoader.java:423) - at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) - at java.lang.ClassLoader.loadClass(ClassLoader.java:356) - at org.jetbrains.k2js.translate.reference.ReferenceTranslator.translateSimpleName(ReferenceTranslator.java:24) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitSimpleNameExpression(ExpressionVisitor.java:135) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitSimpleNameExpression(ExpressionVisitor.java:32) - at org.jetbrains.jet.lang.psi.JetSimpleNameExpression.accept(JetSimpleNameExpression.java:64) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitBlockExpression(ExpressionVisitor.java:68) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitBlockExpression(ExpressionVisitor.java:32) - at org.jetbrains.jet.lang.psi.JetBlockExpression.accept(JetBlockExpression.java:24) - at org.jetbrains.k2js.translate.general.Translation.translateExpression(Translation.java:56) - at org.jetbrains.k2js.translate.expression.FunctionTranslator.translateBody(FunctionTranslator.java:105) - at org.jetbrains.k2js.translate.expression.FunctionTranslator.generateFunctionObject(FunctionTranslator.java:68) - at org.jetbrains.k2js.translate.expression.FunctionTranslator.translateAsLiteral(FunctionTranslator.java:60) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitFunctionLiteralExpression(ExpressionVisitor.java:370) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitFunctionLiteralExpression(ExpressionVisitor.java:32) - at org.jetbrains.jet.lang.psi.JetFunctionLiteralExpression.accept(JetFunctionLiteralExpression.java:24) - at org.jetbrains.k2js.translate.general.Translation.translateExpression(Translation.java:56) - at org.jetbrains.k2js.translate.general.Translation.translateAsExpression(Translation.java:62) - at org.jetbrains.k2js.translate.utils.TranslationUtils.translateArgument(TranslationUtils.java:56) - at org.jetbrains.k2js.translate.utils.TranslationUtils.translateArgumentList(TranslationUtils.java:45) - at org.jetbrains.k2js.translate.reference.CallTranslator.translate(CallTranslator.java:66) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitCallExpression(ExpressionVisitor.java:117) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitCallExpression(ExpressionVisitor.java:32) - at org.jetbrains.jet.lang.psi.JetCallExpression.accept(JetCallExpression.java:29) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.translateAsExpression(ExpressionVisitor.java:37) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitReturnExpression(ExpressionVisitor.java:80) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitReturnExpression(ExpressionVisitor.java:32) - at org.jetbrains.jet.lang.psi.JetReturnExpression.accept(JetReturnExpression.java:22) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitBlockExpression(ExpressionVisitor.java:68) - at org.jetbrains.k2js.translate.expression.ExpressionVisitor.visitBlockExpression(ExpressionVisitor.java:32) - at org.jetbrains.jet.lang.psi.JetBlockExpression.accept(JetBlockExpression.java:24) - at org.jetbrains.k2js.translate.general.Translation.translateExpression(Translation.java:56) - at org.jetbrains.k2js.translate.expression.FunctionTranslator.translateBody(FunctionTranslator.java:105) - at org.jetbrains.k2js.translate.expression.FunctionTranslator.generateFunctionObject(FunctionTranslator.java:68) - at org.jetbrains.k2js.translate.expression.FunctionTranslator.translateAsMethod(FunctionTranslator.java:53) - at org.jetbrains.k2js.translate.declaration.DeclarationBodyVisitor.visitNamedFunction(DeclarationBodyVisitor.java:53) - at org.jetbrains.k2js.translate.declaration.DeclarationBodyVisitor.visitNamedFunction(DeclarationBodyVisitor.java:20) - at org.jetbrains.jet.lang.psi.JetNamedFunction.accept(JetNamedFunction.java:23) - at org.jetbrains.k2js.translate.declaration.DeclarationBodyVisitor.traverseNamespace(DeclarationBodyVisitor.java:38) - at org.jetbrains.k2js.translate.declaration.NamespaceTranslator.translateNamespaceMemberDeclarations(NamespaceTranslator.java:85) - at org.jetbrains.k2js.translate.declaration.NamespaceTranslator.addMemberDeclarations(NamespaceTranslator.java:77) - at org.jetbrains.k2js.translate.declaration.NamespaceTranslator.namespaceOwnDeclarationStatement(NamespaceTranslator.java:66) - at org.jetbrains.k2js.translate.declaration.NamespaceTranslator.translateNamespace(NamespaceTranslator.java:42) - at org.jetbrains.k2js.translate.declaration.NamespaceTranslator.translateNamespace(NamespaceTranslator.java:29) - at org.jetbrains.k2js.translate.general.Translation.translateNamespace(Translation.java:40) - at org.jetbrains.k2js.translate.general.Translation.generateAst(Translation.java:100) - at org.jetbrains.k2js.K2JSTranslator.translate(K2JSTranslator.java:55) - at org.jetbrains.k2js.test.TranslationTest.translateFile(TranslationTest.java:60) - at org.jetbrains.k2js.test.TranslationTest.testFunctionOutput(TranslationTest.java:54) - at org.jetbrains.k2js.test.ExampleTest.runBoxTest(ExampleTest.java:16) - at ExampleTestSuite.runTest(ExampleTestSuite.java:21) - at junit.framework.TestCase.runBare(TestCase.java:134) - at com.intellij.testFramework.UsefulTestCase.defaultRunBare(UsefulTestCase.java:266) - at com.intellij.testFramework.UsefulTestCase$3.run(UsefulTestCase.java:278) - at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241) - at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:705) - at java.awt.EventQueue.access$000(EventQueue.java:101) - at java.awt.EventQueue$3.run(EventQueue.java:666) - at java.awt.EventQueue$3.run(EventQueue.java:664) - at java.security.AccessController.doPrivileged(Native Method) - at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) - at java.awt.EventQueue.dispatchEvent(EventQueue.java:675) - at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211) - at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128) - at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117) - at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113) - at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105) - at java.awt.EventDispatchThread.run(EventDispatchThread.java:90) -[2011.12.13 19:57:44] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_1 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_1 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.runPropertyTypeCheck(KotlinLibTest.java:26) - at org.jetbrains.k2js.test.KotlinLibTest.classObjectHasCreateMethod(KotlinLibTest.java:46) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:44] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_2 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_2 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.runPropertyTypeCheck(KotlinLibTest.java:26) - at org.jetbrains.k2js.test.KotlinLibTest.traitObjectHasCreateMethod(KotlinLibTest.java:62) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:45] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_3 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_3 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.createdTraitIsJSObject(KotlinLibTest.java:69) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:45] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_4 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_4 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.createdNamespaceIsJSObject(KotlinLibTest.java:77) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:45] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_5 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_5 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.namespaceHasDeclaredFunction(KotlinLibTest.java:85) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:45] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_6 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_6 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.namespaceHasDeclaredClasses(KotlinLibTest.java:92) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:45] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_7 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_7 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.isAncestorType(KotlinLibTest.java:104) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:45] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_8 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_8 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.isComplexTest(KotlinLibTest.java:110) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:45] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_9 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_9 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.commaExpression(KotlinLibTest.java:116) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:46] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_10 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_10 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.isSameType(KotlinLibTest.java:98) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.13 19:57:46] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_11 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_11 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.runPropertyTypeCheck(KotlinLibTest.java:26) - at org.jetbrains.k2js.test.KotlinLibTest.namespaceObjectHasCreateMethod(KotlinLibTest.java:54) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:19] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_1 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_1 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.runPropertyTypeCheck(KotlinLibTest.java:26) - at org.jetbrains.k2js.test.KotlinLibTest.classObjectHasCreateMethod(KotlinLibTest.java:46) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:19] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_2 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_2 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.runPropertyTypeCheck(KotlinLibTest.java:26) - at org.jetbrains.k2js.test.KotlinLibTest.traitObjectHasCreateMethod(KotlinLibTest.java:62) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:19] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_3 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_3 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.createdTraitIsJSObject(KotlinLibTest.java:69) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:19] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_4 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_4 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.createdNamespaceIsJSObject(KotlinLibTest.java:77) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:19] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_5 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_5 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.namespaceHasDeclaredFunction(KotlinLibTest.java:85) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:20] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_6 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_6 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.namespaceHasDeclaredClasses(KotlinLibTest.java:92) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:20] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_7 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_7 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.isAncestorType(KotlinLibTest.java:104) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:20] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_8 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_8 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.isComplexTest(KotlinLibTest.java:110) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:20] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_9 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_9 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.commaExpression(KotlinLibTest.java:116) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:20] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_10 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_10 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.isSameType(KotlinLibTest.java:98) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) -[2011.12.14 16:07:20] (Coverage): Error during class instrumentation: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_11 -java.lang.RuntimeException: java.lang.ClassNotFoundException: org.mozilla.javascript.gen.translator_testFiles_kotlin_lib_js_11 - at org.objectweb.asm.ClassWriter.getCommonSuperClass(ClassWriter.java:1284) - at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1256) - at org.objectweb.asm.Frame.merge(Frame.java:1373) - at org.objectweb.asm.Frame.merge(Frame.java:1323) - at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1270) - at org.objectweb.asm.MethodAdapter.visitMaxs(MethodAdapter.java:189) - at com.intellij.rt.coverage.instrumentation.SamplingInstrumenter$1.visitMaxs(SamplingInstrumenter.java:78) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:1447) - at org.objectweb.asm.ClassReader.accept(ClassReader.java:420) - at com.intellij.rt.coverage.instrumentation.Instrumentator.instrument(Instrumentator.java:148) - at com.intellij.rt.coverage.instrumentation.Instrumentator.access$000(Instrumentator.java:26) - at com.intellij.rt.coverage.instrumentation.Instrumentator$1.transform(Instrumentator.java:109) - at sun.instrument.TransformerManager.transform(TransformerManager.java:188) - at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:424) - at java.lang.ClassLoader.defineClass1(Native Method) - at java.lang.ClassLoader.defineClass(ClassLoader.java:791) - at org.mozilla.javascript.DefiningClassLoader.defineClass(DefiningClassLoader.java:62) - at org.mozilla.javascript.optimizer.Codegen.defineClass(Codegen.java:160) - at org.mozilla.javascript.optimizer.Codegen.createScriptObject(Codegen.java:115) - at org.mozilla.javascript.Context.compileImpl(Context.java:2447) - at org.mozilla.javascript.Context.compileReader(Context.java:1328) - at org.mozilla.javascript.Context.compileReader(Context.java:1300) - at org.mozilla.javascript.Context.evaluateReader(Context.java:1139) - at org.jetbrains.k2js.test.TranslationTest.runFileWithRhino(TranslationTest.java:86) - at org.jetbrains.k2js.test.TranslationTest.runRhinoTest(TranslationTest.java:94) - at org.jetbrains.k2js.test.KotlinLibTest.runPropertyTypeCheck(KotlinLibTest.java:26) - at org.jetbrains.k2js.test.KotlinLibTest.namespaceObjectHasCreateMethod(KotlinLibTest.java:54) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) - at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) - at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) - at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) - at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) - at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runners.Suite.runChild(Suite.java:128) - at org.junit.runners.Suite.runChild(Suite.java:24) - at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) - at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) - at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) - at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) - at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) - at org.junit.runners.ParentRunner.run(ParentRunner.java:300) - at org.junit.runner.JUnitCore.run(JUnitCore.java:157) - at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71) - at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202) - at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) - at java.lang.reflect.Method.invoke(Method.java:601) - at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120) diff --git a/k2js/out/artifacts/k2js_jar/desktop.ini b/k2js/out/artifacts/k2js_jar/desktop.ini deleted file mode 100644 index d957fd188db..00000000000 --- a/k2js/out/artifacts/k2js_jar/desktop.ini +++ /dev/null @@ -1,4 +0,0 @@ -[ViewState] -Mode= -Vid= -FolderType=Generic diff --git a/k2js/out/artifacts/k2js_jar/k2js.jar b/k2js/out/artifacts/k2js_jar/k2js.jar deleted file mode 100644 index 15cc859abeb..00000000000 Binary files a/k2js/out/artifacts/k2js_jar/k2js.jar and /dev/null differ diff --git a/k2js/out/artifacts/k2js_jar/kotlin_lib.js b/k2js/out/artifacts/k2js_jar/kotlin_lib.js deleted file mode 100644 index a6ebd687d2b..00000000000 --- a/k2js/out/artifacts/k2js_jar/kotlin_lib.js +++ /dev/null @@ -1,465 +0,0 @@ -function $A(iterable) { - if (!iterable) return []; - if ('toArray' in Object(iterable)) return iterable.toArray(); - var length = iterable.length || 0, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; -} - -(function () { - - - function extend(destination, source) { - for (var property in source) - destination[property] = source[property]; - return destination; - } - - - - function keys(object) { - if (Type(object) !== OBJECT_TYPE) { - throw new TypeError(); - } - var results = []; - for (var property in object) { - if (object.hasOwnProperty(property)) { - results.push(property); - } - } - return results; - } - - function values(object) { - var results = []; - for (var property in object) - results.push(object[property]); - return results; - } - - extend(Object, { - extend:extend, - keys:Object.keys || keys, - values:values - }); -})(); - - -Object.extend(Function.prototype, (function () { - var slice = Array.prototype.slice; - - function update(array, args) { - var arrayLength = array.length, length = args.length; - while (length--) array[arrayLength + length] = args[length]; - return array; - } - - function merge(array, args) { - array = slice.call(array, 0); - return update(array, args); - } - - function argumentNames() { - var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] - .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') - .replace(/\s+/g, '').split(','); - return names.length == 1 && !names[0] ? [] : names; - } - - function bind(context) { - if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; - var __method = this, args = slice.call(arguments, 1); - return function () { - var a = merge(args, arguments); - return __method.apply(context, a); - } - } - - function bindAsEventListener(context) { - var __method = this, args = slice.call(arguments, 1); - return function (event) { - var a = update([event || window.event], args); - return __method.apply(context, a); - } - } - - function wrap(wrapper) { - var __method = this; - return function () { - var a = update([__method.bind(this)], arguments); - return wrapper.apply(this, a); - } - } - - return { - argumentNames:argumentNames, - bind:bind, - bindAsEventListener:bindAsEventListener, - wrap:wrap - } -})()); - -var isType = function (object, klass) { - current = object.get_class(); - while (current !== klass) { - if (current === null) { - return false; - } - current = current.superclass; - } - return true; -} - -var emptyFunction = function () { -} - -var Class = (function () { - - function subclass() { - } - - ; - function create() { - var parent = null, properties = $A(arguments); - if (typeof (properties[0]) == "function") - parent = properties.shift(); - - function klass() { - this.initializing = klass; - this.initialize.apply(this, arguments); - } - - Object.extend(klass, Class.Methods); - klass.superclass = parent; - klass.subclasses = []; - - if (parent) { - subclass.prototype = parent.prototype; - klass.prototype = new subclass; - parent.subclasses.push(klass); - } - - klass.addMethods( - { - get_class:function () { - return klass; - } - }); - - if (parent != null) { - klass.addMethods( - { - super_init:function () { - this.initializing = this.initializing.superclass; - this.initializing.prototype.initialize.apply(this, arguments) - } - }); - } - - for (var i = 0, length = properties.length; i < length; i++) - klass.addMethods(properties[i]); - - if (!klass.prototype.initialize) - klass.prototype.initialize = emptyFunction; - - klass.prototype.constructor = klass; - return klass; - } - - function addMethods(source) { - var ancestor = this.superclass && this.superclass.prototype, - properties = Object.keys(source); - - - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i], value = source[property]; - if (ancestor && (typeof (value) == "function") && - value.argumentNames()[0] == "$super") { - var method = value; - value = (function (m) { - return function () { - return ancestor[m].apply(this, arguments); - }; - })(property).wrap(method); - - } - this.prototype[property] = value; - } - - return this; - } - - return { - create:create, - Methods:{ - addMethods:addMethods - } - }; -})(); - -var Trait = (function () { - - function add(object, source) { - properties = Object.keys(source); - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i]; - var value = source[property]; - object[property] = value; - } - return this; - } - - function create() { - - result = {} - for (var i = 0, length = arguments.length; i < length; i++) { - add(result, arguments[i]); - } - return result; - } - - return { - create:create - }; -})(); - - -var Namespace = (function () { - - function create() { - return Trait.create.apply(Trait, arguments); - } - - return { - create:create - }; -})(); - -Kotlin = {} -Kotlin.Class = Class; -Kotlin.Namespace = Namespace; -Kotlin.Trait = Trait; -Kotlin.isType = isType; - -Kotlin.equals = function (obj1, obj2) { - if (typeof obj1 == "object") { - if (obj1.equals != undefined) { - return obj1.equals(obj2); - } - } - return (obj1 === obj2); -}; - -Kotlin.Exceptions = {} -Kotlin.Exceptions.IndexOutOfBounds = {} -Kotlin.array = function (len) { - return new Kotlin.Array(len, function () { - return null - }); -} -Kotlin.Array = Class.create({ - initialize:function (len, f) { - this.array = []; - var i = 0; - while (i < len) { - this.array.push(f(i)); - ++i; - } - }, - get:function (index) { - if ((index < 0) || (index >= this.array.length)) { - throw Kotlin.Exceptions.IndexOutOfBounds; - } - return (this.array)[index]; - }, - set:function (index, value) { - if ((index < 0) || (index >= this.array.length)) { - throw Kotlin.Exceptions.IndexOutOfBounds; - } - (this.array)[index] = value; - }, - size:function () { - return this.array.length; - }, - iterator:function () { - return new Kotlin.ArrayIterator(this); - }, - indices:function() { - return new Kotlin.NumberRange(0, this.size(), false); - } -}); - - -Kotlin.ArrayList = Class.create({ - initialize:function () { - this.array = []; - this.$size = 0; - }, - get:function (index) { - if ((index < 0) || (index >= this.$size)) { - throw Kotlin.Exceptions.IndexOutOfBounds; - } - return (this.array)[index]; - }, - set:function (index, value) { - if ((index < 0) || (index >= this.$size)) { - throw Kotlin.Exceptions.IndexOutOfBounds; - } - (this.array)[index] = value; - }, - size:function () { - return this.$size; - }, - iterator:function () { - return new Kotlin.ArrayIterator(this); - }, - isEmpty:function () { - return (this.$size == 0); - }, - add:function (element) { - this.array[this.$size++] = element; - }, - addAll:function (collection) { - var it = collection.iterator(); - while (it.hasNext()) { - this.add(it.next()); - } - }, - remove:function (index) { - for (var i = index; i < this.$size - 1; ++i) { - this.array[i] = this.array[i + 1]; - } - this.$size--; - }, - contains:function (obj) { - for (var i = 0; i < this.$size; ++i) { - if (Kotlin.equals(this.array[i], obj)) { - return true; - } - } - return false; - } -}); - - -Kotlin.ArrayIterator = Class.create({ - initialize:function (array) { - this.array = array; - this.index = 0; - }, - next:function () { - return this.array.get(this.index++); - }, - hasNext:function () { - return (this.array.size() > this.index); - } -}); - -Kotlin.Integer = function () { - - return { - parseInt:function (str) { - return parseInt(str); - } - } - -}(); - -Kotlin.System = function () { - var output = ""; - - var print = function (obj) { - if (obj !== undefined) { - output += obj; - } - }; - var println = function (obj) { - this.print(obj); - output += "\n"; - }; - - return { - out:function () { - return { - print:print, - println:println - }; - }, - output:function () { - return output; - }, - flush:function () { - output = ""; - } - }; -}(); - - -Kotlin.ArrayIterator = Class.create({ - initialize:function (array) { - this.array = array; - this.index = 0; - }, - next:function () { - return this.array.get(this.index++); - }, - hasNext:function () { - return (this.array.size() > this.index); - } -}); - -Kotlin.RangeIterator = Kotlin.Class.create({initialize:function (start, count, reversed) { - this.$start = start; - this.$count = count; - this.$reversed = reversed; - this.$i = this.get_start(); -}, get_start:function () { - return this.$start; -}, get_count:function () { - return this.$count; -}, set_count:function (tmp$0) { - this.$count = tmp$0; -}, get_reversed:function () { - return this.$reversed; -}, get_i:function () { - return this.$i; -}, set_i:function (tmp$0) { - this.$i = tmp$0; -}, next:function () { - this.set_count(this.get_count() - 1); - if (this.get_reversed()) { - this.set_i(this.get_i() - 1); - return this.get_i() + 1; - } - else { - this.set_i(this.get_i() + 1); - return this.get_i() - 1; - } -}, hasNext:function () { - return this.get_count() > 0; -} -}); - -Kotlin.NumberRange = Kotlin.Class.create({initialize:function (start, size, reversed) { - this.$start = start; - this.$size = size; - this.$reversed = reversed; -}, get_start:function () { - return this.$start; -}, get_size:function () { - return this.$size; -}, get_reversed:function () { - return this.$reversed; -}, get_end:function () { - return this.get_reversed() ? this.get_start() - this.get_size() + 1 : this.get_start() + this.get_size() - 1; -}, contains:function (number) { - if (this.get_reversed()) { - return number <= this.get_start() && number > this.get_start() - this.get_size(); - } - else { - return number >= this.get_start() && number < this.get_start() + this.get_size(); - } -}, iterator:function () { - return new Kotlin.RangeIterator(this.get_start(), this.get_size(), this.get_reversed()); -} -}); diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$1.class deleted file mode 100644 index 383114eb694..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$2.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$2.class deleted file mode 100644 index 159b569a025..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$2.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$3.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$3.class deleted file mode 100644 index db361201f74..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen$3.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen.class deleted file mode 100644 index 8e94e33266d..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/AnnotationCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$1.class deleted file mode 100644 index 79990cad6af..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$Mode.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$Mode.class deleted file mode 100644 index 96be445492a..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$Mode.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$State.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$State.class deleted file mode 100644 index c5535556b2b..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter$State.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter.class deleted file mode 100644 index b951a36e9c2..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/BothSignatureWriter.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/Callable.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/Callable.class deleted file mode 100644 index e12a7abe7a7..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/Callable.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CallableMethod.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CallableMethod.class deleted file mode 100644 index a783c90573b..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CallableMethod.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBodyCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBodyCodegen.class deleted file mode 100644 index aadc6002f60..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBodyCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilder$Concrete.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilder$Concrete.class deleted file mode 100644 index de864efce0c..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilder$Concrete.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilder.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilder.class deleted file mode 100644 index dbdd201ca76..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilder.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$1.class deleted file mode 100644 index 6937f45ddc3..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$2$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$2$1.class deleted file mode 100644 index daa5bbdacec..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$2$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$2.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$2.class deleted file mode 100644 index 894657beb36..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory$2.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory.class deleted file mode 100644 index f049fb758b4..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassBuilderFactory.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassCodegen.class deleted file mode 100644 index 42586a04d67..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassFileFactory.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassFileFactory.class deleted file mode 100644 index 93af46526b0..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClassFileFactory.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClosureCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ClosureCodegen.class deleted file mode 100644 index 2be9a6ce8c8..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ClosureCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodeChunk.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodeChunk.class deleted file mode 100644 index 8d55d9fc143..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodeChunk.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$1.class deleted file mode 100644 index d6d0adb6d2d..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$AnonymousClassContext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$AnonymousClassContext.class deleted file mode 100644 index 2918bbdef80..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$AnonymousClassContext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ClassContext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ClassContext.class deleted file mode 100644 index 9f6d937fbf6..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ClassContext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ClosureContext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ClosureContext.class deleted file mode 100644 index e79fef53713..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ClosureContext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ConstructorContext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ConstructorContext.class deleted file mode 100644 index bc9fc129742..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ConstructorContext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$MethodContext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$MethodContext.class deleted file mode 100644 index 54a47733597..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$MethodContext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$NamespaceContext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$NamespaceContext.class deleted file mode 100644 index 3874f505e83..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$NamespaceContext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ReceiverContext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ReceiverContext.class deleted file mode 100644 index 25770bf884a..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext$ReceiverContext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext.class deleted file mode 100644 index 270d008317a..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenContext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenUtil.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenUtil.class deleted file mode 100644 index ae41ab41993..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CodegenUtil.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationErrorHandler$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationErrorHandler$1.class deleted file mode 100644 index 6cc81ffba46..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationErrorHandler$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationErrorHandler.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationErrorHandler.class deleted file mode 100644 index 0b201dbfc0c..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationErrorHandler.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationException.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationException.class deleted file mode 100644 index 97162528b35..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/CompilationException.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ConstructorFrameMap.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ConstructorFrameMap.class deleted file mode 100644 index 89c9045b391..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ConstructorFrameMap.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/EnclosedValueDescriptor.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/EnclosedValueDescriptor.class deleted file mode 100644 index 8f931dfc77c..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/EnclosedValueDescriptor.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$BlockStackElement.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$BlockStackElement.class deleted file mode 100644 index 08e4aa12612..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$BlockStackElement.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$FinallyBlockStackElement.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$FinallyBlockStackElement.class deleted file mode 100644 index c4209cfdb6a..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$FinallyBlockStackElement.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForInArrayLoopGenerator.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForInArrayLoopGenerator.class deleted file mode 100644 index e52d4997afe..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForInArrayLoopGenerator.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForInRangeLoopGenerator.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForInRangeLoopGenerator.class deleted file mode 100644 index e00afde0c44..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForInRangeLoopGenerator.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForLoopGenerator.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForLoopGenerator.class deleted file mode 100644 index a8f32686093..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$ForLoopGenerator.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$LoopBlockStackElement.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$LoopBlockStackElement.class deleted file mode 100644 index a3ba88a6f3f..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen$LoopBlockStackElement.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen.class deleted file mode 100644 index c9891202640..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ExpressionCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/FrameMap$Mark.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/FrameMap$Mark.class deleted file mode 100644 index be857021711..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/FrameMap$Mark.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/FrameMap.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/FrameMap.class deleted file mode 100644 index f3b38735cdc..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/FrameMap.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/FunctionCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/FunctionCodegen.class deleted file mode 100644 index dfd04cc9343..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/FunctionCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/GeneratedAnonymousClassDescriptor.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/GeneratedAnonymousClassDescriptor.class deleted file mode 100644 index e862746be8d..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/GeneratedAnonymousClassDescriptor.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/GeneratedClassLoader.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/GeneratedClassLoader.class deleted file mode 100644 index e3dcdc5d59c..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/GeneratedClassLoader.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/GenerationState$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/GenerationState$1.class deleted file mode 100644 index a8d1d33d812..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/GenerationState$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/GenerationState.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/GenerationState.class deleted file mode 100644 index f1208b72e0d..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/GenerationState.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$1.class deleted file mode 100644 index a5284769d98..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$2.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$2.class deleted file mode 100644 index d417e78d59e..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$2.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$3.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$3.class deleted file mode 100644 index 1e175d07bfe..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$3.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$4.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$4.class deleted file mode 100644 index 4db5449af66..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen$4.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen.class deleted file mode 100644 index fd6be53da76..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ImplementationBodyCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/JetMethodAnnotationWriter.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/JetMethodAnnotationWriter.class deleted file mode 100644 index 8a65999a336..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/JetMethodAnnotationWriter.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/JetTypeMapper.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/JetTypeMapper.class deleted file mode 100644 index 409d5c347e4..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/JetTypeMapper.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmClassSignature.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmClassSignature.class deleted file mode 100644 index 6cbf01cc93e..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmClassSignature.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodParameterKind.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodParameterKind.class deleted file mode 100644 index 48de7f91330..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodParameterKind.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodParameterSignature.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodParameterSignature.class deleted file mode 100644 index f34e5c538cb..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodParameterSignature.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodSignature.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodSignature.class deleted file mode 100644 index 27418b07075..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmMethodSignature.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmPropertyAccessorSignature.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmPropertyAccessorSignature.class deleted file mode 100644 index b6d889a041a..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/JvmPropertyAccessorSignature.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/NamespaceCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/NamespaceCodegen.class deleted file mode 100644 index cf3817fd457..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/NamespaceCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ObjectOrClosureCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ObjectOrClosureCodegen.class deleted file mode 100644 index ed8d8e94189..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ObjectOrClosureCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/OwnerKind$DelegateKind.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/OwnerKind$DelegateKind.class deleted file mode 100644 index 2d08ccab0e1..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/OwnerKind$DelegateKind.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/OwnerKind.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/OwnerKind.class deleted file mode 100644 index c6cbd7dd067..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/OwnerKind.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/ProjectionErasingJetType.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/ProjectionErasingJetType.class deleted file mode 100644 index 54b7dd71e27..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/ProjectionErasingJetType.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/PropertyCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/PropertyCodegen.class deleted file mode 100644 index 8b64f49e696..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/PropertyCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$1.class deleted file mode 100644 index 1f4dd0c4ff6..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ArrayElement.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ArrayElement.class deleted file mode 100644 index 53a14b53e3b..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ArrayElement.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$CallReceiver.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$CallReceiver.class deleted file mode 100644 index 1290ef0a7d0..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$CallReceiver.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$CollectionElement.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$CollectionElement.class deleted file mode 100644 index 1123b0ddbed..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$CollectionElement.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Composed.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Composed.class deleted file mode 100644 index 115738a0823..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Composed.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Constant.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Constant.class deleted file mode 100644 index 4ca9d597a62..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Constant.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Expression.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Expression.class deleted file mode 100644 index cca98f6716c..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Expression.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Field.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Field.class deleted file mode 100644 index 8d8badccab8..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Field.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$FieldForSharedVar.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$FieldForSharedVar.class deleted file mode 100644 index a2fcea04fa4..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$FieldForSharedVar.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Invert.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Invert.class deleted file mode 100644 index 50007b9616d..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Invert.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Local.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Local.class deleted file mode 100644 index 51910f49470..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Local.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$None.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$None.class deleted file mode 100644 index e9059be6fd5..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$None.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$NumberCompare.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$NumberCompare.class deleted file mode 100644 index 2b50fcaac80..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$NumberCompare.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ObjectCompare.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ObjectCompare.class deleted file mode 100644 index e45ebf208f2..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ObjectCompare.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$OnStack.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$OnStack.class deleted file mode 100644 index c11c82cfd64..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$OnStack.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$PostIncrement.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$PostIncrement.class deleted file mode 100644 index 147842073a5..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$PostIncrement.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$PreIncrement.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$PreIncrement.class deleted file mode 100644 index c4dcb59edc1..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$PreIncrement.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Property.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Property.class deleted file mode 100644 index 6a15c1291e7..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Property.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Shared.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Shared.class deleted file mode 100644 index 7709c8f6049..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$Shared.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ThisOuter.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ThisOuter.class deleted file mode 100644 index 227e171e59d..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue$ThisOuter.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue.class deleted file mode 100644 index 2632d755c27..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/StackValue.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/TraitImplBodyCodegen.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/TraitImplBodyCodegen.class deleted file mode 100644 index 39eb270e9c3..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/TraitImplBodyCodegen.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayGet.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayGet.class deleted file mode 100644 index ac1fa95d0b8..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayGet.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayIndices.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayIndices.class deleted file mode 100644 index 684cdf0f81a..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayIndices.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayIterator.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayIterator.class deleted file mode 100644 index 164a7869dc9..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArrayIterator.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArraySet.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArraySet.class deleted file mode 100644 index 15d3b65fc2b..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArraySet.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArraySize.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArraySize.class deleted file mode 100644 index 76ef3d685e4..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ArraySize.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/BinaryOp.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/BinaryOp.class deleted file mode 100644 index bff577c964f..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/BinaryOp.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/CompareTo.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/CompareTo.class deleted file mode 100644 index 7754b121ef2..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/CompareTo.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Concat.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Concat.class deleted file mode 100644 index 014278c2445..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Concat.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Equals.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Equals.class deleted file mode 100644 index ba6380f8dd2..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Equals.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Increment.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Increment.class deleted file mode 100644 index efa18ea69d5..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Increment.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethod.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethod.class deleted file mode 100644 index a9d78e4e913..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethod.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods$1.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods$1.class deleted file mode 100644 index 64a90f04c0a..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.class deleted file mode 100644 index 24017ceda6b..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IntrinsicMethods.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Inv.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Inv.class deleted file mode 100644 index 51d4122f139..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Inv.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IteratorIterator.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IteratorIterator.class deleted file mode 100644 index 11234b9b4b3..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IteratorIterator.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IteratorNext.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IteratorNext.class deleted file mode 100644 index 878868b861e..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/IteratorNext.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/NewArray.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/NewArray.class deleted file mode 100644 index d8f1bcc0a86..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/NewArray.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Not.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Not.class deleted file mode 100644 index 5b41a2d0802..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Not.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/NumberCast.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/NumberCast.class deleted file mode 100644 index 4e1309555d6..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/NumberCast.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/PsiMethodCall.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/PsiMethodCall.class deleted file mode 100644 index eb4099fba72..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/PsiMethodCall.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringGetChar.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringGetChar.class deleted file mode 100644 index ef1a9139a24..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringGetChar.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringLength.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringLength.class deleted file mode 100644 index a49b1c44cb9..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringLength.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringPlus.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringPlus.class deleted file mode 100644 index 13f503b0bfd..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StringPlus.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StupidSync.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StupidSync.class deleted file mode 100644 index 992ba825a8b..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/StupidSync.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Sure.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Sure.class deleted file mode 100644 index 3dc467f47aa..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/Sure.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ToString.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ToString.class deleted file mode 100644 index 0430945603a..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ToString.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/TypeInfo.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/TypeInfo.class deleted file mode 100644 index 9b1a506a64e..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/TypeInfo.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UnaryMinus.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UnaryMinus.class deleted file mode 100644 index 9543ed5ab28..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UnaryMinus.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UnaryPlus.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UnaryPlus.class deleted file mode 100644 index a5f9ee06fbc..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UnaryPlus.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UpTo.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UpTo.class deleted file mode 100644 index 1521b36d069..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/UpTo.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ValueTypeInfo.class b/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ValueTypeInfo.class deleted file mode 100644 index 5be663d5aa2..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/codegen/intrinsics/ValueTypeInfo.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/compiler/FileNameTransformer$1.class b/k2js/out/production/backend/org/jetbrains/jet/compiler/FileNameTransformer$1.class deleted file mode 100644 index a1d34ffd059..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/compiler/FileNameTransformer$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/compiler/FileNameTransformer.class b/k2js/out/production/backend/org/jetbrains/jet/compiler/FileNameTransformer.class deleted file mode 100644 index dab3e838de5..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/compiler/FileNameTransformer.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$1.class b/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$1.class deleted file mode 100644 index a09318caa44..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$1.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$2.class b/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$2.class deleted file mode 100644 index 26d78e33d85..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$2.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$3.class b/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$3.class deleted file mode 100644 index e59569444a6..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$3.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$4.class b/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$4.class deleted file mode 100644 index 1551d73a3a8..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager$4.class and /dev/null differ diff --git a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager.class b/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager.class deleted file mode 100644 index b7bd2014272..00000000000 Binary files a/k2js/out/production/backend/org/jetbrains/jet/compiler/TipsManager.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler$1.class b/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler$1.class deleted file mode 100644 index 27e5e8b9933..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler$1.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler$Arguments.class b/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler$Arguments.class deleted file mode 100644 index a7337dd9971..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler$Arguments.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler.class b/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler.class deleted file mode 100644 index 6798b5cee59..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/cli/KotlinCompiler.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment$1.class b/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment$1.class deleted file mode 100644 index 61d853adba8..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment$1.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment$2.class b/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment$2.class deleted file mode 100644 index 08e182d60bc..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment$2.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment.class b/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment.class deleted file mode 100644 index 52f0f6d62f1..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironment.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironmentException.class b/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironmentException.class deleted file mode 100644 index 8613d75370c..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileEnvironmentException.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileSession.class b/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileSession.class deleted file mode 100644 index 5d0415b21c8..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/compiler/CompileSession.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/compiler/ErrorCollector.class b/k2js/out/production/cli/org/jetbrains/jet/compiler/ErrorCollector.class deleted file mode 100644 index 4a93aed6472..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/compiler/ErrorCollector.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/compiler/JetCoreEnvironment.class b/k2js/out/production/cli/org/jetbrains/jet/compiler/JetCoreEnvironment.class deleted file mode 100644 index a77d77740f6..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/compiler/JetCoreEnvironment.class and /dev/null differ diff --git a/k2js/out/production/cli/org/jetbrains/jet/compiler/ModuleExecutionException.class b/k2js/out/production/cli/org/jetbrains/jet/compiler/ModuleExecutionException.class deleted file mode 100644 index 607576d88b7..00000000000 Binary files a/k2js/out/production/cli/org/jetbrains/jet/compiler/ModuleExecutionException.class and /dev/null differ diff --git a/k2js/out/production/examplesForWebDemo/html5/creatures/kotlinlogo.png b/k2js/out/production/examplesForWebDemo/html5/creatures/kotlinlogo.png deleted file mode 100644 index 5394223b3d6..00000000000 Binary files a/k2js/out/production/examplesForWebDemo/html5/creatures/kotlinlogo.png and /dev/null differ diff --git a/k2js/out/production/examplesForWebDemo/html5/creatures/main.kt b/k2js/out/production/examplesForWebDemo/html5/creatures/main.kt deleted file mode 100644 index 46e0d92b8c2..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/creatures/main.kt +++ /dev/null @@ -1,331 +0,0 @@ -/* -In this example strange creatures are watching the kotlin logo. You can drag'n'drop them as well as the logo. -Doubleclick to add more creatures but be careful. They may be watching you! -*/ -package creatures -// importing some of the API defined -import jquery.* -import html5.* -import java.util.ArrayList -import js.* -import js.Math -import js.setInterval -import html5.getCanvas -import html5.getKotlinLogo -import jquery.jq -import js.setTimeout -import java.util.List - - -abstract class Shape() { - - abstract fun draw(state : CanvasState) - // these two abstract methods defines that our shapes can be dragged - abstract fun contains(mousePos : Vector) : Boolean - abstract var pos : Vector - - var selected : Boolean = false - - // a couple of helper extension methods we'll be using in the derived classes - fun Context.shadowed(shadowOffset : Vector, alpha : Double, render : Context.() -> Unit) { - save() - shadowColor = "rgba(100, 100, 100, $alpha)" - shadowBlur = 5.0 - shadowOffsetX = shadowOffset.x - shadowOffsetY = shadowOffset.y - render() - restore() - } - - fun Context.fillPath(constructPath : Context.() -> Unit) { - beginPath() - constructPath() - closePath() - fill() - } -} - -val Kotlin = Logo(v(300.0, 100.0)) - -class Logo(override var pos : Vector) : Shape() -{ - val relSize : Double = 0.25 - val shadowOffset = v(-3.0, 3.0) - val imageSize = v(377.0, 393.0) - var size : Vector = imageSize * relSize - // get-only properties like this saves you lots of typing and are very expressive - val position : Vector - get() = if (selected) pos - shadowOffset else pos - - - fun drawLogo(state : CanvasState) { - size = imageSize * (state.size.x / imageSize.x) * relSize - // getKotlinLogo() is a 'magic' function here defined only for purposes of demonstration but in fact it just find an element containing the logo - state.context.drawImage(getKotlinLogo(), 0.0, 0.0, imageSize.x, imageSize.y, position.x, position.y, size.x, size.y) - } - - override fun draw(state : CanvasState) { - val context = state.context - if (selected) { - // using helper we defined in Shape class - context.shadowed(shadowOffset, 0.2) { - drawLogo(state) - } - } else { - drawLogo(state) - } - } - - override fun contains(mousePos: Vector): Boolean = mousePos.isInRect(pos, size) - - val centre : Vector - get() = pos + size * 0.5 -} - -val gradientGenerator = RadialGradientGenerator(getContext()) - -class Creature(override var pos : Vector, val state : CanvasState) : Shape() { - - val shadowOffset = v(-5.0, 5.0) - val colorStops = gradientGenerator.getNext() - val relSize = 0.05 - // these properties have no backing fields and in java/javascript they could be represented as little helper functions - val radius : Double - get() = state.width * relSize - val position : Vector - get() = if (selected) pos - shadowOffset else pos - val directionToLogo : Vector - get() = (Kotlin.centre - position).normalized - - //notice how the infix call can make some expressions extremely expressive - override fun contains(mousePos : Vector) = pos distanceTo mousePos < radius - - // defining more nice extension functions - fun Context.circlePath(position : Vector, rad : Double) { - arc(position.x, position.y, rad, 0.0, 2 * Math.PI, false) - } - - //notice we can use an extension function we just defined inside another extension function - fun Context.fillCircle(position : Vector, rad : Double) { - fillPath { - circlePath(position, rad) - } - } - - override fun draw(state : CanvasState) { - val context = state.context - if (!selected) { - drawCreature(context) - } else { - drawCreatureWithShadow(context) - } - } - - fun drawCreature(context : Context) { - context.fillStyle = getGradient(context) - context.fillPath { - tailPath(context) - circlePath(position, radius) - } - drawEye(context) - } - - fun getGradient(context : Context) : CanvasGradient { - val gradientCentre = position + directionToLogo * (radius / 4) - val gradient = context.createRadialGradient(gradientCentre.x, gradientCentre.y, 1.0, gradientCentre.x, gradientCentre.y, 2 * radius) - for (colorStop in colorStops) { - gradient.addColorStop(colorStop._1, colorStop._2) - } - return gradient - } - - fun tailPath(context : Context) { - val tailDirection = -directionToLogo - val tailPos = position + tailDirection * radius * 1.0 - val tailSize = radius * 1.6 - val angle = Math.PI / 6.0 - val p1 = tailPos + tailDirection.rotatedBy(angle) * tailSize - val p2 = tailPos + tailDirection.rotatedBy(-angle) * tailSize - val middlePoint = position + tailDirection * radius * 1.0 - context.moveTo(tailPos.x, tailPos.y) - context.lineTo(p1.x, p1.y) - context.quadraticCurveTo(middlePoint.x, middlePoint.y, p2.x, p2.y) - context.lineTo(tailPos.x, tailPos.y) - } - - fun drawEye(context : Context) { - val eyePos = directionToLogo * radius * 0.6 + position - val eyeRadius = radius / 3 - val eyeLidRadius = eyeRadius / 2 - context.fillStyle = "#FFFFFF" - context.fillCircle(eyePos, eyeRadius) - context.fillStyle = "#000000" - context.fillCircle(eyePos, eyeLidRadius) - } - - fun drawCreatureWithShadow(context : Context) { - context.shadowed(shadowOffset, 0.7) { - context.fillStyle = getGradient(context) - fillPath { - tailPath(context) - context.circlePath(position, radius) - } - } - drawEye(context) - } -} - -class CanvasState(val canvas : Canvas) { - var width = canvas.width - var height = canvas.height - val size : Vector - get() = v(width, height) - val context = getContext() - var valid = false - var shapes = ArrayList() - var selection : Shape? = null - var dragOff = Vector() - val interval = 1000 / 30 - - { - jq(canvas).mousedown { - valid = false - selection = null - val mousePos = mousePos(it) - for (shape in shapes) { - if (mousePos in shape) { - dragOff = mousePos - shape.pos - shape.selected = true - selection = shape - break - } - } - } - - jq(canvas).mousemove { - if (selection != null) { - selection.sure().pos = mousePos(it) - dragOff - valid = false - } - } - - jq(canvas).mouseup { - if (selection != null) { - selection.sure().selected = false - } - selection = null - valid = false - } - - jq(canvas).dblclick { - val newCreature = Creature(mousePos(it), this @CanvasState) - addShape(newCreature) - valid = false - } - - setInterval({ - draw() - }, interval) - } - - fun mousePos(e : MouseEvent) : Vector { - var offset = Vector() - var element : DomElement? = canvas - while (element != null) { - val el : DomElement = element.sure() - offset += Vector(el.offsetLeft, el.offsetTop) - element = el.offsetParent - } - return Vector(e.pageX, e.pageY) - offset - } - - fun addShape(shape : Shape) { - shapes.add(shape) - valid = false - } - - fun clear() { - context.fillStyle = "#FFFFFF" - context.fillRect(0.0, 0.0, width, height) - context.strokeStyle = "#000000" - context.lineWidth = 4.0 - context.strokeRect(0.0, 0.0, width, height) - } - - fun draw() { - if (valid) return - - clear() - for (shape in shapes.reversed()) { - shape.draw(this) - } - Kotlin.draw(this) - valid = true - } -} - -class RadialGradientGenerator(val context : Context) { - val gradients = ArrayList>() - var current = 0 - - fun newColorStops(vararg colorStops : #(Double, String)) { - gradients.add(colorStops) - } - - { - newColorStops(#(0.0, "#F59898"), #(0.5, "#F57373"), #(1.0, "#DB6B6B")) - newColorStops(#(0.39, "rgb(140,167,209)"), #(0.7, "rgb(104,139,209)"), #(0.85, "rgb(67,122,217)")) - newColorStops(#(0.0, "rgb(255,222,255)"), #(0.5, "rgb(255,185,222)"), #(1.0, "rgb(230,154,185)")) - newColorStops(#(0.0, "rgb(255,209,114)"), #(0.5, "rgb(255,174,81)"), #(1.0, "rgb(241,145,54)")) - newColorStops(#(0.0, "rgb(132,240,135)"), #(0.5, "rgb(91,240,96)"), #(1.0, "rgb(27,245,41)")) - newColorStops(#(0.0, "rgb(250,147,250)"), #(0.5, "rgb(255,80,255)"), #(1.0, "rgb(250,0,217)")) - } - - fun getNext() : Array<#(Double, String)> { - val result = gradients.get(current) - current = (current + 1) % gradients.size() - return result - } -} - -fun v(x : Double, y : Double) = Vector(x, y) - -class Vector(val x : Double = 0.0, val y : Double = 0.0) { - fun plus(v : Vector) = v(x + v.x, y + v.y) - fun minus() = v(-x, -y) - fun minus(v : Vector) = v(x - v.x, y - v.y) - fun times(koef : Double) = v(x * koef, y * koef) - fun distanceTo(v : Vector) = Math.sqrt((this - v).sqr) - fun rotatedBy(theta : Double) : Vector { - val sin = Math.sin(theta) - val cos = Math.cos(theta) - return v(x * cos - y * sin, x * sin + y * cos) - } - - fun isInRect(topLeft : Vector, size : Vector) = (x >= topLeft.x) && (x <= topLeft.x + size.x) && - (y >= topLeft.y) && (y <= topLeft.y + size.y) - - val sqr : Double - get() = x * x + y * y - val normalized : Vector - get() = this * (1.0 / Math.sqrt(sqr)) -} - -fun main() { - val state = CanvasState(getCanvas()) - state.addShape(Kotlin) - state.addShape(Creature(state.size * 0.25, state)) - state.addShape(Creature(state.size * 0.75, state)) - setTimeout({ - state.valid = false - }) -} - -fun List.reversed() : List { - val result = ArrayList() - var i = size() - while (i > 0) { - result.add(get(--i)) - } - return result -} \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/creatures/template.html b/k2js/out/production/examplesForWebDemo/html5/creatures/template.html deleted file mode 100644 index 466bfa8168f..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/creatures/template.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - - - \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/fancyLines/template.html b/k2js/out/production/examplesForWebDemo/html5/fancyLines/template.html deleted file mode 100644 index 64a717ea926..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/fancyLines/template.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/fancyLines/test.kt b/k2js/out/production/examplesForWebDemo/html5/fancyLines/test.kt deleted file mode 100644 index 892bc4695cc..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/fancyLines/test.kt +++ /dev/null @@ -1,64 +0,0 @@ -/* -This example is based on example from html5 canvas2D docs: - http://www.w3.org/TR/2dcontext/ -Note that only a subset of the api is supported for now. -*/ - -package fancylines - -import js.*; -import html5.*; -import jquery.*; - -fun main() { - //jq is a name for JQuery function - jq { - FancyLines().run(); - } -} - -class FancyLines() { - // we use two 'magic' functions here getContext() and getCanvas() - val context = getContext(); - val height = getCanvas().height; - val width = getCanvas().width; - var x = width * Math.random(); - var y = height * Math.random(); - var hue = 0; - - fun line() { - context.save(); - - context.beginPath(); - - context.lineWidth = 20.0 * Math.random(); - context.moveTo(x, y); - - x = width * Math.random(); - y = height * Math.random(); - - context.bezierCurveTo(width * Math.random(), height * Math.random(), - width * Math.random(), height * Math.random(), x, y); - - hue += Math.random() * 10; - - context.strokeStyle = "hsl($hue, 50%, 50%)"; - - context.shadowColor = "white"; - context.shadowBlur = 10.0; - - context.stroke(); - - context.restore(); - } - - fun blank() { - context.fillStyle = "rgba(255,255,1,0.1)"; - context.fillRect(0.0, 0.0, width, height); - } - - fun run() { - setInterval({line()}, 40); - setInterval({blank()}, 100); - } -} \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/floatingText/template.html b/k2js/out/production/examplesForWebDemo/html5/floatingText/template.html deleted file mode 100644 index 557ab5c8b6f..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/floatingText/template.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/floatingText/test.kt b/k2js/out/production/examplesForWebDemo/html5/floatingText/test.kt deleted file mode 100644 index e5bca3ea4d9..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/floatingText/test.kt +++ /dev/null @@ -1,91 +0,0 @@ -/* - This example is just simple text floating around. If u are using chrome, there is a bug that spoil the visuals. -*/ -package hello - -import js.* -import html5.* -import jquery.* - -val context = getContext() -val height = getCanvas().height -val width = getCanvas().width - -// class representing a floating text -class HelloKotlin() { - var relX = 0.2 + 0.2 * Math.random() - var relY = 0.4 + 0.2 * Math.random() - - val absX : Double - get() = (relX * width) - val absY : Double - get() = (relY * height) - - var relXVelocity = randomVelocity() - var relYVelocity = randomVelocity() - - - val message = "Hello, Kotlin!" - val textHeightInPixels = 60 - { - context.font = "bold ${textHeightInPixels}px Georgia, serif" - } - val textWidthInPixels = context.measureText(message).width - - fun draw() { - context.save() - move() - // if you using chrome chances are good you wont see the shadow - context.shadowColor = "#000000" - context.shadowBlur = 5.0 - context.shadowOffsetX = -4.0 - context.shadowOffsetY = 4.0 - context.fillStyle = "rgb(242,160,110)" - context.fillText(message, absX, absY) - context.restore() - } - - fun move() { - val relTextWidth = textWidthInPixels / width - if (relX > (1.0 - relTextWidth - relXVelocity.abs) || relX < relXVelocity.abs) { - relXVelocity *= -1 - } - val relTextHeight = textHeightInPixels / height - if (relY > (1.0 - relYVelocity.abs) || relY < relYVelocity.abs + relTextHeight) { - relYVelocity *= -1 - } - relX += relXVelocity - relY += relYVelocity - } - - fun randomVelocity() = 0.03 * Math.random() * (if (Math.random() < 0.5) 1 else -1) - - - val Double.abs : Double - get() = if (this > 0) this else -this -} - -fun renderBackground() { - context.save() - context.fillStyle = "#5C7EED" - context.fillRect(0.0, 0.0, width, height) - context.restore() -} - -fun main() { - val interval = 50 - // we pass a literal that constructs a new HelloKotlin object - val logos = Array(3) { - HelloKotlin() - } - jq { - setInterval({ - renderBackground() - for (logo in logos) { - logo.draw() - } - }, interval) - } -} - - diff --git a/k2js/out/production/examplesForWebDemo/html5/interactive/jbLogo.png b/k2js/out/production/examplesForWebDemo/html5/interactive/jbLogo.png deleted file mode 100644 index 759aa8ae05a..00000000000 Binary files a/k2js/out/production/examplesForWebDemo/html5/interactive/jbLogo.png and /dev/null differ diff --git a/k2js/out/production/examplesForWebDemo/html5/interactive/main.kt b/k2js/out/production/examplesForWebDemo/html5/interactive/main.kt deleted file mode 100644 index 86eb1c1fdfc..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/interactive/main.kt +++ /dev/null @@ -1,183 +0,0 @@ -package interactive; - -import jquery.*; -import html5.*; -import java.util.ArrayList; -import js.*; -import js.Math; -import js.setInterval -import html5.getCanvas -import html5.getKotlinLogo -import jquery.jq -import js.setTimeout - -val state = CanvasState(getCanvas()); - -fun doWithPeriod(period : Int, f : ()->Unit) { - setInterval(f, period); -} - -abstract class Shape() { - abstract fun draw(state : CanvasState); - abstract fun contains(mousePos : Vector) : Boolean; - abstract var pos : Vector; - var selected : Boolean = false; -} - -class Circle(override var pos : Vector, - var radius : Double = 1.0, - var fillColor : String = "#AAAAAA") : Shape() { - - override fun draw(state : CanvasState) { - val context = state.context; - context.shadowColor = "white"; - context.shadowBlur = 10.0; - context.fillStyle = fillColor; - context.beginPath(); - context.arc(pos.x, pos.y, radius, 0.0, 2 * Math.PI, false); - context.closePath(); - context.fill(); - } - - override fun contains(mousePos : Vector) = pos.distanceTo(mousePos) < radius; -} - -class Rectangle(override var pos : Vector, - var size : Vector) : Shape() -{ - override fun draw(state : CanvasState) { - val context = state.context; - context.fillStyle = "rgba(0,255,0,.6)"; - context.fillRect(pos.x, pos.y, size.x, size.y); - if (selected) { - context.strokeStyle = "#FF0000" - context.lineWidth = 2.0; - context.strokeRect(pos.x, pos.y, size.x, size.y) - } - } - - override fun contains(mousePos : Vector) = mousePos.isInRect(pos, size); -} - -class JB(override var pos : Vector, - var relSize : Double = 0.3) : Shape() -{ - - val imageSize = v(704.0, 254.0) - val canvasSize = imageSize * relSize - - override fun draw(state : CanvasState) { - val context = state.context; - context.drawImage(getKotlinLogo(), 0.0, 0.0, imageSize.x, imageSize.y, pos.x, pos.y, canvasSize.x, canvasSize.y) - } - - override fun contains(mousePos: Vector): Boolean = mousePos.isInRect(pos, canvasSize) -} - -class CanvasState(val canvas : Canvas) { - val width = canvas.width; - val height = canvas.height; - val context = getContext(); - var valid = false; - var shapes = ArrayList(); - var selection : Shape? = null; - var dragOff = Vector(); - val interval = 1000 / 30; - val size = 20.0; - - { - jq(canvas).mousedown { - valid = false; - selection = null; - val mousePos = mousePos(it); - for (shape in shapes) { - if (mousePos in shape) { - dragOff = mousePos - shape.pos; - shape.selected = true; - selection = shape; - break; - } - } - } - - jq(canvas).mousemove { - if (selection != null) { - selection.sure().pos = mousePos(it) - dragOff; - valid = false; - } - } - - jq(canvas).mouseup { - if (selection != null) { - selection.sure().selected = false; - } - selection = null; - valid = false; - } - - jq(canvas).dblclick { - val redTransparentCircle = Circle(mousePos(it), size, "rgba(200, 100, 100, 0.3)"); - addShape(redTransparentCircle); - valid = false; - } - - doWithPeriod(interval) { - draw(); - } - } - - fun mousePos(e : MouseEvent) : Vector { - var offset = Vector(); - var element : DomElement? = canvas; - while (element != null) { - val el : DomElement = element.sure(); - offset += Vector(el.offsetLeft, el.offsetTop); - element = el.offsetParent; - } - return Vector(e.pageX, e.pageY) - offset; - } - - fun addShape(shape : Shape) { - shapes.add(shape); - valid = false; - } - - fun clear() { - context.fillStyle = "#FFFFFF" - context.fillRect(0.0, 0.0, width, height) - context.strokeStyle = "#000000" - context.lineWidth = 4.0; - context.strokeRect(0.0, 0.0, width, height) - } - - fun draw() { - if (valid) return - - clear(); - for (shape in shapes) { - shape.draw(this); - } - valid = true; - } -} - -fun v(x : Double, y : Double) = Vector(x, y); - -class Vector(var x : Double = 0.0, var y : Double = 0.0) { - fun plus(v : Vector) = v(x + v.x, y + v.y); - fun minus(v : Vector) = v(x - v.x, y - v.y); - fun times(coef : Double) = v(x * coef, y * coef); - fun distanceTo(v : Vector) = Math.sqrt((this - v).sqr); - fun isInRect(topLeft : Vector, size : Vector) = (x >= topLeft.x) && (x <= topLeft.x + size.x) && - (y >= topLeft.y) && (y <= topLeft.y + size.y) - val sqr : Double - get() = x * x + y * y; -} - -fun main() { - val state = CanvasState(getCanvas()); - state.addShape(JB(v(1.0, 1.0))); - setTimeout({ - state.valid = false - }) -} \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/interactive/template.html b/k2js/out/production/examplesForWebDemo/html5/interactive/template.html deleted file mode 100644 index d976e3dafc2..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/interactive/template.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - - \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/interactive/template_copy.html b/k2js/out/production/examplesForWebDemo/html5/interactive/template_copy.html deleted file mode 100644 index d3319ca6c00..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/interactive/template_copy.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/interactive2/jbLogo.png b/k2js/out/production/examplesForWebDemo/html5/interactive2/jbLogo.png deleted file mode 100644 index 759aa8ae05a..00000000000 Binary files a/k2js/out/production/examplesForWebDemo/html5/interactive2/jbLogo.png and /dev/null differ diff --git a/k2js/out/production/examplesForWebDemo/html5/interactive2/main.kt b/k2js/out/production/examplesForWebDemo/html5/interactive2/main.kt deleted file mode 100644 index e4bacc02865..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/interactive2/main.kt +++ /dev/null @@ -1,280 +0,0 @@ -package interactive2; - -import jquery.*; -import html5.*; -import java.util.ArrayList; -import js.*; -import js.Math; -import js.setInterval -import html5.getCanvas -import html5.getKotlinLogo -import jquery.jq -import js.setTimeout - -val gradientGenerator = RadialGradientGenerator(getContext()) -val JB = Logo(v(20.0, 20.0)) - -fun doWithPeriod(period : Int, f : ()->Unit) { - setInterval(f, period); -} - -abstract class Shape() { - abstract fun draw(state : CanvasState); - abstract fun contains(mousePos : Vector) : Boolean; - abstract var pos : Vector; - var selected : Boolean = false; -} - -class Logo(override var pos : Vector, - var relSize : Double = 0.3) - : Shape() -{ - val imageSize = v(704.0, 254.0) - val canvasSize = imageSize * relSize - - override fun draw(state : CanvasState) { - val context = state.context; - context.drawImage(getKotlinLogo(), 0.0, 0.0, imageSize.x, imageSize.y, pos.x, pos.y, canvasSize.x, canvasSize.y) - } - - override fun contains(mousePos: Vector): Boolean = mousePos.isInRect(pos, canvasSize) - - val centre : Vector - get() = pos + canvasSize * 0.5 -} - -class Creature(override var pos : Vector, - var state : CanvasState) : Shape() { - - val shadowOffset = v(-5.0, 5.0) - val colorStops = gradientGenerator.getNext() - val relSize = 0.05; - val radius : Double - get() = state.width * relSize; - - val position : Vector - get() = if (selected) pos - shadowOffset else pos - - val directionToLogo : Vector - get() = (JB.centre - position).normalized - - override fun contains(mousePos : Vector) = pos.distanceTo(mousePos) < radius; - - fun Context.fillCircle(position : Vector, rad : Double) { - beginPath(); - arc(position.x, position.y, rad, 0.0, 2 * Math.PI, false); - closePath(); - fill() - } - - override fun draw(state : CanvasState) { - val context = state.context; - if (!selected) { - drawCreature(context) - } else { - drawCreatureWithShadow(context) - } - } - - fun drawCreature(context : Context) { - context.fillStyle = getGradient(context); - context.fillCircle(position, radius) - drawEye(context) - drawTail(context) - } - - fun getGradient(context : Context) : CanvasGradient { - val gradientCentre = position + directionToLogo * (radius / 4) - val gradient = context.createRadialGradient(gradientCentre.x, gradientCentre.y, 1.0, gradientCentre.x, gradientCentre.y, 2 * radius) - for (colorStop in colorStops) { - gradient.addColorStop(colorStop._1, colorStop._2) - } - return gradient; - } - - fun drawTail(context : Context) { - val tailDirection = -directionToLogo; - val tailPos = position + tailDirection * radius * 0.7 - val tailSize = radius * 1.6 - val angle = Math.PI / 6.0; - val p1 = tailPos + tailDirection.rotatedBy(angle) * tailSize - val p2 = tailPos + tailDirection.rotatedBy(-angle) * tailSize - context.fillStyle = getGradient(context) - context.beginPath() - context.moveTo(tailPos.x, tailPos.y) - context.lineTo(p1.x, p1.y) - val middlePoint = position + tailDirection * radius * 1.0 - context.quadraticCurveTo(middlePoint.x, middlePoint.y, p2.x, p2.y) - context.lineTo(tailPos.x, tailPos.y) - context.closePath() - context.fill() - } - - fun drawEye(context : Context) {; - val eyePos = directionToLogo * radius * 0.6 + position; - val eyeRadius = radius / 3; - val eyeLidRadius = eyeRadius / 2; - context.fillStyle = "#FFFFFF"; - context.fillCircle(eyePos, eyeRadius) - context.fillStyle = "#000000" - context.fillCircle(eyePos, eyeLidRadius) - } - - fun drawCreatureWithShadow(context : Context) { - context.save() - setShadow(context) - context.fillStyle = getGradient(context) - context.fillCircle(position, radius) - context.restore(); - drawEye(context) - drawTail(context) - } - - fun setShadow(context : Context) { - context.shadowColor = "rgba(100, 100, 100, 0.7)"; - context.shadowBlur = 5.0; - context.shadowOffsetX = shadowOffset.x; - context.shadowOffsetY = shadowOffset.y; - } -} - -class CanvasState(val canvas : Canvas) { - val width = canvas.width; - val height = canvas.height; - val context = getContext(); - var valid = false; - var shapes = ArrayList(); - var selection : Shape? = null; - var dragOff = Vector(); - val interval = 1000 / 30; - - { - jq(canvas).mousedown { - valid = false; - selection = null; - val mousePos = mousePos(it); - for (shape in shapes) { - if (mousePos in shape) { - dragOff = mousePos - shape.pos; - shape.selected = true; - selection = shape; - break; - } - } - } - - jq(canvas).mousemove { - if (selection != null) { - selection.sure().pos = mousePos(it) - dragOff; - valid = false; - } - } - - jq(canvas).mouseup { - if (selection != null) { - selection.sure().selected = false; - } - selection = null; - valid = false; - } - - jq(canvas).dblclick { - val redTransparentCircle = Creature(mousePos(it), this @CanvasState); - addShape(redTransparentCircle); - valid = false; - } - - doWithPeriod(interval) { - draw(); - } - } - - fun mousePos(e : MouseEvent) : Vector { - var offset = Vector(); - var element : DomElement? = canvas; - while (element != null) { - val el : DomElement = element.sure(); - offset += Vector(el.offsetLeft, el.offsetTop); - element = el.offsetParent; - } - return Vector(e.pageX, e.pageY) - offset; - } - - fun addShape(shape : Shape) { - shapes.add(shape); - valid = false; - } - - fun clear() { - context.fillStyle = "#FFFFFF" - context.fillRect(0.0, 0.0, width, height) - context.strokeStyle = "#000000" - context.lineWidth = 4.0; - context.strokeRect(0.0, 0.0, width, height) - } - - fun draw() { - if (valid) return - - clear(); - for (shape in shapes) { - shape.draw(this); - } - valid = true; - } -} - -class RadialGradientGenerator(val context : Context) { - val gradients = ArrayList>(); - var current = 0 - - fun newColorStops(vararg colorStops : #(Double, String)) { - gradients.add(colorStops) - } - - { - newColorStops(#(0.0, "#F59898"), #(0.5, "#F57373"), #(1.0, "#DB6B6B")) - newColorStops(#(0.39, "rgb(140,167,209)"), #(0.7, "rgb(104,139,209)"), #(0.85, "rgb(67,122,217)")) - newColorStops(#(0.0, "rgb(255,222,255)"), #(0.5, "rgb(255,185,222)"), #(1.0, "rgb(230,154,185)")) - newColorStops(#(0.0, "rgb(255,209,114)"), #(0.5, "rgb(255,174,81)"), #(1.0, "rgb(241,145,54)")) - newColorStops(#(0.0, "rgb(132,240,135)"), #(0.5, "rgb(91,240,96)"), #(1.0, "rgb(27,245,41)")) - newColorStops(#(0.0, "rgb(250,147,250)"), #(0.5, "rgb(255,80,255)"), #(1.0, "rgb(250,0,217)")) -} - - fun getNext() : Array<#(Double, String)> { - val result = gradients.get(current) - current = (current + 1) % gradients.size() - return result - } -} - -fun v(x : Double, y : Double) = Vector(x, y); - -class Vector(val x : Double = 0.0, val y : Double = 0.0) { - fun plus(v : Vector) = v(x + v.x, y + v.y); - fun minus() = v(-x, -y) - fun minus(v : Vector) = v(x - v.x, y - v.y) - fun times(coef : Double) = v(x * coef, y * coef) - fun distanceTo(v : Vector) = Math.sqrt((this - v).sqr) - fun rotatedBy(theta : Double) : Vector { - val sin = Math.sin(theta) - val cos = Math.cos(theta) - return v(x * cos - y * sin, x * sin + y * cos) - } - - fun isInRect(topLeft : Vector, size : Vector) = (x >= topLeft.x) && (x <= topLeft.x + size.x) && - (y >= topLeft.y) && (y <= topLeft.y + size.y) - - val sqr : Double - get() = x * x + y * y - val normalized : Vector - get() = this * (1.0 / Math.sqrt(sqr)) -} - -fun main() { - val state = CanvasState(getCanvas()); - state.addShape(JB); - setTimeout({ - state.valid = false - }) -} \ No newline at end of file diff --git a/k2js/out/production/examplesForWebDemo/html5/interactive2/template.html b/k2js/out/production/examplesForWebDemo/html5/interactive2/template.html deleted file mode 100644 index f7399d7ee00..00000000000 --- a/k2js/out/production/examplesForWebDemo/html5/interactive2/template.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - Canvas demo - - - - - - - - - - \ No newline at end of file diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$1.class deleted file mode 100644 index 105fe787b6c..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$2.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$2.class deleted file mode 100644 index c7c92880287..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$2.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$3.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$3.class deleted file mode 100644 index dbb559e9a16..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade$3.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.class deleted file mode 100644 index c0612986958..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/AnalyzerFacade.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaBridgeConfiguration.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaBridgeConfiguration.class deleted file mode 100644 index ad0d1b9bd4b..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaBridgeConfiguration.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassMembersScope.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassMembersScope.class deleted file mode 100644 index f2fe26edc0c..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassMembersScope.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassOrPackageScope.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassOrPackageScope.class deleted file mode 100644 index b53e735db73..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaClassOrPackageScope.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1.class deleted file mode 100644 index 005b926c46d..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1GroupingValue.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1GroupingValue.class deleted file mode 100644 index 3b3526f66f0..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$1GroupingValue.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$2.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$2.class deleted file mode 100644 index 2d958903ae0..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$2.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$3.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$3.class deleted file mode 100644 index cf66beeb7f9..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$3.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$4$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$4$1.class deleted file mode 100644 index 7b2a6e148be..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$4$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$4.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$4.class deleted file mode 100644 index c45e2795e42..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$4.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5$1.class deleted file mode 100644 index b18cb919a88..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5$2.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5$2.class deleted file mode 100644 index 5d12124d7c1..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5$2.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5.class deleted file mode 100644 index a132b9ac63b..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$5.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$6.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$6.class deleted file mode 100644 index b2158308f92..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$6.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$7$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$7$1.class deleted file mode 100644 index 962189cc166..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$7$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$7.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$7.class deleted file mode 100644 index 2cc4b84cc9b..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$7.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor$1.class deleted file mode 100644 index 5c1f71999e4..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor$2.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor$2.class deleted file mode 100644 index cca86d5fcbb..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor$2.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor.class deleted file mode 100644 index cc10ba7f643..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JetSignatureTypeParameterVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JvmMethodParameterKind.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JvmMethodParameterKind.class deleted file mode 100644 index a0372e84b84..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JvmMethodParameterKind.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JvmMethodParameterMeaning.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JvmMethodParameterMeaning.class deleted file mode 100644 index 90abdef0a39..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$JvmMethodParameterMeaning.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverBinaryClassData.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverBinaryClassData.class deleted file mode 100644 index b69dfdedbb0..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverBinaryClassData.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverClassData.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverClassData.class deleted file mode 100644 index d6533391ea5..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverClassData.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverNamespaceData.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverNamespaceData.class deleted file mode 100644 index 86ee3453747..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverNamespaceData.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverScopeData.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverScopeData.class deleted file mode 100644 index bb7ed66bb09..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverScopeData.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverSrcClassData.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverSrcClassData.class deleted file mode 100644 index 77548e3565c..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ResolverSrcClassData.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$TypeParameterDescriptorInitialization.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$TypeParameterDescriptorInitialization.class deleted file mode 100644 index e03400b06d5..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$TypeParameterDescriptorInitialization.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$TypeParameterDescriptorOrigin.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$TypeParameterDescriptorOrigin.class deleted file mode 100644 index ead9200bdcc..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$TypeParameterDescriptorOrigin.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ValueParameterDescriptors.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ValueParameterDescriptors.class deleted file mode 100644 index 1456e888b71..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver$ValueParameterDescriptors.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.class deleted file mode 100644 index 1f97e7f1606..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper$1.class deleted file mode 100644 index 0daec696c8e..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper$Builder.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper$Builder.class deleted file mode 100644 index f859c1b762f..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper$Builder.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper.class deleted file mode 100644 index c95ebb3b616..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaDescriptorResolverHelper.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaNamespaceDescriptor.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaNamespaceDescriptor.class deleted file mode 100644 index aa3a91a44b2..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaNamespaceDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.class deleted file mode 100644 index 2c46decd378..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaPackageScope.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaSemanticServices.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaSemanticServices.class deleted file mode 100644 index 04390c35eed..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaSemanticServices.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$1.class deleted file mode 100644 index 138b4c9917f..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$2.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$2.class deleted file mode 100644 index 94b85103e24..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$2.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$3.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$3.class deleted file mode 100644 index 4c3be1e48bc..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer$3.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.class deleted file mode 100644 index 9dd87cd8c85..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JavaTypeTransformer.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetJavaMirrorMarker.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetJavaMirrorMarker.class deleted file mode 100644 index dd04962f535..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetJavaMirrorMarker.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetSignatureUtils.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetSignatureUtils.class deleted file mode 100644 index 0f96197eee7..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetSignatureUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$1.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$1.class deleted file mode 100644 index deae9e68143..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$1.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$2.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$2.class deleted file mode 100644 index 2a05b904457..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$2.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$3.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$3.class deleted file mode 100644 index 1e5a3b7a5da..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader$3.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader.class deleted file mode 100644 index 99072f15b14..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JetTypeJetSignatureReader.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmAbi.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmAbi.class deleted file mode 100644 index addf271b2d2..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmAbi.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmClassName.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmClassName.class deleted file mode 100644 index bf0e9ea87a3..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmClassName.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType$MapByAsmTypeHolder.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType$MapByAsmTypeHolder.class deleted file mode 100644 index 1e8db6cea9e..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType$MapByAsmTypeHolder.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType$MapByWrapperAsmTypeHolder.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType$MapByWrapperAsmTypeHolder.class deleted file mode 100644 index f5dd3173474..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType$MapByWrapperAsmTypeHolder.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType.class deleted file mode 100644 index 915a2b8e9c7..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmPrimitiveType.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmStdlibNames.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmStdlibNames.class deleted file mode 100644 index fb9d2bc6cc7..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/JvmStdlibNames.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/NamedMembers.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/NamedMembers.class deleted file mode 100644 index df278f24f55..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/NamedMembers.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PropertyAccessorData.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PropertyAccessorData.class deleted file mode 100644 index 5ac3763aed6..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PropertyAccessorData.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiClassWrapper.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiClassWrapper.class deleted file mode 100644 index 3476245b2d9..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiClassWrapper.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiFieldWrapper.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiFieldWrapper.class deleted file mode 100644 index dca2aa518ab..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiFieldWrapper.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiMemberWrapper.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiMemberWrapper.class deleted file mode 100644 index de77533d633..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiMemberWrapper.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiMethodWrapper.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiMethodWrapper.class deleted file mode 100644 index d8574080949..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiMethodWrapper.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiParameterWrapper.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiParameterWrapper.class deleted file mode 100644 index e9713dd04da..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/PsiParameterWrapper.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeSource.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeSource.class deleted file mode 100644 index 9b59708ab5e..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeSource.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolver.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolver.class deleted file mode 100644 index 67f4a8f32fc..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolverFromOuters.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolverFromOuters.class deleted file mode 100644 index d2c58a30947..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolverFromOuters.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolverFromTypeDescriptors.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolverFromTypeDescriptors.class deleted file mode 100644 index 5f7e502bded..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolverFromTypeDescriptors.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolvers.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolvers.class deleted file mode 100644 index 74af84f3344..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/TypeVariableResolvers.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/alt/AltClassFinder.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/alt/AltClassFinder.class deleted file mode 100644 index 1bdc1829963..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/alt/AltClassFinder.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetClassAnnotation.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetClassAnnotation.class deleted file mode 100644 index 82d6dc0f5d5..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetClassAnnotation.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetConstructorAnnotation.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetConstructorAnnotation.class deleted file mode 100644 index d201de9055a..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetConstructorAnnotation.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetMethodAnnotation.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetMethodAnnotation.class deleted file mode 100644 index 6c931b4ad56..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetMethodAnnotation.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetTypeParameterAnnotation.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetTypeParameterAnnotation.class deleted file mode 100644 index 7edb588d6dd..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetTypeParameterAnnotation.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetValueParameterAnnotation.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetValueParameterAnnotation.class deleted file mode 100644 index 022d1ad61a7..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/JetValueParameterAnnotation.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/PsiAnnotationUtils.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/PsiAnnotationUtils.class deleted file mode 100644 index f5ba0a12e93..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/PsiAnnotationUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/PsiAnnotationWrapper.class b/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/PsiAnnotationWrapper.class deleted file mode 100644 index 5b62e8d97ee..00000000000 Binary files a/k2js/out/production/frontend.java/org/jetbrains/jet/lang/resolve/java/kt/PsiAnnotationWrapper.class and /dev/null differ diff --git a/k2js/out/production/frontend/jet/Arrays.jet b/k2js/out/production/frontend/jet/Arrays.jet deleted file mode 100644 index be3608b03ef..00000000000 --- a/k2js/out/production/frontend/jet/Arrays.jet +++ /dev/null @@ -1,84 +0,0 @@ -package jet - -fun Array(val size : Int) : Array - -class Array(val size : Int, init : (Int) -> T) { - fun get(index : Int) : T - fun set(index : Int, value : T) : Unit - - fun iterator() : Iterator - - val indices : IntRange -} - -class ByteArray(val size : Int) { - fun get(index : Int) : Byte - fun set(index : Int, value : Byte) : Unit - - fun iterator() : ByteIterator - - val indices : IntRange -} - -class ShortArray(val size : Int) { - fun get(index : Int) : Short - fun set(index : Int, value : Short) : Unit - - fun iterator() : ShortIterator - - val indices : IntRange -} - -class IntArray(val size : Int) { - fun get(index : Int) : Int - fun set(index : Int, value : Int) : Unit - - fun iterator() : IntIterator - - val indices : IntRange -} - -class LongArray(val size : Int) { - fun get(index : Int) : Long - fun set(index : Int, value : Long) : Unit - - fun iterator() : LongIterator - - val indices : IntRange -} - -class FloatArray(val size : Int) { - fun get(index : Int) : Float - fun set(index : Int, value : Float) : Unit - - fun iterator() : FloatIterator - - val indices : IntRange -} - -class DoubleArray(val size : Int) { - fun get(index : Int) : Double - fun set(index : Int, value : Double) : Unit - - fun iterator() : DoubleIterator - - val indices : IntRange -} - -class CharArray(val size : Int) { - fun get(index : Int) : Char - fun set(index : Int, value : Char) : Unit - - fun iterator() : CharIterator - - val indices : IntRange -} - -class BooleanArray(val size : Int) { - fun get(index : Int) : Boolean - fun set(index : Int, value : Boolean) : Unit - - fun iterator() : BooleanIterator - - val indices : IntRange -} diff --git a/k2js/out/production/frontend/jet/Iterables.jet b/k2js/out/production/frontend/jet/Iterables.jet deleted file mode 100644 index 900ed28a17b..00000000000 --- a/k2js/out/production/frontend/jet/Iterables.jet +++ /dev/null @@ -1,37 +0,0 @@ -package jet - -trait Iterable { - fun iterator() : Iterator -} - -trait ByteIterable : Iterable { - override fun iterator() : ByteIterator -} - -trait ShortIterable : Iterable { - override fun iterator() : ShortIterator -} - -trait IntIterable : Iterable { - override fun iterator() : IntIterator -} - -trait LongIterable : Iterable { - override fun iterator() : LongIterator -} - -trait FloatIterable : Iterable { - override fun iterator() : FloatIterator -} - -trait DoubleIterable : Iterable { - override fun iterator() : DoubleIterator -} - -trait BooleanIterable : Iterable { - override fun iterator() : BooleanIterator -} - -trait CharIterable : Iterable { - override fun iterator() : CharIterator -} diff --git a/k2js/out/production/frontend/jet/Iterators.jet b/k2js/out/production/frontend/jet/Iterators.jet deleted file mode 100644 index d96b8e3bad6..00000000000 --- a/k2js/out/production/frontend/jet/Iterators.jet +++ /dev/null @@ -1,73 +0,0 @@ -package.jet - -trait Iterator { - fun next() : T - val hasNext : Boolean -} - -abstract open class ByteIterator() : Iterator { - abstract open fun nextByte() : Byte - - override fun next() : Byte -} - -abstract open class ShortIterator() : Iterator { - abstract open fun nextShort() : Short - - override fun next() : Short -} - -abstract open class CharIterator() : Iterator { - abstract open fun nextChar() : Char - - override fun next() : Char -} - -abstract open class IntIterator() : Iterator { - abstract open fun nextInt() : Int - - override fun next() : Int -} - -abstract open class LongIterator() : Iterator { - abstract open fun nextLong() : Long - - override fun next() : Long -} - -abstract open class FloatIterator() : Iterator { - abstract open fun nextFloat() : Float - - override fun next() : Float -} - -abstract open class DoubleIterator() : Iterator { - abstract open fun nextDouble() : Double - - override fun next() : Double -} - -abstract open class BooleanIterator() : Iterator { - abstract open fun nextBoolean() : Boolean - - override fun next() : Boolean -} - -fun Iterator.iterator() : Iterator - -fun ByteIterator.iterator() : ByteIterator - -fun ShortIterator.iterator() : ShortIterator - -fun CharIterator.iterator() : CharIterator - -fun IntIterator.iterator() : IntIterator - -fun BooleanIterator.iterator() : BooleanIterator - -fun DoubleIterator.iterator() : DoubleIterator - -fun FloatIterator.iterator() : FloatIterator - -fun LongIterator.iterator() : LongIterator - diff --git a/k2js/out/production/frontend/jet/Library.jet b/k2js/out/production/frontend/jet/Library.jet deleted file mode 100644 index 6d15cfc9d09..00000000000 --- a/k2js/out/production/frontend/jet/Library.jet +++ /dev/null @@ -1,61 +0,0 @@ -package jet - -class TypeInfo { - fun isSubtypeOf(other : TypeInfo<*>) : Boolean - fun isInstance(obj : Any?) : Boolean -} - -fun typeinfo() : TypeInfo -fun typeinfo(expression : T) : TypeInfo - -annotation class volatile -annotation class atomic - -fun synchronized(lock: Any, block : () -> R) : R - -fun Any?.identityEquals(other : Any?) : Boolean // = this === other - -// Can't write a body due to a bootstrapping problem (see JET-74) -fun Any?.equals(other : Any?) : Boolean// = this === other - -// Returns "null" for null -fun Any?.toString() : String// = this === other - -fun T?.sure() : T - -fun String?.plus(other: Any?) : String - -trait Comparable { - fun compareTo(other : T) : Int -} - -trait Hashable { - fun hashCode() : Int - fun equals(other : Any?) : Boolean -} - -class Boolean : Comparable { - fun not() : Boolean - - fun and(other : Boolean) : Boolean - - fun or(other : Boolean) : Boolean - - fun xor(other : Boolean) : Boolean - - fun equals(other : Any?) : Boolean -} - -trait CharSequence { - fun get(index : Int) : Char - - val length : Int - - fun toString() : String -} - -class String() : Comparable, CharSequence { - fun plus(other : Any?) : String - - fun equals(other : Any?) : Boolean -} diff --git a/k2js/out/production/frontend/jet/Numbers.jet b/k2js/out/production/frontend/jet/Numbers.jet deleted file mode 100644 index 719bcf2ea52..00000000000 --- a/k2js/out/production/frontend/jet/Numbers.jet +++ /dev/null @@ -1,586 +0,0 @@ -package jet - -abstract class Number : Hashable { - abstract val dbl : Double - abstract val flt : Float - abstract val lng : Long - abstract val int : Int - abstract val chr : Char - abstract val sht : Short - abstract val byt : Byte -// fun equals(other : Double) : Boolean -// fun equals(other : Float) : Boolean -// fun equals(other : Long) : Boolean -// fun equals(other : Byte) : Boolean -// fun equals(other : Int) : Boolean -// fun equals(other : Short) : Boolean -// fun equals(other : Char) : Boolean -} - -class Double : Number, Comparable { - override fun compareTo(other : Double) : Int - fun compareTo(other : Float) : Int - fun compareTo(other : Long) : Int - fun compareTo(other : Int) : Int - fun compareTo(other : Short) : Int - fun compareTo(other : Byte) : Int - fun compareTo(other : Char) : Int - - fun plus(other : Double) : Double - fun plus(other : Float) : Double - fun plus(other : Long) : Double - fun plus(other : Int) : Double - fun plus(other : Short) : Double - fun plus(other : Byte) : Double - fun plus(other : Char) : Double - - fun minus(other : Double) : Double - fun minus(other : Float) : Double - fun minus(other : Long) : Double - fun minus(other : Int) : Double - fun minus(other : Short) : Double - fun minus(other : Byte) : Double - fun minus(other : Char) : Double - - fun times(other : Double) : Double - fun times(other : Float) : Double - fun times(other : Long) : Double - fun times(other : Int) : Double - fun times(other : Short) : Double - fun times(other : Byte) : Double - fun times(other : Char) : Double - - fun div(other : Double) : Double - fun div(other : Float) : Double - fun div(other : Long) : Double - fun div(other : Int) : Double - fun div(other : Short) : Double - fun div(other : Byte) : Double - fun div(other : Char) : Double - - fun mod(other : Double) : Double - fun mod(other : Float) : Double - fun mod(other : Long) : Double - fun mod(other : Int) : Double - fun mod(other : Short) : Double - fun mod(other : Byte) : Double - - fun rangeTo(other : Double) : DoubleRange - fun rangeTo(other : Float) : DoubleRange - fun rangeTo(other : Long) : DoubleRange - fun rangeTo(other : Int) : DoubleRange - fun rangeTo(other : Short) : DoubleRange - fun rangeTo(other : Byte) : DoubleRange - fun rangeTo(other : Char) : DoubleRange - - fun upto(other : Double) : DoubleRange - fun upto(other : Float) : DoubleRange - fun upto(other : Long) : DoubleRange - fun upto(other : Int) : DoubleRange - fun upto(other : Short) : DoubleRange - fun upto(other : Byte) : DoubleRange - fun upto(other : Char) : DoubleRange - - fun downto(other : Double) : DoubleRange - fun downto(other : Float) : DoubleRange - fun downto(other : Long) : DoubleRange - fun downto(other : Int) : DoubleRange - fun downto(other : Short) : DoubleRange - fun downto(other : Byte) : DoubleRange - fun downto(other : Char) : DoubleRange - - fun inc() : Double - fun dec() : Double - fun plus() : Double - fun minus() : Double -} - -class Float : Number, Comparable { - fun compareTo(other : Double) : Int - override fun compareTo(other : Float) : Int - fun compareTo(other : Long) : Int - fun compareTo(other : Int) : Int - fun compareTo(other : Short) : Int - fun compareTo(other : Byte) : Int - fun compareTo(other : Char) : Int - - fun plus(other : Double) : Double - fun plus(other : Float) : Float - fun plus(other : Long) : Float - fun plus(other : Int) : Float - fun plus(other : Short) : Float - fun plus(other : Byte) : Float - fun plus(other : Char) : Float - - fun minus(other : Double) : Double - fun minus(other : Float) : Float - fun minus(other : Long) : Float - fun minus(other : Int) : Float - fun minus(other : Short) : Float - fun minus(other : Byte) : Float - fun minus(other : Char) : Float - - fun times(other : Double) : Double - fun times(other : Float) : Float - fun times(other : Long) : Float - fun times(other : Int) : Float - fun times(other : Short) : Float - fun times(other : Byte) : Float - fun times(other : Char) : Float - - fun div(other : Double) : Double - fun div(other : Float) : Float - fun div(other : Long) : Float - fun div(other : Int) : Float - fun div(other : Short) : Float - fun div(other : Byte) : Float - fun div(other : Char) : Float - - fun mod(other : Double) : Double - fun mod(other : Float) : Float - fun mod(other : Long) : Float - fun mod(other : Int) : Float - fun mod(other : Short) : Float - fun mod(other : Byte) : Float - fun mod(other : Char) : Float - - fun rangeTo(other : Double) : DoubleRange - fun rangeTo(other : Float) : FloatRange - fun rangeTo(other : Long) : DoubleRange - fun rangeTo(other : Int) : FloatRange - fun rangeTo(other : Short) : FloatRange - fun rangeTo(other : Byte) : FloatRange - fun rangeTo(other : Char) : FloatRange - - fun upto(other : Double) : DoubleRange - fun upto(other : Float) : FloatRange - fun upto(other : Long) : DoubleRange - fun upto(other : Int) : FloatRange - fun upto(other : Short) : FloatRange - fun upto(other : Byte) : FloatRange - fun upto(other : Char) : FloatRange - - fun downto(other : Double) : DoubleRange - fun downto(other : Float) : FloatRange - fun downto(other : Long) : DoubleRange - fun downto(other : Int) : FloatRange - fun downto(other : Short) : FloatRange - fun downto(other : Byte) : FloatRange - fun downto(other : Char) : FloatRange - - fun inc() : Float - fun dec() : Float - fun plus() : Float - fun minus() : Float -} - -class Long : Number, Comparable { - fun compareTo(other : Double) : Int - fun compareTo(other : Float) : Int - override fun compareTo(other : Long) : Int - fun compareTo(other : Int) : Int - fun compareTo(other : Short) : Int - fun compareTo(other : Byte) : Int - fun compareTo(other : Char) : Int - - fun plus(other : Double) : Double - fun plus(other : Float) : Float - fun plus(other : Long) : Long - fun plus(other : Int) : Long - fun plus(other : Short) : Long - fun plus(other : Byte) : Long - fun plus(other : Char) : Long - - fun minus(other : Double) : Double - fun minus(other : Float) : Float - fun minus(other : Long) : Long - fun minus(other : Int) : Long - fun minus(other : Short) : Long - fun minus(other : Byte) : Long - fun minus(other : Char) : Long - - fun times(other : Double) : Double - fun times(other : Float) : Float - fun times(other : Long) : Long - fun times(other : Int) : Long - fun times(other : Short) : Long - fun times(other : Byte) : Long - fun times(other : Char) : Long - - fun div(other : Double) : Double - fun div(other : Float) : Float - fun div(other : Long) : Long - fun div(other : Int) : Long - fun div(other : Short) : Long - fun div(other : Byte) : Long - fun div(other : Char) : Long - - fun mod(other : Double) : Double - fun mod(other : Float) : Float - fun mod(other : Long) : Long - fun mod(other : Int) : Long - fun mod(other : Short) : Long - fun mod(other : Byte) : Long - fun mod(other : Char) : Long - - fun rangeTo(other : Double) : DoubleRange - fun rangeTo(other : Float) : FloatRange - fun rangeTo(other : Long) : LongRange - fun rangeTo(other : Int) : LongRange - fun rangeTo(other : Short) : LongRange - fun rangeTo(other : Byte) : LongRange - fun rangeTo(other : Char) : LongRange - - fun upto(other : Double) : DoubleRange - fun upto(other : Float) : FloatRange - fun upto(other : Long) : LongRange - fun upto(other : Int) : LongRange - fun upto(other : Short) : LongRange - fun upto(other : Byte) : LongRange - fun upto(other : Char) : LongRange - - fun downto(other : Double) : DoubleRange - fun downto(other : Float) : FloatRange - fun downto(other : Long) : LongRange - fun downto(other : Int) : LongRange - fun downto(other : Short) : LongRange - fun downto(other : Byte) : LongRange - fun downto(other : Char) : LongRange - - fun inc() : Long - fun dec() : Long - fun plus() : Long - fun minus() : Long - - fun shl(bits : Int) : Long - fun shr(bits : Int) : Long - fun ushr(bits : Int) : Long - fun and(other : Long) : Long - fun or(other : Long) : Long - fun xor(other : Long) : Long - fun inv() : Long -} - -class Int : Number, Comparable { - fun compareTo(other : Double) : Int - fun compareTo(other : Float) : Int - fun compareTo(other : Long) : Int - override fun compareTo(other : Int) : Int - fun compareTo(other : Short) : Int - fun compareTo(other : Byte) : Int - fun compareTo(other : Char) : Int - - fun plus(other : Double) : Double - fun plus(other : Float) : Float - fun plus(other : Long) : Long - fun plus(other : Int) : Int - fun plus(other : Short) : Int - fun plus(other : Byte) : Int - fun plus(other : Char) : Int - - fun minus(other : Double) : Double - fun minus(other : Float) : Float - fun minus(other : Long) : Long - fun minus(other : Int) : Int - fun minus(other : Short) : Int - fun minus(other : Byte) : Int - fun minus(other : Char) : Int - - fun times(other : Double) : Double - fun times(other : Float) : Float - fun times(other : Long) : Long - fun times(other : Int) : Int - fun times(other : Short) : Int - fun times(other : Byte) : Int - fun times(other : Char) : Int - - fun div(other : Double) : Double - fun div(other : Float) : Float - fun div(other : Long) : Long - fun div(other : Int) : Int - fun div(other : Short) : Int - fun div(other : Byte) : Int - fun div(other : Char) : Int - - fun mod(other : Double) : Double - fun mod(other : Float) : Float - fun mod(other : Long) : Long - fun mod(other : Int) : Int - fun mod(other : Short) : Int - fun mod(other : Byte) : Int - fun mod(other : Char) : Int - - fun rangeTo(other : Double) : DoubleRange - fun rangeTo(other : Float) : FloatRange - fun rangeTo(other : Long) : LongRange - fun rangeTo(other : Int) : IntRange - fun rangeTo(other : Short) : IntRange - fun rangeTo(other : Byte) : IntRange - fun rangeTo(other : Char) : IntRange - - fun upto(other : Double) : DoubleRange - fun upto(other : Float) : FloatRange - fun upto(other : Long) : LongRange - fun upto(other : Int) : IntRange - fun upto(other : Short) : IntRange - fun upto(other : Byte) : IntRange - fun upto(other : Char) : IntRange - - fun downto(other : Double) : DoubleRange - fun downto(other : Float) : FloatRange - fun downto(other : Long) : LongRange - fun downto(other : Int) : IntRange - fun downto(other : Short) : IntRange - fun downto(other : Byte) : IntRange - fun downto(other : Char) : IntRange - - fun inc() : Int - fun dec() : Int - fun plus() : Int - fun minus() : Int - - fun shl(bits : Int) : Int - fun shr(bits : Int) : Int - fun ushr(bits : Int) : Int - fun and(other : Int) : Int - fun or(other : Int) : Int - fun xor(other : Int) : Int - fun inv() : Int -} - -class Char : Number, Comparable { - fun compareTo(other : Double) : Int - fun compareTo(other : Float) : Int - fun compareTo(other : Long) : Int - fun compareTo(other : Int) : Int - fun compareTo(other : Short) : Int - override fun compareTo(other : Char) : Int - fun compareTo(other : Byte) : Int - - fun plus(other : Double) : Double - fun plus(other : Float) : Float - fun plus(other : Long) : Long - fun plus(other : Int) : Int - fun plus(other : Short) : Int - fun plus(other : Byte) : Int -// fun plus(other : Char) : Int - - fun minus(other : Double) : Double - fun minus(other : Float) : Float - fun minus(other : Long) : Long - fun minus(other : Int) : Int - fun minus(other : Short) : Int - fun minus(other : Byte) : Int - fun minus(other : Char) : Int - - fun times(other : Double) : Double - fun times(other : Float) : Float - fun times(other : Long) : Long - fun times(other : Int) : Int - fun times(other : Short) : Int - fun times(other : Byte) : Int -// fun times(other : Char) : Int - - fun div(other : Double) : Double - fun div(other : Float) : Float - fun div(other : Long) : Long - fun div(other : Int) : Int - fun div(other : Short) : Int - fun div(other : Byte) : Int -// fun div(other : Char) : Int - - fun mod(other : Double) : Double - fun mod(other : Float) : Float - fun mod(other : Long) : Long - fun mod(other : Int) : Int - fun mod(other : Short) : Int - fun mod(other : Byte) : Int -// fun mod(other : Char) : Int - - fun rangeTo(other : Double) : DoubleRange - fun rangeTo(other : Float) : FloatRange - fun rangeTo(other : Long) : LongRange - fun rangeTo(other : Int) : IntRange - fun rangeTo(other : Short) : ShortRange - fun rangeTo(other : Byte) : CharRange - fun rangeTo(other : Char) : CharRange - - fun upto(other : Double) : DoubleRange - fun upto(other : Float) : FloatRange - fun upto(other : Long) : LongRange - fun upto(other : Int) : IntRange - fun upto(other : Short) : ShortRange - fun upto(other : Byte) : CharRange - fun upto(other : Char) : CharRange - - fun downto(other : Double) : DoubleRange - fun downto(other : Float) : FloatRange - fun downto(other : Long) : LongRange - fun downto(other : Int) : IntRange - fun downto(other : Short) : ShortRange - fun downto(other : Byte) : CharRange - fun downto(other : Char) : CharRange - - fun inc() : Char - fun dec() : Char - fun plus() : Int - fun minus() : Int -} - -class Short : Number, Comparable { - fun compareTo(other : Double) : Int - fun compareTo(other : Float) : Int - fun compareTo(other : Long) : Int - fun compareTo(other : Int) : Int - override fun compareTo(other : Short) : Int - fun compareTo(other : Byte) : Int - fun compareTo(other : Char) : Int - - fun plus(other : Double) : Double - fun plus(other : Float) : Float - fun plus(other : Long) : Long - fun plus(other : Int) : Int - fun plus(other : Short) : Int - fun plus(other : Byte) : Int - fun plus(other : Char) : Int - - fun minus(other : Double) : Double - fun minus(other : Float) : Float - fun minus(other : Long) : Long - fun minus(other : Int) : Int - fun minus(other : Short) : Int - fun minus(other : Byte) : Int - fun minus(other : Char) : Int - - fun times(other : Double) : Double - fun times(other : Float) : Float - fun times(other : Long) : Long - fun times(other : Int) : Int - fun times(other : Short) : Int - fun times(other : Byte) : Int - fun times(other : Char) : Int - - fun div(other : Double) : Double - fun div(other : Float) : Float - fun div(other : Long) : Long - fun div(other : Int) : Int - fun div(other : Short) : Int - fun div(other : Byte) : Int - fun div(other : Char) : Int - - fun mod(other : Double) : Double - fun mod(other : Float) : Float - fun mod(other : Long) : Long - fun mod(other : Int) : Int - fun mod(other : Short) : Int - fun mod(other : Byte) : Int - fun mod(other : Char) : Int - - fun rangeTo(other : Double) : DoubleRange - fun rangeTo(other : Float) : FloatRange - fun rangeTo(other : Long) : LongRange - fun rangeTo(other : Int) : IntRange - fun rangeTo(other : Short) : ShortRange - fun rangeTo(other : Byte) : ShortRange - fun rangeTo(other : Char) : ShortRange - - fun upto(other : Double) : DoubleRange - fun upto(other : Float) : FloatRange - fun upto(other : Long) : LongRange - fun upto(other : Int) : IntRange - fun upto(other : Short) : ShortRange - fun upto(other : Byte) : ShortRange - fun upto(other : Char) : ShortRange - - fun downto(other : Double) : DoubleRange - fun downto(other : Float) : FloatRange - fun downto(other : Long) : LongRange - fun downto(other : Int) : IntRange - fun downto(other : Short) : ShortRange - fun downto(other : Byte) : ShortRange - fun downto(other : Char) : ShortRange - - fun inc() : Short - fun dec() : Short - fun plus() : Short - fun minus() : Short -} - -class Byte : Number, Comparable { - fun compareTo(other : Double) : Int - fun compareTo(other : Float) : Int - fun compareTo(other : Long) : Int - fun compareTo(other : Int) : Int - fun compareTo(other : Short) : Int - fun compareTo(other : Char) : Int - override fun compareTo(other : Byte) : Int - - fun plus(other : Double) : Double - fun plus(other : Float) : Float - fun plus(other : Long) : Long - fun plus(other : Int) : Int - fun plus(other : Short) : Int - fun plus(other : Byte) : Int - fun plus(other : Char) : Int - - fun minus(other : Double) : Double - fun minus(other : Float) : Float - fun minus(other : Long) : Long - fun minus(other : Int) : Int - fun minus(other : Short) : Int - fun minus(other : Byte) : Int - fun minus(other : Char) : Int - - fun times(other : Double) : Double - fun times(other : Float) : Float - fun times(other : Long) : Long - fun times(other : Int) : Int - fun times(other : Short) : Int - fun times(other : Byte) : Int - fun times(other : Char) : Int - - fun div(other : Double) : Double - fun div(other : Float) : Float - fun div(other : Long) : Long - fun div(other : Int) : Int - fun div(other : Short) : Int - fun div(other : Byte) : Int - fun div(other : Char) : Int - - fun mod(other : Double) : Double - fun mod(other : Float) : Float - fun mod(other : Long) : Long - fun mod(other : Int) : Int - fun mod(other : Short) : Int - fun mod(other : Byte) : Int - fun mod(other : Char) : Int - - fun rangeTo(other : Double) : DoubleRange - fun rangeTo(other : Float) : FloatRange - fun rangeTo(other : Long) : LongRange - fun rangeTo(other : Int) : IntRange - fun rangeTo(other : Short) : ShortRange - fun rangeTo(other : Byte) : ByteRange - fun rangeTo(other : Char) : CharRange - - fun upto(other : Double) : DoubleRange - fun upto(other : Float) : FloatRange - fun upto(other : Long) : LongRange - fun upto(other : Int) : IntRange - fun upto(other : Short) : ShortRange - fun upto(other : Byte) : ByteRange - fun upto(other : Char) : CharRange - - fun downto(other : Double) : DoubleRange - fun downto(other : Float) : FloatRange - fun downto(other : Long) : LongRange - fun downto(other : Int) : IntRange - fun downto(other : Short) : ShortRange - fun downto(other : Byte) : ByteRange - fun downto(other : Char) : CharRange - - fun inc() : Byte - fun dec() : Byte - fun plus() : Byte - fun minus() : Byte -} \ No newline at end of file diff --git a/k2js/out/production/frontend/jet/Ranges.jet b/k2js/out/production/frontend/jet/Ranges.jet deleted file mode 100644 index 2426900bf78..00000000000 --- a/k2js/out/production/frontend/jet/Ranges.jet +++ /dev/null @@ -1,109 +0,0 @@ -package jet - -trait Range> { - fun contains(item : T) : Boolean -} - -class IntRange(val start : Int, val size : Int) : Range, IntIterable { - fun iterator () : IntIterator - - fun contains (elem: Int) : Boolean - - val end : Int - - val iteratorStart : Int - - fun minus() : IntRange - - fun step(step: Int) : IntIterator - - val isReversed : Boolean -} - -class LongRange(val start : Long, val size : Long) : Range, LongIterable { - fun iterator () : LongIterator - - fun contains (elem: Long) : Boolean - - val iteratorStart : Long - - val end : Long - - fun minus() : LongRange - - fun step(step: Long) : LongIterator - - val isReversed : Boolean -} - -class ByteRange(val start : Byte, val size : Int) : Range, ByteIterable { - fun iterator () : ByteIterator - - fun contains (elem: Byte) : Boolean - - val end : Byte - - val iteratorStart : Byte - - fun minus() : ByteRange - - fun step(step: Int) : ByteIterator - - val isReversed : Boolean -} - -class ShortRange(val start : Short, val size : Int) : Range, ShortIterable { - fun iterator () : ShortIterator - - fun contains (elem: Byte) : Boolean - - val iteratorStart : Short - - val end : Short - - fun minus() : ShortRange - - fun step(step: Int) : ShortIterator - - val isReversed : Boolean -} - -class CharRange(val start : Char, val size : Int) : Range, CharIterable { - fun iterator () : CharIterator - - fun contains (elem: Char) : Boolean - - val iteratorStart : Char - - val end : Char - - fun minus() : CharRange - - fun step(step: Int) : CharIterator - - val isReversed : Boolean -} - -class FloatRange(val start : Float, val size : Float) : Range { - fun contains (elem: Float) : Boolean - - val end : Float - - fun minus() : FloatRange - - fun step(step: Float) : FloatIterator - - val isReversed : Boolean -} - -class DoubleRange(val start : Double, val size : Double) : Range { - fun contains (elem: Double) : Boolean - - val end : Double - - fun minus() : DoubleRange - - fun step(step: Double) : DoubleIterator - - val isReversed : Boolean -} diff --git a/k2js/out/production/frontend/org/jetbrains/jet/JetNodeType.class b/k2js/out/production/frontend/org/jetbrains/jet/JetNodeType.class deleted file mode 100644 index 441961cbe76..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/JetNodeType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/JetNodeTypes.class b/k2js/out/production/frontend/org/jetbrains/jet/JetNodeTypes.class deleted file mode 100644 index 47ea6ccb58f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/JetNodeTypes.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$1.class b/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$1.class deleted file mode 100644 index a50f8459484..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$2.class b/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$2.class deleted file mode 100644 index 79356c8d5ac..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosedRange.class b/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosedRange.class deleted file mode 100644 index c275931edbb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosedRange.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDescriptor.class deleted file mode 100644 index 1b2273e634b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDiffCallbacks.class b/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDiffCallbacks.class deleted file mode 100644 index 9eedf7f4631..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$DiagnosticDiffCallbacks.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$SyntaxErrorDiagnostic.class b/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$SyntaxErrorDiagnostic.class deleted file mode 100644 index 6985743bc1b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$SyntaxErrorDiagnostic.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$SyntaxErrorDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$SyntaxErrorDiagnosticFactory.class deleted file mode 100644 index d12b7e57a04..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil$SyntaxErrorDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil.class b/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil.class deleted file mode 100644 index ca05ae6ce62..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/checkers/CheckerTestUtil.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/Configuration$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/Configuration$1.class deleted file mode 100644 index fb5ba788b34..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/Configuration$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/Configuration.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/Configuration.class deleted file mode 100644 index b54d750a6f1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/Configuration.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/JetSemanticServices.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/JetSemanticServices.class deleted file mode 100644 index 1e6ccc540fc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/JetSemanticServices.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/StandardConfiguration.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/StandardConfiguration.class deleted file mode 100644 index 2bea3366203..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/StandardConfiguration.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/BlockInfo.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/BlockInfo.class deleted file mode 100644 index 8adca3ba009..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/BlockInfo.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/BreakableBlockInfo.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/BreakableBlockInfo.class deleted file mode 100644 index d0805e6d9bf..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/BreakableBlockInfo.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/GenerationTrigger.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/GenerationTrigger.class deleted file mode 100644 index de475f9bb0e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/GenerationTrigger.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilder.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilder.class deleted file mode 100644 index 6790cba4ed8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilder.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilderAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilderAdapter.class deleted file mode 100644 index 712dab40ee2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowBuilderAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataAnalyzeStrategy.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataAnalyzeStrategy.class deleted file mode 100644 index af3d25b7f87..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataAnalyzeStrategy.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataMergeStrategy.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataMergeStrategy.class deleted file mode 100644 index 0651c0732af..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser$InstructionDataMergeStrategy.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser.class deleted file mode 100644 index a87f4230f19..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowGraphTraverser.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$1.class deleted file mode 100644 index 90be101e433..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$1.class deleted file mode 100644 index f6927bd8aea..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$2.class deleted file mode 100644 index 7c399f9ba8c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$3.class deleted file mode 100644 index c762df3436d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor.class deleted file mode 100644 index aae041ba08f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor$CFPVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.class deleted file mode 100644 index e498a964bf7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$1.class deleted file mode 100644 index 87eeccbf604..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$10.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$10.class deleted file mode 100644 index ba856584de3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$10.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$11.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$11.class deleted file mode 100644 index bbccb0d42ac..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$11.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$12.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$12.class deleted file mode 100644 index ca4275fd8c7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$12.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$2.class deleted file mode 100644 index e12b4f2e3ac..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$3.class deleted file mode 100644 index b84a3fe2cce..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$4.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$4.class deleted file mode 100644 index 89940ab6001..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$4.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$5.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$5.class deleted file mode 100644 index 3600462081a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$5.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$6.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$6.class deleted file mode 100644 index af783720dcd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$6.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$7.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$7.class deleted file mode 100644 index 398902a282b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$7.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$8.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$8.class deleted file mode 100644 index ab17225e2ca..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$8.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$9.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$9.class deleted file mode 100644 index b479b5c3ae7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$9.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$VariableInitializers.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$VariableInitializers.class deleted file mode 100644 index dce1b31d67e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$VariableInitializers.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$VariableStatus.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$VariableStatus.class deleted file mode 100644 index cb36600c529..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider$VariableStatus.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.class deleted file mode 100644 index 62df65d8225..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/Label.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/Label.class deleted file mode 100644 index a20ab42e4b5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/Label.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/LoopInfo.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/LoopInfo.class deleted file mode 100644 index 8b1529d76cc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/LoopInfo.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/WhenChecker.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/WhenChecker.class deleted file mode 100644 index b48b5e9a03a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/WhenChecker.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/AbstractJumpInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/AbstractJumpInstruction.class deleted file mode 100644 index 054916098e0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/AbstractJumpInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ConditionalJumpInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ConditionalJumpInstruction.class deleted file mode 100644 index a87949fa968..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ConditionalJumpInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Instruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Instruction.class deleted file mode 100644 index 6a14eb49ee2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Instruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionImpl.class deleted file mode 100644 index f1978d1cafc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionVisitor.class deleted file mode 100644 index 68f2bf3bfda..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionWithNext.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionWithNext.class deleted file mode 100644 index bf58be40cf2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/InstructionWithNext.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory$1.class deleted file mode 100644 index 56ece0c3fd1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory.class deleted file mode 100644 index 4f8ad115efb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowDataTraceFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$1.class deleted file mode 100644 index 6de521549ac..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$JetControlFlowInstructionsGeneratorWorker.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$JetControlFlowInstructionsGeneratorWorker.class deleted file mode 100644 index 3887707eae6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$JetControlFlowInstructionsGeneratorWorker.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$TryFinallyBlockInfo.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$TryFinallyBlockInfo.class deleted file mode 100644 index 2e9a8e64cc2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator$TryFinallyBlockInfo.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator.class deleted file mode 100644 index 7ff0d2dd269..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetControlFlowInstructionsGenerator.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstruction.class deleted file mode 100644 index 322e1656c02..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstructionImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstructionImpl.class deleted file mode 100644 index 14edffaa28b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetElementInstructionImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace$1.class deleted file mode 100644 index 60f1da6b34b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace.class deleted file mode 100644 index 211a73e7126..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/JetPseudocodeTrace.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/LocalDeclarationInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/LocalDeclarationInstruction.class deleted file mode 100644 index 201bc7e9628..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/LocalDeclarationInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/NondeterministicJumpInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/NondeterministicJumpInstruction.class deleted file mode 100644 index 4fd78533bec..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/NondeterministicJumpInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$1.class deleted file mode 100644 index c0f9c6d3815..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$PseudocodeLabel.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$PseudocodeLabel.class deleted file mode 100644 index fcab94a3fa5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode$PseudocodeLabel.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode.class deleted file mode 100644 index 27be70a75af..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/Pseudocode.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadUnitValueInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadUnitValueInstruction.class deleted file mode 100644 index 32360706ae9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadUnitValueInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadValueInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadValueInstruction.class deleted file mode 100644 index 3d8452fe879..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReadValueInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnNoValueInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnNoValueInstruction.class deleted file mode 100644 index 2b08b05b4a2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnNoValueInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnValueInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnValueInstruction.class deleted file mode 100644 index 364ced86fad..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/ReturnValueInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineEnterInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineEnterInstruction.class deleted file mode 100644 index 124b7967eaf..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineEnterInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineExitInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineExitInstruction.class deleted file mode 100644 index 6a660b05323..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineExitInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineSinkInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineSinkInstruction.class deleted file mode 100644 index 8c93d7f716f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/SubroutineSinkInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnconditionalJumpInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnconditionalJumpInstruction.class deleted file mode 100644 index 4c1aa8ba49d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnconditionalJumpInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnsupportedElementInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnsupportedElementInstruction.class deleted file mode 100644 index 3b33ed4d238..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/UnsupportedElementInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/VariableDeclarationInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/VariableDeclarationInstruction.class deleted file mode 100644 index 75262ef842f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/VariableDeclarationInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/WriteValueInstruction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/WriteValueInstruction.class deleted file mode 100644 index 59c47f66b94..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/cfg/pseudocode/WriteValueInstruction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/AbstractNamespaceDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/AbstractNamespaceDescriptorImpl.class deleted file mode 100644 index a98b526c103..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/AbstractNamespaceDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Annotation.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Annotation.class deleted file mode 100644 index 8acd377f3d9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Annotation.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableDescriptor.class deleted file mode 100644 index bc6332ab191..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor$Kind.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor$Kind.class deleted file mode 100644 index f52dadbd1c4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor$Kind.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor.class deleted file mode 100644 index d671ce470b4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/CallableMemberDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptor.class deleted file mode 100644 index 22c2260e213..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptorImpl.class deleted file mode 100644 index dd60027ebbc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassKind.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassKind.class deleted file mode 100644 index 58f74f3d395..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassKind.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassOrNamespaceDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassOrNamespaceDescriptor.class deleted file mode 100644 index 38e843e919c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassOrNamespaceDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassifierDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassifierDescriptor.class deleted file mode 100644 index 673cd0ceaa0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ClassifierDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptor.class deleted file mode 100644 index 1f8088c49ca..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptorImpl.class deleted file mode 100644 index 0142dde888d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ConstructorDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.class deleted file mode 100644 index 33e9461456e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.class deleted file mode 100644 index ba631eae149..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorVisitor.class deleted file mode 100644 index 880cf3c942d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorWithVisibility.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorWithVisibility.class deleted file mode 100644 index b69108560da..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/DeclarationDescriptorWithVisibility.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ExtensionDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ExtensionDescriptor.class deleted file mode 100644 index d76e85766b3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ExtensionDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptor.class deleted file mode 100644 index f5f6bd32932..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorImpl.class deleted file mode 100644 index 262c8a74158..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil$1.class deleted file mode 100644 index 530f89d9348..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil.class deleted file mode 100644 index e3c89441bed..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/FunctionDescriptorUtil.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/LazySubstitutingClassDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/LazySubstitutingClassDescriptor.class deleted file mode 100644 index 6d27eafca74..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/LazySubstitutingClassDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/LocalVariableDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/LocalVariableDescriptor.class deleted file mode 100644 index 02d9cc076e7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/LocalVariableDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MemberDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MemberDescriptor.class deleted file mode 100644 index 55980253950..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MemberDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Modality.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Modality.class deleted file mode 100644 index d6cca985d91..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Modality.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ModuleDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ModuleDescriptor.class deleted file mode 100644 index 4a09a36b4c2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ModuleDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor$1.class deleted file mode 100644 index 518e67a4720..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor.class deleted file mode 100644 index 45075d49e9e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptorLite.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptorLite.class deleted file mode 100644 index 539397f5ec6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableClassDescriptorLite.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableDeclarationDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableDeclarationDescriptor.class deleted file mode 100644 index 2bd2be7ba3a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableDeclarationDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableValueParameterDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableValueParameterDescriptor.class deleted file mode 100644 index 341f4edeb92..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/MutableValueParameterDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Named.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Named.class deleted file mode 100644 index f6c4ff15010..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Named.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamedFunctionDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamedFunctionDescriptor.class deleted file mode 100644 index b12d6d5c109..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamedFunctionDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamedFunctionDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamedFunctionDescriptorImpl.class deleted file mode 100644 index f76ace63206..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamedFunctionDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.class deleted file mode 100644 index 2059ed094a5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptorImpl.class deleted file mode 100644 index a1e9c5ec121..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$Adapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$Adapter.class deleted file mode 100644 index 17831853f6c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$Adapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$ClassObjectStatus.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$ClassObjectStatus.class deleted file mode 100644 index a6bc4629de8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike$ClassObjectStatus.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike.class deleted file mode 100644 index 0eb08bbdc2e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/NamespaceLike.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyAccessorDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyAccessorDescriptor.class deleted file mode 100644 index 1eb00ee9267..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyAccessorDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.class deleted file mode 100644 index a4b83f4915b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyGetterDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyGetterDescriptor.class deleted file mode 100644 index 5c39212e234..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertyGetterDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertySetterDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertySetterDescriptor.class deleted file mode 100644 index e75d96ba5e1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/PropertySetterDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor$1.class deleted file mode 100644 index a9baed1a21e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.class deleted file mode 100644 index 36d1714ea64..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/TypeParameterDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptor.class deleted file mode 100644 index a424f94e510..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptorImpl.class deleted file mode 100644 index 118c2ed2735..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/ValueParameterDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableAsFunctionDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableAsFunctionDescriptor.class deleted file mode 100644 index 1d1c72eec32..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableAsFunctionDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptor.class deleted file mode 100644 index bda2f38b816..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptorImpl.class deleted file mode 100644 index 48d742e2acc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/VariableDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Visibility.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Visibility.class deleted file mode 100644 index 45bd92f3dcb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/Visibility.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/Annotated.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/Annotated.class deleted file mode 100644 index 93aed1ba923..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/Annotated.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotatedImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotatedImpl.class deleted file mode 100644 index 5b422d22db5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotatedImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationArgumentVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationArgumentVisitor.class deleted file mode 100644 index 8c09876a8b6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationArgumentVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptor.class deleted file mode 100644 index 1062df6f9a4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/descriptors/annotations/AnnotationDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AbstractDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AbstractDiagnosticFactory.class deleted file mode 100644 index 9101bbc29c3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AbstractDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.class deleted file mode 100644 index f377a609e8a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/AmbiguousDescriptorDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Diagnostic.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Diagnostic.class deleted file mode 100644 index a87a3c4f2d2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Diagnostic.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory.class deleted file mode 100644 index a2143811227..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.class deleted file mode 100644 index 12fdcba54b0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithMessageFormat.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement1.class deleted file mode 100644 index ca7e9c4d751..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement2.class deleted file mode 100644 index f140d8c3c89..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement3.class deleted file mode 100644 index 0d0029ade2f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithPsiElement3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithSeverity.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithSeverity.class deleted file mode 100644 index c9b580ab7ff..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticFactoryWithSeverity.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$1.class deleted file mode 100644 index 4682da2eeb7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$2.class deleted file mode 100644 index 753c31e7a4f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.class deleted file mode 100644 index 8580c99e0c7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticHolder.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameter.class deleted file mode 100644 index 6463d345593..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameterImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameterImpl.class deleted file mode 100644 index 025a3ab99a7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameterImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameters.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameters.class deleted file mode 100644 index dba843045bd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticParameters.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.class deleted file mode 100644 index 5d8909193b8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameterFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameterFactory.class deleted file mode 100644 index 481fd8e7fc7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameterFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameters.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameters.class deleted file mode 100644 index 98c8d75c2bd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithParameters.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElement.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElement.class deleted file mode 100644 index 0163a2ef918..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElement.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElementImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElementImpl.class deleted file mode 100644 index c8da99fe0c7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithPsiElementImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithTextRange.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithTextRange.class deleted file mode 100644 index f6bbf9d31d2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/DiagnosticWithTextRange.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$1.class deleted file mode 100644 index 194b1200421..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$10.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$10.class deleted file mode 100644 index 4ea29d34e24..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$10.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$11.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$11.class deleted file mode 100644 index 6383619fc84..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$11.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$12.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$12.class deleted file mode 100644 index eac7063b351..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$12.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$13.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$13.class deleted file mode 100644 index 1361e20ec8a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$13.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$14.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$14.class deleted file mode 100644 index e4880ff6397..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$14.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$15.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$15.class deleted file mode 100644 index e937d9ffa7a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$15.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$16.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$16.class deleted file mode 100644 index bed389f38b0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$16.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$17.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$17.class deleted file mode 100644 index aecc53e05db..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$17.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$18.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$18.class deleted file mode 100644 index 04050415760..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$18.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$19.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$19.class deleted file mode 100644 index 861493ebab9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$19.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$2.class deleted file mode 100644 index 03d6e5eb8c2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$20.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$20.class deleted file mode 100644 index 6be9d7699b9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$20.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$21.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$21.class deleted file mode 100644 index 27c9c274592..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$21.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$3.class deleted file mode 100644 index 78554c8b93a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$4.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$4.class deleted file mode 100644 index 0a592dabff9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$4.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$5.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$5.class deleted file mode 100644 index d0eed611738..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$5.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$6.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$6.class deleted file mode 100644 index ae270320b45..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$6.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$7.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$7.class deleted file mode 100644 index c9b0cec891b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$7.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$8.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$8.class deleted file mode 100644 index 8d43ef08f26..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$8.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$9.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$9.class deleted file mode 100644 index 3273b6f799e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$9.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$Initializer.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$Initializer.class deleted file mode 100644 index d5d5e2b675b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors$Initializer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors.class deleted file mode 100644 index 3a42f40a2a9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Errors.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/FunctionSignatureDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/FunctionSignatureDiagnosticFactory.class deleted file mode 100644 index 940389e579d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/FunctionSignatureDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/GenericDiagnostic.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/GenericDiagnostic.class deleted file mode 100644 index 398742220ee..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/GenericDiagnostic.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory1.class deleted file mode 100644 index f03f9beadaa..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory2.class deleted file mode 100644 index 0ca320b4962..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory3.class deleted file mode 100644 index 67dfece8dab..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/ParameterizedDiagnosticFactory3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory.class deleted file mode 100644 index 974f3a4cef5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory1.class deleted file mode 100644 index 8fb1e780e83..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory2.class deleted file mode 100644 index 3606977743f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory3.class deleted file mode 100644 index bd69e29a91e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/PsiElementOnlyDiagnosticFactory3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$RedeclarationDiagnosticWithDeferredResolution.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$RedeclarationDiagnosticWithDeferredResolution.class deleted file mode 100644 index 0bd14b4255d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$RedeclarationDiagnosticWithDeferredResolution.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$SimpleRedeclarationDiagnostic.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$SimpleRedeclarationDiagnostic.class deleted file mode 100644 index 46b2f46422b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic$SimpleRedeclarationDiagnostic.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.class deleted file mode 100644 index 543d2aa1492..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnostic.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnosticFactory.class deleted file mode 100644 index 9316171544a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/RedeclarationDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer$1.class deleted file mode 100644 index fd741f270be..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer.class deleted file mode 100644 index 4bfcbae11bf..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Renderer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Severity.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Severity.class deleted file mode 100644 index 5714d8c3a44..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/Severity.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactory.class deleted file mode 100644 index f0ba7e8f798..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactoryWithPsiElement.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactoryWithPsiElement.class deleted file mode 100644 index 952e37fbb83..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimpleDiagnosticFactoryWithPsiElement.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimplePsiElementOnlyDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimplePsiElementOnlyDiagnosticFactory.class deleted file mode 100644 index cf989fb1a89..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/SimplePsiElementOnlyDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnostic.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnostic.class deleted file mode 100644 index f6d09387318..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnostic.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnosticFactory.class deleted file mode 100644 index 60d93722d82..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnresolvedReferenceDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnusedElementDiagnosticFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnusedElementDiagnosticFactory.class deleted file mode 100644 index 288aa19c25f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/diagnostics/UnusedElementDiagnosticFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$At.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$At.class deleted file mode 100644 index 5d3bba872bb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$At.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtFirstTokenOfTokens.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtFirstTokenOfTokens.class deleted file mode 100644 index ebc33ce1be8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtFirstTokenOfTokens.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtOffset.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtOffset.class deleted file mode 100644 index 1b3f397ec1d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtOffset.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtSet.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtSet.class deleted file mode 100644 index 0e26ef16bcd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing$AtSet.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing.class deleted file mode 100644 index 6365cba4d2d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractJetParsing.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPattern.class deleted file mode 100644 index 285445d047f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate$1.class deleted file mode 100644 index 59ce724c183..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate.class deleted file mode 100644 index 9110aa4afb9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/AbstractTokenStreamPredicate.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/Consumer.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/Consumer.class deleted file mode 100644 index 8b545ee979e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/Consumer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/FirstBefore.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/FirstBefore.class deleted file mode 100644 index 809cc6ddfa0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/FirstBefore.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$1.class deleted file mode 100644 index 36637c403c0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$1.class deleted file mode 100644 index aa3fd345d5f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$2.class deleted file mode 100644 index 73f681631a7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$3.class deleted file mode 100644 index 59fbbd66dc1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence.class deleted file mode 100644 index 61627b2a9f0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing$Precedence.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing.class deleted file mode 100644 index bafbbd1da09..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetExpressionParsing.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParser.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParser.class deleted file mode 100644 index bb4425f0c0b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParser.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParserDefinition.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParserDefinition.class deleted file mode 100644 index 8f32e0babd5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParserDefinition.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$1.class deleted file mode 100644 index 3829fd714df..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$2.class deleted file mode 100644 index f0f9994d0c0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$TokenDetector.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$TokenDetector.class deleted file mode 100644 index 3958059a680..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing$TokenDetector.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing.class deleted file mode 100644 index 07fbe5b54d7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/JetParsing.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/LastBefore.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/LastBefore.class deleted file mode 100644 index 95018ababec..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/LastBefore.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/MarkerAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/MarkerAdapter.class deleted file mode 100644 index 73fe4fa5fe2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/MarkerAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilder.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilder.class deleted file mode 100644 index 2cc223e7731..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilder.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderAdapter.class deleted file mode 100644 index adb2b23cdf4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderForByClause.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderForByClause.class deleted file mode 100644 index 9c3d75566c3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderForByClause.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderImpl.class deleted file mode 100644 index f7275192187..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/SemanticWhitespaceAwarePsiBuilderImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPattern.class deleted file mode 100644 index 16e0f1edd4b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPredicate.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPredicate.class deleted file mode 100644 index ce73a88834f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TokenStreamPredicate.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TruncatedSemanticWhitespaceAwarePsiBuilder.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TruncatedSemanticWhitespaceAwarePsiBuilder.class deleted file mode 100644 index 06aaaa8e69d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/parsing/TruncatedSemanticWhitespaceAwarePsiBuilder.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/Call.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/Call.class deleted file mode 100644 index c7ac0323b47..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/Call.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.class deleted file mode 100644 index dd1a9eae0b7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotatedExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotation.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotation.class deleted file mode 100644 index 901ab6c86e5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotation.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotationEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotationEntry.class deleted file mode 100644 index 6b17911cd90..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetAnnotationEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.class deleted file mode 100644 index e6912ac6f72..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetArrayAccessExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpression.class deleted file mode 100644 index 180736ef0f4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.class deleted file mode 100644 index c1f067c8ea5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBinaryExpressionWithTypeRHS.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBindingPattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBindingPattern.class deleted file mode 100644 index abdba24c021..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBindingPattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockExpression.class deleted file mode 100644 index 293d335d144..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockStringTemplateEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockStringTemplateEntry.class deleted file mode 100644 index 74236af1aa3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBlockStringTemplateEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBreakExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBreakExpression.class deleted file mode 100644 index 828e619fbd9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetBreakExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallElement.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallElement.class deleted file mode 100644 index bbd2a6db034..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallElement.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallExpression.class deleted file mode 100644 index f1861928211..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCallExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCatchClause.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCatchClause.class deleted file mode 100644 index 210ee9a4d0c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetCatchClause.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClass.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClass.class deleted file mode 100644 index b95572a1b0b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClass.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassBody.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassBody.class deleted file mode 100644 index 3f9338f0436..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassBody.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassInitializer.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassInitializer.class deleted file mode 100644 index 387fb341ce8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassInitializer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassObject.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassObject.class deleted file mode 100644 index 2c0ed64d89c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassObject.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassOrObject.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassOrObject.class deleted file mode 100644 index 623b4aad2a3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetClassOrObject.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstantExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstantExpression.class deleted file mode 100644 index 67ef9a99f84..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstantExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructorCalleeExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructorCalleeExpression.class deleted file mode 100644 index f73cd423ffe..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetConstructorCalleeExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetContainerNode.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetContainerNode.class deleted file mode 100644 index 75769b198f3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetContainerNode.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetContinueExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetContinueExpression.class deleted file mode 100644 index c5b6735a258..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetContinueExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclaration.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclaration.class deleted file mode 100644 index e41968e86cf..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclaration.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclarationWithBody.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclarationWithBody.class deleted file mode 100644 index d53a9d74082..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDeclarationWithBody.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDecomposerPattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDecomposerPattern.class deleted file mode 100644 index 5d2731b94e1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDecomposerPattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.class deleted file mode 100644 index 4d7da3e416a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifier.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.class deleted file mode 100644 index a68a4250c22..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegationSpecifierList.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.class deleted file mode 100644 index 8b88641d7b9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorByExpressionSpecifier.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperCall.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperCall.class deleted file mode 100644 index 863b95174e9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperCall.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperClass.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperClass.class deleted file mode 100644 index 37041b2e5f7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToSuperClass.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToThisCall.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToThisCall.class deleted file mode 100644 index d3842e854b5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDelegatorToThisCall.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDoWhileExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDoWhileExpression.class deleted file mode 100644 index 6131dffa9cd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDoWhileExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.class deleted file mode 100644 index 4fc13f479f3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetDotQualifiedExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement$IfNotParsed.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement$IfNotParsed.class deleted file mode 100644 index 4ca366696bc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement$IfNotParsed.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement.class deleted file mode 100644 index 6fc0cdef755..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetElement.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetEnumEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetEnumEntry.class deleted file mode 100644 index 656f65ab778..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetEnumEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetEscapeStringTemplateEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetEscapeStringTemplateEntry.class deleted file mode 100644 index 1404c219861..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetEscapeStringTemplateEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpression.class deleted file mode 100644 index b1749da1af1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpressionPattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpressionPattern.class deleted file mode 100644 index ee3a368b7f1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetExpressionPattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFile.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFile.class deleted file mode 100644 index 2ac0739afb5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFile.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFinallySection.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFinallySection.class deleted file mode 100644 index a129576ca75..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFinallySection.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetForExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetForExpression.class deleted file mode 100644 index 940f68bc316..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetForExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunction.class deleted file mode 100644 index 866ae120300..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteral.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteral.class deleted file mode 100644 index 2e3635fb987..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteral.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteralExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteralExpression.class deleted file mode 100644 index a95fb61defa..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionLiteralExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionType.class deleted file mode 100644 index 1f8fa6e179a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetFunctionType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetHashQualifiedExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetHashQualifiedExpression.class deleted file mode 100644 index 1caabc9cf31..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetHashQualifiedExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIdeTemplateExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIdeTemplateExpression.class deleted file mode 100644 index fd5536453fe..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIdeTemplateExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIfExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIfExpression.class deleted file mode 100644 index dc642d20c0c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIfExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetImportDirective.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetImportDirective.class deleted file mode 100644 index fb803bf3d14..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetImportDirective.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetInitializerList.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetInitializerList.class deleted file mode 100644 index fe984a34bf8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetInitializerList.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIsExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIsExpression.class deleted file mode 100644 index abb91eebbcd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetIsExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.class deleted file mode 100644 index fd6249dc3c1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedInstanceExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedInstanceExpression.class deleted file mode 100644 index 469254e7f2e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLabelQualifiedInstanceExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLiteralStringTemplateEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLiteralStringTemplateEntry.class deleted file mode 100644 index af796350a2d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLiteralStringTemplateEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLoopExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLoopExpression.class deleted file mode 100644 index be2b69f290a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetLoopExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierList.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierList.class deleted file mode 100644 index 68358338524..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierList.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierListOwner.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierListOwner.class deleted file mode 100644 index dcaf91100c9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetModifierListOwner.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedArgumentImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedArgumentImpl.class deleted file mode 100644 index 18f06d70fc8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedArgumentImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedDeclaration.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedDeclaration.class deleted file mode 100644 index fd49be525e4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedDeclaration.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedFunction.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedFunction.class deleted file mode 100644 index 0077bb0a066..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamedFunction.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceBody.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceBody.class deleted file mode 100644 index d3103115372..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceBody.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceHeader.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceHeader.class deleted file mode 100644 index 0b78e9381ad..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNamespaceHeader.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNullableType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNullableType.class deleted file mode 100644 index bdb1d073a87..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetNullableType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclaration.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclaration.class deleted file mode 100644 index ef581b089f1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclaration.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclarationName.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclarationName.class deleted file mode 100644 index b5cfefc48b9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectDeclarationName.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectLiteralExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectLiteralExpression.class deleted file mode 100644 index c5c1fb5e53d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetObjectLiteralExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetOperationExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetOperationExpression.class deleted file mode 100644 index 38eb5df8a0c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetOperationExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameter.class deleted file mode 100644 index b0cc607208a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameterList.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameterList.class deleted file mode 100644 index 1b0214ad3ac..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParameterList.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.class deleted file mode 100644 index 53f42ab0d0b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetParenthesizedExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPattern.class deleted file mode 100644 index ff64fac5c82..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPostfixExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPostfixExpression.class deleted file mode 100644 index be9fbe7e7a0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPostfixExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPredicateExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPredicateExpression.class deleted file mode 100644 index d888c17f348..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPredicateExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPrefixExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPrefixExpression.class deleted file mode 100644 index 8257aae7cc2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPrefixExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetProjectionKind.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetProjectionKind.class deleted file mode 100644 index 1e2a9b8e289..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetProjectionKind.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetProperty.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetProperty.class deleted file mode 100644 index 8f0de269a32..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetProperty.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPropertyAccessor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPropertyAccessor.class deleted file mode 100644 index 56f41172362..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPropertyAccessor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiFactory.class deleted file mode 100644 index 3d9c1aae2ed..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil$1.class deleted file mode 100644 index cf16bcf8521..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil.class deleted file mode 100644 index bd5dc5ad145..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetPsiUtil.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetQualifiedExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetQualifiedExpression.class deleted file mode 100644 index 8fa28c3a48b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetQualifiedExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetReferenceExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetReferenceExpression.class deleted file mode 100644 index b138ee56931..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetReferenceExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetReturnExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetReturnExpression.class deleted file mode 100644 index e297c34fbf5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetReturnExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetRootNamespaceExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetRootNamespaceExpression.class deleted file mode 100644 index 56740c4613c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetRootNamespaceExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSafeQualifiedExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSafeQualifiedExpression.class deleted file mode 100644 index 176ff3e99e0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSafeQualifiedExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSecondaryConstructor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSecondaryConstructor.class deleted file mode 100644 index 96143b46d6d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSecondaryConstructor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSelfType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSelfType.class deleted file mode 100644 index 61c41d0cf01..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSelfType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.class deleted file mode 100644 index ac9c289165e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameStringTemplateEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameStringTemplateEntry.class deleted file mode 100644 index d97022c59f7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSimpleNameStringTemplateEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStatementExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStatementExpression.class deleted file mode 100644 index 089f3fa8cad..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStatementExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.class deleted file mode 100644 index 303dc8bac01..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntryWithExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntryWithExpression.class deleted file mode 100644 index 6e7d48e71aa..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateEntryWithExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateExpression.class deleted file mode 100644 index b5fa824b051..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetStringTemplateExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSuperExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSuperExpression.class deleted file mode 100644 index 996ab22e63d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetSuperExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisExpression.class deleted file mode 100644 index 6050c837760..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisReferenceExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisReferenceExpression.class deleted file mode 100644 index 92d4bb771b7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThisReferenceExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThrowExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThrowExpression.class deleted file mode 100644 index 3086e82bfc5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetThrowExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTreeVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTreeVisitor.class deleted file mode 100644 index a11ddde2581..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTreeVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTryExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTryExpression.class deleted file mode 100644 index d644cdfcd95..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTryExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleExpression.class deleted file mode 100644 index 00fcebbb194..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePattern.class deleted file mode 100644 index b2da11e351d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePatternEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePatternEntry.class deleted file mode 100644 index b20dffd0749..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTuplePatternEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleType.class deleted file mode 100644 index 7c687d1a34a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTupleType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeArgumentList.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeArgumentList.class deleted file mode 100644 index ec272f2a750..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeArgumentList.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraint.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraint.class deleted file mode 100644 index 6b6233fd42c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraint.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraintList.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraintList.class deleted file mode 100644 index f4ee6a34a36..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeConstraintList.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeElement.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeElement.class deleted file mode 100644 index b452339ba6b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeElement.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameter.class deleted file mode 100644 index e1386853f0f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterList.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterList.class deleted file mode 100644 index 7f2c050a081..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterList.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.class deleted file mode 100644 index eb3cb4c63ab..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeParameterListOwner.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypePattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypePattern.class deleted file mode 100644 index 510ef717920..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypePattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeProjection.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeProjection.class deleted file mode 100644 index 2254a9d92aa..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeProjection.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeReference.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeReference.class deleted file mode 100644 index 71f63ad545f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypeReference.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypedef.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypedef.class deleted file mode 100644 index cb3adcbba2f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetTypedef.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetUnaryExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetUnaryExpression.class deleted file mode 100644 index a9f53dce1fe..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetUnaryExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetUserType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetUserType.class deleted file mode 100644 index f802ec788a4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetUserType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgument.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgument.class deleted file mode 100644 index d85e8c26680..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgument.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentList.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentList.class deleted file mode 100644 index 9cace34c7e2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentList.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentName.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentName.class deleted file mode 100644 index 8f09cde3432..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetValueArgumentName.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitor.class deleted file mode 100644 index 79abc416886..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitorVoid.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitorVoid.class deleted file mode 100644 index 38f7ace5401..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetVisitorVoid.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenCondition.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenCondition.class deleted file mode 100644 index 50c3cbc04be..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenCondition.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.class deleted file mode 100644 index bf2d0941806..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionInRange.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionIsPattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionIsPattern.class deleted file mode 100644 index 53bd23af924..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionIsPattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionWithExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionWithExpression.class deleted file mode 100644 index 9dd3620d485..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenConditionWithExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenEntry.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenEntry.class deleted file mode 100644 index 3e7a8556c9f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenEntry.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenExpression.class deleted file mode 100644 index 459774194f4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhenExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhileExpression.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhileExpression.class deleted file mode 100644 index c5753302f27..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWhileExpression.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWildcardPattern.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWildcardPattern.class deleted file mode 100644 index ce5618cb149..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/JetWildcardPattern.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/ValueArgument.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/ValueArgument.class deleted file mode 100644 index f47c2dc2622..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/ValueArgument.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetClassStub.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetClassStub.class deleted file mode 100644 index 99ca48f179c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetClassStub.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetFileStub.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetFileStub.class deleted file mode 100644 index a325f811f41..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetFileStub.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetFunctionStub.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetFunctionStub.class deleted file mode 100644 index d74f3944ca8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/PsiJetFunctionStub.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetClassElementType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetClassElementType.class deleted file mode 100644 index 99ebc96bd33..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetClassElementType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFileElementType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFileElementType.class deleted file mode 100644 index e988141e429..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFileElementType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFileStubBuilder.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFileStubBuilder.class deleted file mode 100644 index de771321708..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFileStubBuilder.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFunctionElementType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFunctionElementType.class deleted file mode 100644 index 9eba021fa1f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetFunctionElementType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementType.class deleted file mode 100644 index 711b1a14021..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.class deleted file mode 100644 index 5b41a785823..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/JetStubElementTypes.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexService$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexService$1.class deleted file mode 100644 index f2e6f03569a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexService$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexService.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexService.class deleted file mode 100644 index 56c5f1e0e17..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexService.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexServiceFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexServiceFactory.class deleted file mode 100644 index 9adc74ca5cf..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/elements/StubIndexServiceFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetClassStubImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetClassStubImpl.class deleted file mode 100644 index 0f6f14ae38b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetClassStubImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFileStubImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFileStubImpl.class deleted file mode 100644 index b0d8b8b57c0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFileStubImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFunctionStubImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFunctionStubImpl.class deleted file mode 100644 index fc588a62dde..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/psi/stubs/impl/PsiJetFunctionStubImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AbstractScopeAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AbstractScopeAdapter.class deleted file mode 100644 index af970c9624b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AbstractScopeAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$1.class deleted file mode 100644 index 7e69bd109e4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$2.class deleted file mode 100644 index 41042a2fb06..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$3.class deleted file mode 100644 index 5e4a6c5e936..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils.class deleted file mode 100644 index e223f04a20c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnalyzingUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver$1.class deleted file mode 100644 index 030b457aba2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver.class deleted file mode 100644 index fcb386be8eb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/AnnotationResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$1.class deleted file mode 100644 index ac7104871a9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$2.class deleted file mode 100644 index 39987628f98..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$3.class deleted file mode 100644 index 37f019f17dc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext.class deleted file mode 100644 index 360ea6535e2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContext.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContextUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContextUtils.class deleted file mode 100644 index 277085c22e6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingContextUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTrace.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTrace.class deleted file mode 100644 index 2a07b082889..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTrace.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext$1.class deleted file mode 100644 index 2e5082d5028..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext.class deleted file mode 100644 index 2d77a9a3c19..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BindingTraceContext.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$1.class deleted file mode 100644 index 0086a259692..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$2.class deleted file mode 100644 index 436dfc9325f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$3.class deleted file mode 100644 index 3d0cd23087e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$4.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$4.class deleted file mode 100644 index 66a19e596ae..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver$4.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver.class deleted file mode 100644 index a829b0c03cc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/BodyResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer.class deleted file mode 100644 index 440fd687e89..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ControlFlowAnalyzer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver$1.class deleted file mode 100644 index fd38a314219..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver.class deleted file mode 100644 index 603911c6e8a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationsChecker.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationsChecker.class deleted file mode 100644 index 636258db55e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DeclarationsChecker.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace$1.class deleted file mode 100644 index ed371116764..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace.class deleted file mode 100644 index 54519b23dbe..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegatingBindingTrace.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegationResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegationResolver.class deleted file mode 100644 index a68d782dec0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DelegationResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver$1.class deleted file mode 100644 index e0c8bc1a7ae..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver$2.class deleted file mode 100644 index 278454aef4a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver.class deleted file mode 100644 index e67dd7e18cd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$1.class deleted file mode 100644 index 17767f69efd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$2.class deleted file mode 100644 index 42647f7ff8f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$3.class deleted file mode 100644 index 27fae4f56ac..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils.class deleted file mode 100644 index 5778d233a92..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/DescriptorUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer$DelayedImporter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer$DelayedImporter.class deleted file mode 100644 index 7e24e879eef..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer$DelayedImporter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer$StandardImporter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer$StandardImporter.class deleted file mode 100644 index 7910ec8931c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer$StandardImporter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer.class deleted file mode 100644 index 5bbcc907d43..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/Importer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver$1.class deleted file mode 100644 index 7cc70bf0dcb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver$2.class deleted file mode 100644 index e951a1408de..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver.class deleted file mode 100644 index 9b8ace2f65c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver$ImportResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver.class deleted file mode 100644 index 1012a9e8012..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ImportsResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/JetModuleUtil.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/JetModuleUtil.class deleted file mode 100644 index 58b3276d1e9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/JetModuleUtil.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/JetVisibilityChecker.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/JetVisibilityChecker.class deleted file mode 100644 index 52d6c24c746..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/JetVisibilityChecker.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace$RecordHandler.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace$RecordHandler.class deleted file mode 100644 index 7989dfe7170..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace$RecordHandler.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace.class deleted file mode 100644 index 3a446bf475c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/ObservableBindingTrace.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadResolver$Key.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadResolver$Key.class deleted file mode 100644 index f2e90e4b6f9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadResolver$Key.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadResolver.class deleted file mode 100644 index d15dfd4bf53..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadUtil$OverloadCompatibilityInfo.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadUtil$OverloadCompatibilityInfo.class deleted file mode 100644 index df0541ef302..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadUtil$OverloadCompatibilityInfo.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadUtil.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadUtil.class deleted file mode 100644 index 2cf60b2c57f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverloadUtil.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$1.class deleted file mode 100644 index cbbd0a54aa5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$2.class deleted file mode 100644 index 5daf2017411..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$DescriptorSink.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$DescriptorSink.class deleted file mode 100644 index 3636b186c46..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver$DescriptorSink.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver.class deleted file mode 100644 index f5e22452815..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverrideResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil$OverrideCompatibilityInfo.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil$OverrideCompatibilityInfo.class deleted file mode 100644 index a2d9cad60e3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil$OverrideCompatibilityInfo.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil.class deleted file mode 100644 index d6198fc92bd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/OverridingUtil.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TemporaryBindingTrace.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TemporaryBindingTrace.class deleted file mode 100644 index ba174955bdd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TemporaryBindingTrace.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.class deleted file mode 100644 index cc567599dd1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalysisContext.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$1.class deleted file mode 100644 index cf1ace71b21..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.class deleted file mode 100644 index 2d1c21ce39f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TopDownAnalyzer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TraceBasedRedeclarationHandler.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TraceBasedRedeclarationHandler.class deleted file mode 100644 index 539a52fe770..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TraceBasedRedeclarationHandler.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1$1.class deleted file mode 100644 index 4fd8c885553..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1.class deleted file mode 100644 index 715d0e0d1b9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$2.class deleted file mode 100644 index dc8a647426d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$1.class deleted file mode 100644 index 93e0e9f9b73..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$2.class deleted file mode 100644 index bb19bb7d8ea..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter.class deleted file mode 100644 index fab3f508ff3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver$Filter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.class deleted file mode 100644 index 8b35edb62bc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeHierarchyResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$1.class deleted file mode 100644 index ce357ca378a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$2.class deleted file mode 100644 index 9317929118b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$3.class deleted file mode 100644 index ea56e6c90da..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver.class deleted file mode 100644 index 5c2c422abc8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/TypeResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/AutoCastReceiver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/AutoCastReceiver.class deleted file mode 100644 index 437031754cc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/AutoCastReceiver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$1.class deleted file mode 100644 index cd9368af037..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$CallImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$CallImpl.class deleted file mode 100644 index 7295a51b82a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$CallImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$ExpressionValueArgument.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$ExpressionValueArgument.class deleted file mode 100644 index 98f1d61965d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker$ExpressionValueArgument.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker.class deleted file mode 100644 index bb215ff2425..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallMaker.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$1.class deleted file mode 100644 index d5630105ff5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$2.class deleted file mode 100644 index bcb3b022589..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver.class deleted file mode 100644 index 9feafed1669..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/CallResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/DefaultValueArgument.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/DefaultValueArgument.class deleted file mode 100644 index a5ed66f6888..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/DefaultValueArgument.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionAsFunctionDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionAsFunctionDescriptor.class deleted file mode 100644 index 335325383a6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionAsFunctionDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionValueArgument.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionValueArgument.class deleted file mode 100644 index d8e4db7a259..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ExpressionValueArgument.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/JetFakeReference.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/JetFakeReference.class deleted file mode 100644 index 62aca8c3767..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/JetFakeReference.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults$Code.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults$Code.class deleted file mode 100644 index 299f1b30b28..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults$Code.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults.class deleted file mode 100644 index cb4fd48794e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResults.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResultsImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResultsImpl.class deleted file mode 100644 index f392a54482d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResultsImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResultsUtil.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResultsUtil.class deleted file mode 100644 index 447412deb5c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadResolutionResultsUtil.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver$1.class deleted file mode 100644 index af379ea2993..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.class deleted file mode 100644 index 0ad6f570be4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/OverloadingConflictResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$1.class deleted file mode 100644 index 39de974084e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$2.class deleted file mode 100644 index 384e8ce8834..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$AbstractData.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$AbstractData.class deleted file mode 100644 index b99d547a64d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$AbstractData.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$Data.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$Data.class deleted file mode 100644 index f5f638e4960..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$Data.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$DataImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$DataImpl.class deleted file mode 100644 index 26447d250cd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$DataImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$One.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$One.class deleted file mode 100644 index 45b9d282013..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo$One.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo.class deleted file mode 100644 index 2048c7a75f6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionDebugInfo.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.class deleted file mode 100644 index a49254c7a3c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionStatus.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask$DescriptorCheckStrategy.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask$DescriptorCheckStrategy.class deleted file mode 100644 index 9a9db3b0e53..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask$DescriptorCheckStrategy.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.class deleted file mode 100644 index 5f64556102d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolutionTask.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCall.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCall.class deleted file mode 100644 index c0979aeb1e8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCall.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$1.class deleted file mode 100644 index 1a3505f0226..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$2.class deleted file mode 100644 index f129760219a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.class deleted file mode 100644 index d12fa25d2a5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedCallImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedValueArgument.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedValueArgument.class deleted file mode 100644 index dcf48cbd6d8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ResolvedValueArgument.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.class deleted file mode 100644 index c356e2a3835..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$1.class deleted file mode 100644 index 056b8453286..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2$1.class deleted file mode 100644 index fd225deea5d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2.class deleted file mode 100644 index 7bca0cf32d5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$3.class deleted file mode 100644 index 2775de1db6b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.class deleted file mode 100644 index dd130c39858..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TaskPrioritizers.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy$1.class deleted file mode 100644 index c88e4126d0a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy.class deleted file mode 100644 index 9099fb5d836..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/TracingStrategy.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.class deleted file mode 100644 index 96030e5e9f2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/ValueArgumentsToParametersMapper.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/VarargValueArgument.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/VarargValueArgument.class deleted file mode 100644 index 46d8dd45c96..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/VarargValueArgument.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService$1.class deleted file mode 100644 index 044e99bffba..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService.class deleted file mode 100644 index 5d483323864..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastService.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastServiceImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastServiceImpl.class deleted file mode 100644 index ca0a9859a98..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastServiceImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils$1.class deleted file mode 100644 index 345775606fa..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils.class deleted file mode 100644 index 8f2e646a2b0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/AutoCastUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$1.class deleted file mode 100644 index b43fdf78510..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$2.class deleted file mode 100644 index 0c3cf0a02ea..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$CompositionOperator.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$CompositionOperator.class deleted file mode 100644 index 375b14fb948..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo$CompositionOperator.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo.class deleted file mode 100644 index 9a1b2c53c5d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowInfo.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValue.class deleted file mode 100644 index 578df72a7e6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.class deleted file mode 100644 index 0b5ae60941e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability$1.class deleted file mode 100644 index 07d04f6307d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability.class deleted file mode 100644 index cdc945b9f95..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/autocasts/Nullability.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/BoundsOwner.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/BoundsOwner.class deleted file mode 100644 index 94d707f6594..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/BoundsOwner.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintResolutionListener$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintResolutionListener$1.class deleted file mode 100644 index 97d382f22d9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintResolutionListener$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintResolutionListener.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintResolutionListener.class deleted file mode 100644 index ef6001026e1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintResolutionListener.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystem.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystem.class deleted file mode 100644 index ffc953c782c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystem.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$1.class deleted file mode 100644 index e1e35fa83b2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$2.class deleted file mode 100644 index 660d2f646a3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Error.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Error.class deleted file mode 100644 index c6385a84e7f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Error.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$KnownType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$KnownType.class deleted file mode 100644 index e1ed388ea4a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$KnownType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$LoopInTypeVariableConstraintsException.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$LoopInTypeVariableConstraintsException.class deleted file mode 100644 index a9ccf3016e9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$LoopInTypeVariableConstraintsException.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Solution$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Solution$1.class deleted file mode 100644 index 20187847e8e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Solution$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Solution.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Solution.class deleted file mode 100644 index e317b3bb72a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$Solution.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$TypeConstraintBuilderAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$TypeConstraintBuilderAdapter.class deleted file mode 100644 index d8872666d36..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$TypeConstraintBuilderAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$TypeValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$TypeValue.class deleted file mode 100644 index f03cdf76e71..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$TypeValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$UnknownType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$UnknownType.class deleted file mode 100644 index 1eef3e46ff4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl$UnknownType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl.class deleted file mode 100644 index f93dff55fa9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemSolution.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemSolution.class deleted file mode 100644 index 5962ff08fa4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemSolution.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$1.class deleted file mode 100644 index bb900749ef4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$2.class deleted file mode 100644 index d1fa5d7f6e5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Error.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Error.class deleted file mode 100644 index 092b0d622cc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Error.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$LoopInTypeVariableConstraintsException.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$LoopInTypeVariableConstraintsException.class deleted file mode 100644 index 3da73c0a39e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$LoopInTypeVariableConstraintsException.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Solution$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Solution$1.class deleted file mode 100644 index 597f862ee92..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Solution$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Solution.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Solution.class deleted file mode 100644 index 169636f63e6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$Solution.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$TypeConstraintBuilderAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$TypeConstraintBuilderAdapter.class deleted file mode 100644 index 87cd8bf6e30..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities$TypeConstraintBuilderAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities.class deleted file mode 100644 index ee958dc7ed0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintSystemWithPriorities.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintType.class deleted file mode 100644 index 8ac8a439418..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/ConstraintType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/DebugConstraintResolutionListener.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/DebugConstraintResolutionListener.class deleted file mode 100644 index 021559ecd8a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/DebugConstraintResolutionListener.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/PrintingConstraintResolutionListener.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/PrintingConstraintResolutionListener.class deleted file mode 100644 index ec2d53927e9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/PrintingConstraintResolutionListener.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SolutionStatus$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SolutionStatus$1.class deleted file mode 100644 index 2e499b3c7f2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SolutionStatus$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SolutionStatus.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SolutionStatus.class deleted file mode 100644 index 6b06fecf970..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SolutionStatus.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SubtypingConstraint.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SubtypingConstraint.class deleted file mode 100644 index e84e7a149e8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/SubtypingConstraint.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/TypeValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/TypeValue.class deleted file mode 100644 index fd679f83df3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/calls/inference/TypeValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/BooleanValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/BooleanValue.class deleted file mode 100644 index f4557c5a626..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/BooleanValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue$1.class deleted file mode 100644 index 14dec1a43cc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue.class deleted file mode 100644 index b0809cefe9d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ByteValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CharValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CharValue.class deleted file mode 100644 index c29adf23559..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CharValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstant.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstant.class deleted file mode 100644 index dc1f661ed63..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstant.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver$1.class deleted file mode 100644 index 1ffb79b8a6d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver.class deleted file mode 100644 index befe17ff1f3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/CompileTimeConstantResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/DoubleValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/DoubleValue.class deleted file mode 100644 index 5d698d22457..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/DoubleValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ErrorValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ErrorValue.class deleted file mode 100644 index 3829b1f14e9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ErrorValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/FloatValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/FloatValue.class deleted file mode 100644 index 647a757a213..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/FloatValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue$1.class deleted file mode 100644 index d2386bd082a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue.class deleted file mode 100644 index 5dfcea0bc3d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/IntValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue$1.class deleted file mode 100644 index 3b2ae1c6297..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue.class deleted file mode 100644 index 7530a14876c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/LongValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/NullValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/NullValue.class deleted file mode 100644 index ff6d9afb4f6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/NullValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue$1.class deleted file mode 100644 index f8e9bab8c5b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue.class deleted file mode 100644 index 6fb039880ab..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/ShortValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/StringValue.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/StringValue.class deleted file mode 100644 index 3bb73292a0e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/constants/StringValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/ChainedScope.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/ChainedScope.class deleted file mode 100644 index 772eb6c3df3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/ChainedScope.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope$1.class deleted file mode 100644 index 5a75eb03f82..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope.class deleted file mode 100644 index a8c11ff1ad2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScope.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeAdapter.class deleted file mode 100644 index 742f0748158..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeImpl.class deleted file mode 100644 index d94a55a2250..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeUtils.class deleted file mode 100644 index 66923d77173..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/JetScopeUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.class deleted file mode 100644 index 8e30dbee50d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/LazyScopeAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$1.class deleted file mode 100644 index 1df28725960..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$2.class deleted file mode 100644 index de64ca80373..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler.class deleted file mode 100644 index 153ea9d9440..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/RedeclarationHandler.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.class deleted file mode 100644 index af0f77faf4f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/SubstitutingScope.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope$LockLevel.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope$LockLevel.class deleted file mode 100644 index 62fd43d442d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope$LockLevel.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope.class deleted file mode 100644 index e0c1c8f07ab..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScope.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.class deleted file mode 100644 index 110b87e36be..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeWithImports.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeWithImports.class deleted file mode 100644 index 0f99c57bc20..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WritableScopeWithImports.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WriteThroughScope.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WriteThroughScope.class deleted file mode 100644 index 8b04947e527..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/WriteThroughScope.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/AbstractReceiverDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/AbstractReceiverDescriptor.class deleted file mode 100644 index 6e51d316c84..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/AbstractReceiverDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.class deleted file mode 100644 index 1697daf2555..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExpressionReceiver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExpressionReceiver.class deleted file mode 100644 index 6af7e42c24a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExpressionReceiver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExtensionReceiver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExtensionReceiver.class deleted file mode 100644 index ac3a2a8c555..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ExtensionReceiver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor$1.class deleted file mode 100644 index c087bbb1b86..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor.class deleted file mode 100644 index 465528bd6e8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptorVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptorVisitor.class deleted file mode 100644 index ff61115fdf0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ReceiverDescriptorVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ThisReceiverDescriptor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ThisReceiverDescriptor.class deleted file mode 100644 index c4cece0afe7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/ThisReceiverDescriptor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/TransientReceiver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/TransientReceiver.class deleted file mode 100644 index ed4741d4566..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/resolve/scopes/receivers/TransientReceiver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$1.class deleted file mode 100644 index 8fa770b5138..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$2.class deleted file mode 100644 index e1152f28511..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$DfsNodeHandler.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$DfsNodeHandler.class deleted file mode 100644 index 5eb5c165846..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes$DfsNodeHandler.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes.class deleted file mode 100644 index 9d4addcd252..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CommonSupertypes.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CompositeTypeSubstitution.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CompositeTypeSubstitution.class deleted file mode 100644 index 1d22d5c9d68..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/CompositeTypeSubstitution.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DeferredType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DeferredType.class deleted file mode 100644 index dd3ea5874e7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DeferredType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor$1.class deleted file mode 100644 index 9992fd69e25..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor.class deleted file mode 100644 index cdbfb1eb209..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/DescriptorSubstitutor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$1.class deleted file mode 100644 index a1ad0599271..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorScope.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorScope.class deleted file mode 100644 index 7709292fb90..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorScope.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorTypeImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorTypeImpl.class deleted file mode 100644 index ad1c3b91e99..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils$ErrorTypeImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils.class deleted file mode 100644 index 1e2f325ed0d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/ErrorUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$1.class deleted file mode 100644 index 57c08b5e451..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$2.class deleted file mode 100644 index 50421396c5f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses.class deleted file mode 100644 index 66bb5c7cbcf..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardClasses.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardLibrary.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardLibrary.class deleted file mode 100644 index 83979a8ee4e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetStandardLibrary.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetType.class deleted file mode 100644 index cba4ffdc210..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeImpl.class deleted file mode 100644 index 0dbe7e70894..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/JetTypeImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/NamespaceType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/NamespaceType.class deleted file mode 100644 index 2a4f25c5ad0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/NamespaceType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/PrimitiveType.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/PrimitiveType.class deleted file mode 100644 index e2e47965136..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/PrimitiveType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructor.class deleted file mode 100644 index 4fd1c7871f5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructorImpl.class deleted file mode 100644 index 100666f8992..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeConstructorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeProjection.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeProjection.class deleted file mode 100644 index 4be5a3925d3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeProjection.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$1.class deleted file mode 100644 index 249087a3616..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$2.class deleted file mode 100644 index 5ed8e38d0b6..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$MapToTypeSubstitutionAdapter.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$MapToTypeSubstitutionAdapter.class deleted file mode 100644 index abb2e1d2f7b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$MapToTypeSubstitutionAdapter.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$SubstitutionException.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$SubstitutionException.class deleted file mode 100644 index 28cb25e2874..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$SubstitutionException.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution$1.class deleted file mode 100644 index 6a5efc2a76d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution.class deleted file mode 100644 index c54b65456fd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor$TypeSubstitution.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor.class deleted file mode 100644 index fd12f31d383..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeSubstitutor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$1.class deleted file mode 100644 index 9cb6583fee9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$2.class deleted file mode 100644 index a49afa270dc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$3.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$3.class deleted file mode 100644 index 9f494a92d71..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils.class deleted file mode 100644 index 2dbe9bee6a3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/TypeUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/Variance$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/Variance$1.class deleted file mode 100644 index 0b7413e58fa..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/Variance$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/Variance.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/Variance.class deleted file mode 100644 index 75b16814762..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/Variance.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker$1.class deleted file mode 100644 index c0aa764cb51..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker$TypeCheckerTypingConstraints.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker$TypeCheckerTypingConstraints.class deleted file mode 100644 index 7ae6aafe94d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker$TypeCheckerTypingConstraints.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker.class deleted file mode 100644 index 562ea668e3c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/JetTypeChecker.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/TypeCheckingProcedure.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/TypeCheckingProcedure.class deleted file mode 100644 index 933bac881c4..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/TypeCheckingProcedure.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/TypingConstraints.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/TypingConstraints.class deleted file mode 100644 index 82d3caacf9d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/checker/TypingConstraints.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/error/ErrorNamedFunctionDescriptorImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/error/ErrorNamedFunctionDescriptorImpl.class deleted file mode 100644 index 0c1cf1f6342..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/error/ErrorNamedFunctionDescriptorImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor$1.class deleted file mode 100644 index d9ed3b7fcf5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.class deleted file mode 100644 index ac247379607..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1$1.class deleted file mode 100644 index 5bc6cb3ae1c..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1.class deleted file mode 100644 index 5eb31f47200..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.class deleted file mode 100644 index bc66ac826c2..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ClosureExpressionsTypingVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/CoercionStrategy.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/CoercionStrategy.class deleted file mode 100644 index 1021ce24709..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/CoercionStrategy.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor$1.class deleted file mode 100644 index 6cf74d60c96..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor.class deleted file mode 100644 index 9c7cb36d053..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ControlStructureTypingVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils$1.class deleted file mode 100644 index 49f51194d10..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils.class deleted file mode 100644 index 2e0cd4a9b28..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/DataFlowUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.class deleted file mode 100644 index 3005c9df877..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingFacade.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingFacade.class deleted file mode 100644 index 13674b6dfff..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingFacade.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingInternals.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingInternals.class deleted file mode 100644 index 601e1ae51bb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingInternals.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$1.class deleted file mode 100644 index 302901afdf0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$2.class deleted file mode 100644 index fa272d715e5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.class deleted file mode 100644 index 38982754885..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingServices.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.class deleted file mode 100644 index d4284dbff64..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitor.class deleted file mode 100644 index 2a4f8f59c2d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher.class deleted file mode 100644 index 6676a721def..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorDispatcher.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.class deleted file mode 100644 index 32da6ce3cf8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/LabelResolver.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/LabelResolver.class deleted file mode 100644 index 4446b771d2b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/LabelResolver.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/OperatorConventions.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/OperatorConventions.class deleted file mode 100644 index 173da326548..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/OperatorConventions.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$1.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$1.class deleted file mode 100644 index 0d21d4c5477..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$2.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$2.class deleted file mode 100644 index 0e713855d1f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor.class deleted file mode 100644 index 3f3192bc0bb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lang/types/expressions/PatternMatchingTypingVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetKeywordToken.class b/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetKeywordToken.class deleted file mode 100644 index 4f5365d22d5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetKeywordToken.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetLexer.class b/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetLexer.class deleted file mode 100644 index d97bed10e90..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetLexer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetToken.class b/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetToken.class deleted file mode 100644 index dd73472f508..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetToken.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetTokens.class b/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetTokens.class deleted file mode 100644 index 62f64f8f290..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lexer/JetTokens.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer$State.class b/k2js/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer$State.class deleted file mode 100644 index a04260caade..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer$State.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer.class b/k2js/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer.class deleted file mode 100644 index 5adc082c353..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/lexer/_JetLexer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetFileType$1.class b/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetFileType$1.class deleted file mode 100644 index ca3927dbdc0..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetFileType$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetFileType.class b/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetFileType.class deleted file mode 100644 index 68ef012e5b7..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetFileType.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetLanguage.class b/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetLanguage.class deleted file mode 100644 index 7aa640b7bea..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetLanguage.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetMainDetector.class b/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetMainDetector.class deleted file mode 100644 index 84594b2d03f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/plugin/JetMainDetector.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$1.class b/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$1.class deleted file mode 100644 index d73f9d78499..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$2.class b/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$2.class deleted file mode 100644 index 2860f258204..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$3.class b/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$3.class deleted file mode 100644 index 264b9e5b769..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$RenderDeclarationDescriptorVisitor.class b/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$RenderDeclarationDescriptorVisitor.class deleted file mode 100644 index 6b699636305..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer$RenderDeclarationDescriptorVisitor.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer.class b/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer.class deleted file mode 100644 index 509ae302200..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/resolve/DescriptorRenderer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/Box.class b/k2js/out/production/frontend/org/jetbrains/jet/util/Box.class deleted file mode 100644 index a812cfdf150..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/Box.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$1.class deleted file mode 100644 index 82b5cd0adbf..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$2.class b/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$2.class deleted file mode 100644 index 68e77400e46..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$3.class b/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$3.class deleted file mode 100644 index 930959e961f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers$3.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers.class b/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers.class deleted file mode 100644 index 2e7aec2a284..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/CommonSuppliers.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/QualifiedNamesUtil.class b/k2js/out/production/frontend/org/jetbrains/jet/util/QualifiedNamesUtil.class deleted file mode 100644 index 6895d4ce192..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/QualifiedNamesUtil.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$1.class deleted file mode 100644 index 1c72f2bb1a8..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$State.class b/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$State.class deleted file mode 100644 index a77f73044fc..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue$State.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue.class b/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue.class deleted file mode 100644 index 0678c3e9251..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValue.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValueWithDefault.class b/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValueWithDefault.class deleted file mode 100644 index fd90b95434f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/LazyValueWithDefault.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/ReenteringLazyValueComputationException.class b/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/ReenteringLazyValueComputationException.class deleted file mode 100644 index 040e092b9d9..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/lazy/ReenteringLazyValueComputationException.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice$1.class deleted file mode 100644 index 0c6d743fea3..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice.class deleted file mode 100644 index ccb5efa8f0d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/BasicWritableSlice.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/DelegatingSlice.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/DelegatingSlice.class deleted file mode 100644 index aa37270d94d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/DelegatingSlice.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$1.class deleted file mode 100644 index f4367ce193e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$2.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$2.class deleted file mode 100644 index 97f3e87a214..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier.class deleted file mode 100644 index 8178ed7bc70..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MapSupplier.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MutableSlicedMap.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MutableSlicedMap.class deleted file mode 100644 index f512cd4be59..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/MutableSlicedMap.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/ReadOnlySlice.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/ReadOnlySlice.class deleted file mode 100644 index a79ff6c447f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/ReadOnlySlice.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RemovableSlice.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RemovableSlice.class deleted file mode 100644 index 76bca87817d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RemovableSlice.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy$1.class deleted file mode 100644 index 8e0aa9e67a1..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy.class deleted file mode 100644 index c72f0301972..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/RewritePolicy.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap$1.class deleted file mode 100644 index ffb4605a274..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap.class deleted file mode 100644 index 746919e6e0b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMap.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapImpl.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapImpl.class deleted file mode 100644 index 3f7cab3121e..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapImpl.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapKey.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapKey.class deleted file mode 100644 index 1089949a15f..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/SlicedMapKey.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$1.class deleted file mode 100644 index aa44838517d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$BasicRemovableSlice.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$BasicRemovableSlice.class deleted file mode 100644 index 7de302ad3e5..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$BasicRemovableSlice.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer$1.class deleted file mode 100644 index 56127f12ccd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer.class deleted file mode 100644 index 9fbb414f2cd..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$KeyNormalizer.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SetSlice.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SetSlice.class deleted file mode 100644 index 06da9c1439b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SetSlice.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$1.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$1.class deleted file mode 100644 index 3d5567c86bb..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$1.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$2.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$2.class deleted file mode 100644 index 6d43b1c998a..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder$2.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder.class deleted file mode 100644 index f747dc4941d..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceBuilder.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceWithOpposite.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceWithOpposite.class deleted file mode 100644 index 5f356d8c59b..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices$SliceWithOpposite.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices.class deleted file mode 100644 index 33e1015e5ac..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/Slices.class and /dev/null differ diff --git a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/WritableSlice.class b/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/WritableSlice.class deleted file mode 100644 index 181bf6c5169..00000000000 Binary files a/k2js/out/production/frontend/org/jetbrains/jet/util/slicedmap/WritableSlice.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/InternalCompilerException.class b/k2js/out/production/js/com/google/dart/compiler/InternalCompilerException.class deleted file mode 100644 index e90e21f352b..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/InternalCompilerException.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/Source.class b/k2js/out/production/js/com/google/dart/compiler/Source.class deleted file mode 100644 index c1bbb35bbdd..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/Source.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/Cloner.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/Cloner.class deleted file mode 100644 index f98d0647b07..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/Cloner.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.class deleted file mode 100644 index bd899df681e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsConstructExpressionVisitor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.class deleted file mode 100644 index d29f46c9242..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsFirstExpressionVisitor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNamer.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNamer.class deleted file mode 100644 index a2f3be662d5..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNamer.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer$1.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer$1.class deleted file mode 100644 index 4f5caf72c85..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer$1.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer$JsNormalizing.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer$JsNormalizing.class deleted file mode 100644 index 9f224885d3b..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer$JsNormalizing.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer.class deleted file mode 100644 index a1a2d171ba0..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsNormalizer.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsParserException$SourceDetail.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsParserException$SourceDetail.class deleted file mode 100644 index 7530587299c..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsParserException$SourceDetail.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsParserException.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsParserException.class deleted file mode 100644 index 261c4e62b1a..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsParserException.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.class deleted file mode 100644 index 8590bb12921..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsPrecedenceVisitor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsPrettyNamer.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsPrettyNamer.class deleted file mode 100644 index ec7ea5d1c55..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsPrettyNamer.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.class deleted file mode 100644 index c1fee06ba8b..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsRequiresSemiVisitor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsReservedIdentifiers.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsReservedIdentifiers.class deleted file mode 100644 index 447a2842d95..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsReservedIdentifiers.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.class deleted file mode 100644 index 86b0c5fc0a1..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsSourceGenerationVisitor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.class deleted file mode 100644 index 483876a133a..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/JsToStringGenerationVisitor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/UncheckedJsParserException.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/UncheckedJsParserException.class deleted file mode 100644 index bf1ea91ee01..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/UncheckedJsParserException.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/CanBooleanEval.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/CanBooleanEval.class deleted file mode 100644 index 0f8c465b259..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/CanBooleanEval.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasArguments.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasArguments.class deleted file mode 100644 index 08c78a57dd9..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasArguments.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasCondition.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasCondition.class deleted file mode 100644 index feb9659dee5..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasCondition.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasName.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasName.class deleted file mode 100644 index e713e590e4c..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/HasName.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsArrayAccess.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsArrayAccess.class deleted file mode 100644 index 4f12989a7dd..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsArrayAccess.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.class deleted file mode 100644 index a2d486bbdbd..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsArrayLiteral.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.class deleted file mode 100644 index 080e4cb0a90..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBinaryOperation.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.class deleted file mode 100644 index c2f33de9503..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBinaryOperator.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBlock.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBlock.class deleted file mode 100644 index 0ca29337506..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBlock.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.class deleted file mode 100644 index e3bd7cbab2f..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBooleanLiteral.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBreak.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBreak.class deleted file mode 100644 index 2ef7b216557..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsBreak.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCase.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCase.class deleted file mode 100644 index 01164ddc925..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCase.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatch.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatch.class deleted file mode 100644 index 69754fe5aa0..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatch.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatchScope$1.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatchScope$1.class deleted file mode 100644 index c302d9fd1a0..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatchScope$1.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatchScope.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatchScope.class deleted file mode 100644 index b8182b27596..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsCatchScope.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsConditional.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsConditional.class deleted file mode 100644 index 93c438e5696..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsConditional.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsContext.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsContext.class deleted file mode 100644 index 67151644783..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsContext.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsContinue.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsContinue.class deleted file mode 100644 index 74bd3e0192e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsContinue.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDebugger.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDebugger.class deleted file mode 100644 index 56e908cbb5b..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDebugger.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDefault.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDefault.class deleted file mode 100644 index 3e725b1cb6c..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDefault.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDoWhile.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDoWhile.class deleted file mode 100644 index e2b0a2f833f..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsDoWhile.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsEmpty.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsEmpty.class deleted file mode 100644 index 6903d45f4b9..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsEmpty.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsExprStmt.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsExprStmt.class deleted file mode 100644 index 8bedf484039..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsExprStmt.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsExpression.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsExpression.class deleted file mode 100644 index 46042c4047e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsExpression.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsFor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsFor.class deleted file mode 100644 index 55252602ad8..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsFor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsForIn.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsForIn.class deleted file mode 100644 index c7c9f723fe0..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsForIn.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsFunction.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsFunction.class deleted file mode 100644 index 981d3a8a86a..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsFunction.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.class deleted file mode 100644 index d2551ba57e3..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsGlobalBlock.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsIf.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsIf.class deleted file mode 100644 index ac1a529bc78..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsIf.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsInvocation.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsInvocation.class deleted file mode 100644 index 79397ce516a..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsInvocation.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsLabel.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsLabel.class deleted file mode 100644 index 9458fff5d62..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsLabel.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsLiteral.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsLiteral.class deleted file mode 100644 index aa95bc0b81e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsLiteral.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$1.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$1.class deleted file mode 100644 index cf2dfd079ce..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$1.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$ListContext.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$ListContext.class deleted file mode 100644 index 875e314b49e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$ListContext.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$LvalueContext.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$LvalueContext.class deleted file mode 100644 index 39052ed7ff0..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$LvalueContext.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$NodeContext.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$NodeContext.class deleted file mode 100644 index 2aa9d3e97b8..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor$NodeContext.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor.class deleted file mode 100644 index 3b17c877718..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsModVisitor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsName.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsName.class deleted file mode 100644 index 06cdd835eaa..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsName.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNameRef.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNameRef.class deleted file mode 100644 index 4f321ba01b4..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNameRef.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNew.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNew.class deleted file mode 100644 index ec1eb5eec96..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNew.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNode.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNode.class deleted file mode 100644 index 1d6645609ad..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNode.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNullLiteral.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNullLiteral.class deleted file mode 100644 index 5125d7d6734..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNullLiteral.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.class deleted file mode 100644 index 306ec87b9e1..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsNumberLiteral.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.class deleted file mode 100644 index c7a311a68eb..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsObjectLiteral.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsOperator.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsOperator.class deleted file mode 100644 index 5aa8ee16f29..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsOperator.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsParameter.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsParameter.class deleted file mode 100644 index 0a6a39dedb7..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsParameter.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.class deleted file mode 100644 index c0cc818da1d..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPostfixOperation.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.class deleted file mode 100644 index f310664e665..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPrefixOperation.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsProgram.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsProgram.class deleted file mode 100644 index d14a8704abc..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsProgram.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsProgramFragment.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsProgramFragment.class deleted file mode 100644 index 610b487220a..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsProgramFragment.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.class deleted file mode 100644 index 1d4c754e71e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsPropertyInitializer.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsRegExp.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsRegExp.class deleted file mode 100644 index 269aeb19cb8..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsRegExp.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsReturn.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsReturn.class deleted file mode 100644 index 32af8941698..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsReturn.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsRootScope.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsRootScope.class deleted file mode 100644 index 675ec034567..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsRootScope.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsScope.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsScope.class deleted file mode 100644 index ce11a8356dc..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsScope.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsStatement.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsStatement.class deleted file mode 100644 index 4e2da233947..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsStatement.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsStringLiteral.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsStringLiteral.class deleted file mode 100644 index aecd3760012..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsStringLiteral.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsSwitch.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsSwitch.class deleted file mode 100644 index fb06aa9d5fc..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsSwitch.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsSwitchMember.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsSwitchMember.class deleted file mode 100644 index 22974f03fe4..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsSwitchMember.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsThisRef.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsThisRef.class deleted file mode 100644 index 6f2c76e92f4..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsThisRef.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsThrow.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsThrow.class deleted file mode 100644 index 816f332556e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsThrow.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsTry.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsTry.class deleted file mode 100644 index c0e40e2af87..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsTry.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.class deleted file mode 100644 index c51260cb92c..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsUnaryOperation.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.class deleted file mode 100644 index 72c8784bb7a..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsUnaryOperator.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsValueLiteral.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsValueLiteral.class deleted file mode 100644 index 5481c5cd317..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsValueLiteral.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVars$JsVar.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVars$JsVar.class deleted file mode 100644 index 93212c2af77..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVars$JsVar.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVars.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVars.class deleted file mode 100644 index c369ad56705..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVars.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitable.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitable.class deleted file mode 100644 index 10651420c8c..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitable.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor$1.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor$1.class deleted file mode 100644 index f801d2780d4..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor$1.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor$2.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor$2.class deleted file mode 100644 index a5437dce68c..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor$2.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor.class deleted file mode 100644 index 09102391519..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsVisitor.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsWhile.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsWhile.class deleted file mode 100644 index d8ad387e9cb..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/JsWhile.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/NodeKind.class b/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/NodeKind.class deleted file mode 100644 index a81b8f957ec..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/backend/js/ast/NodeKind.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/common/AbstractNode.class b/k2js/out/production/js/com/google/dart/compiler/common/AbstractNode.class deleted file mode 100644 index 956f713b4f3..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/common/AbstractNode.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/common/HasSourceInfo.class b/k2js/out/production/js/com/google/dart/compiler/common/HasSourceInfo.class deleted file mode 100644 index 9cd3d54d59c..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/common/HasSourceInfo.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/common/Name.class b/k2js/out/production/js/com/google/dart/compiler/common/Name.class deleted file mode 100644 index 62dbf1c9281..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/common/Name.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/common/NameFactory$FakeKey.class b/k2js/out/production/js/com/google/dart/compiler/common/NameFactory$FakeKey.class deleted file mode 100644 index 2b72e01fc04..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/common/NameFactory$FakeKey.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/common/NameFactory$RealKey.class b/k2js/out/production/js/com/google/dart/compiler/common/NameFactory$RealKey.class deleted file mode 100644 index 6e75def2dc7..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/common/NameFactory$RealKey.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/common/NameFactory.class b/k2js/out/production/js/com/google/dart/compiler/common/NameFactory.class deleted file mode 100644 index 49ab0778638..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/common/NameFactory.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/common/SourceInfo.class b/k2js/out/production/js/com/google/dart/compiler/common/SourceInfo.class deleted file mode 100644 index d519868779d..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/common/SourceInfo.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/AbstractTextOutput.class b/k2js/out/production/js/com/google/dart/compiler/util/AbstractTextOutput.class deleted file mode 100644 index c7fb5102c0a..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/AbstractTextOutput.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/AstUtil$Mutator.class b/k2js/out/production/js/com/google/dart/compiler/util/AstUtil$Mutator.class deleted file mode 100644 index 4ad65a73be1..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/AstUtil$Mutator.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/AstUtil$SaveLastExpressionMutator.class b/k2js/out/production/js/com/google/dart/compiler/util/AstUtil$SaveLastExpressionMutator.class deleted file mode 100644 index 544df59a35e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/AstUtil$SaveLastExpressionMutator.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/AstUtil.class b/k2js/out/production/js/com/google/dart/compiler/util/AstUtil.class deleted file mode 100644 index 55145d5c001..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/AstUtil.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/DefaultTextOutput.class b/k2js/out/production/js/com/google/dart/compiler/util/DefaultTextOutput.class deleted file mode 100644 index e8b8e9bba94..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/DefaultTextOutput.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/Hack.class b/k2js/out/production/js/com/google/dart/compiler/util/Hack.class deleted file mode 100644 index 1e8fa5d2c8e..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/Hack.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/Lists.class b/k2js/out/production/js/com/google/dart/compiler/util/Lists.class deleted file mode 100644 index 835e058e9c0..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/Lists.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/Maps.class b/k2js/out/production/js/com/google/dart/compiler/util/Maps.class deleted file mode 100644 index 729c1d10a67..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/Maps.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/Paths.class b/k2js/out/production/js/com/google/dart/compiler/util/Paths.class deleted file mode 100644 index 6f2e67fa4b4..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/Paths.class and /dev/null differ diff --git a/k2js/out/production/js/com/google/dart/compiler/util/TextOutput.class b/k2js/out/production/js/com/google/dart/compiler/util/TextOutput.class deleted file mode 100644 index 0bcead984a9..00000000000 Binary files a/k2js/out/production/js/com/google/dart/compiler/util/TextOutput.class and /dev/null differ diff --git a/k2js/out/production/jslib/core/Dummy.class b/k2js/out/production/jslib/core/Dummy.class deleted file mode 100644 index 513f8142ae4..00000000000 Binary files a/k2js/out/production/jslib/core/Dummy.class and /dev/null differ diff --git a/k2js/out/production/jslib/core/annotations.kt b/k2js/out/production/jslib/core/annotations.kt deleted file mode 100644 index f63aff178ae..00000000000 --- a/k2js/out/production/jslib/core/annotations.kt +++ /dev/null @@ -1,5 +0,0 @@ -package js; -native -annotation class native(name : String = "") {} -native -annotation class library(name : String = "") {} \ No newline at end of file diff --git a/k2js/out/production/jslib/core/core.kt b/k2js/out/production/jslib/core/core.kt deleted file mode 100644 index 1edf565e29d..00000000000 --- a/k2js/out/production/jslib/core/core.kt +++ /dev/null @@ -1,39 +0,0 @@ -package js; - -import js.library -import js.native -import java.util.*; - - - -native -val noImpl : Nothing = throw Exception(); - -library("println") -fun println() {} -library("println") -fun println(s : Any?) {} -library("print") -fun print(s : Any?) {} -library("parseInt") -fun parseInt(s : String) : Int = 0 -library -open class Exception() {} -library -class NumberFormatException() : Exception() {} - -native -fun setTimeout(callback : ()-> Unit) {} - -native -fun setInterval(callback : ()-> Unit, ms : Int) {} -native -fun setInterval(callback : ()-> Unit) {} - - -native -open class DomElement() { - val offsetLeft = 0.0; - val offsetTop = 0.0; - val offsetParent : DomElement? = DomElement(); -} diff --git a/k2js/out/production/jslib/core/javalang.kt b/k2js/out/production/jslib/core/javalang.kt deleted file mode 100644 index 1cb140116f0..00000000000 --- a/k2js/out/production/jslib/core/javalang.kt +++ /dev/null @@ -1,14 +0,0 @@ -package java.lang - -import java.util.Iterator; -import js.library - -library -trait Iterable { - fun iterator() : java.util.Iterator {} -} - -library("splitString") -public fun String.split(regex : String) : Array { -} - diff --git a/k2js/out/production/jslib/core/javautil.kt b/k2js/out/production/jslib/core/javautil.kt deleted file mode 100644 index 64a5101bc46..00000000000 --- a/k2js/out/production/jslib/core/javautil.kt +++ /dev/null @@ -1,175 +0,0 @@ -package java.util - -import js.*; - - -library("collectionsMax") -public fun max(col : Collection, comp : Comparator) : T {} - -library -public trait Comparator { - fun compare(obj1 : T, obj2 : T) : Int; -} - -library("comparator") -public fun comparator(f : (T, T) -> Int) : Comparator {} - - -library -public open class Iterator() { - open fun next() : T {} - open fun hasNext() : Boolean {} -} - -library -val Collections = object { - library("collectionsMax") - public fun max(col : Collection, comp : Comparator) : T = js.noImpl -} - -library -public open class ArrayList() : java.util.List { - override public fun size() : Int {} - override public fun isEmpty() : Boolean {} - override public fun contains(o : Any?) : Boolean {} - override public fun iterator() : Iterator {} - // override public fun indexOf(o : Any?) : Int {} - // override public fun lastIndexOf(o : Any?) : Int {} - // override public fun toArray() : Array {} - // override public fun toArray(a : Array) : Array {} - override public fun get(index : Int) : E {} - override public fun set(index : Int, element : E) : E {} - override public fun add(e : E) : Boolean {} - override public fun add(index : Int, element : E) : Unit {} - override public fun remove(index : Int) : E {} - override public fun remove(o : Any?) : Boolean {} - override public fun clear() : Unit {} - override public fun addAll(c : java.util.Collection) : Boolean {} - // override public fun addAll(index : Int, c : java.util.Collection) : Boolean {} -} - -library -public trait Collection : java.lang.Iterable { - open fun size() : Int - open fun isEmpty() : Boolean - open fun contains(o : Any?) : Boolean - override fun iterator() : java.util.Iterator - // open fun toArray() : Array - // open fun toArray(a : Array) : Array - open fun add(e : E) : Boolean - open fun remove(o : Any?) : Boolean - //open fun containsAll(c : java.util.Collection<*>) : Boolean - open fun addAll(c : java.util.Collection) : Boolean - //open fun removeAll(c : java.util.Collection<*>) : Boolean - //open fun retainAll(c : java.util.Collection<*>) : Boolean - open fun clear() : Unit -} - -library -public trait List : Collection { - override fun size() : Int - override fun isEmpty() : Boolean - override fun contains(o : Any?) : Boolean - override fun iterator() : java.util.Iterator - // override fun toArray() : Array - // Simulate Java's array covariance - // override fun toArray(a : Array) : Array - override fun add(e : E) : Boolean - override fun remove(o : Any?) : Boolean - // override fun containsAll(c : java.util.Collection<*>) : Boolean - override fun addAll(c : java.util.Collection) : Boolean - // open fun addAll(index : Int, c : java.util.Collection) : Boolean - // override fun removeAll(c : java.util.Collection<*>) : Boolean - // override fun retainAll(c : java.util.Collection<*>) : Boolean - override fun clear() : Unit - open fun get(index : Int) : E - open fun set(index : Int, element : E) : E - open fun add(index : Int, element : E) : Unit - open fun remove(index : Int) : E - // open fun indexOf(o : Any?) : Int - // open fun lastIndexOf(o : Any?) : Int -} - -library -public trait Set : Collection { - override fun size() : Int - override fun isEmpty() : Boolean - override fun contains(o : Any?) : Boolean - override fun iterator() : java.util.Iterator - // override fun toArray() : Array - // override fun toArray(a : Array) : Array - override fun add(e : E) : Boolean - override fun remove(o : Any?) : Boolean - //override fun containsAll(c : java.util.Collection<*>) : Boolean - override fun addAll(c : java.util.Collection) : Boolean - //override fun retainAll(c : java.util.Collection<*>) : Boolean - //override fun removeAll(c : java.util.Collection<*>) : Boolean - override fun clear() : Unit -} - -library -public open class HashSet() : java.util.Set { - override public fun iterator() : java.util.Iterator {} - override public fun size() : Int {} - override public fun isEmpty() : Boolean {} - override public fun contains(o : Any?) : Boolean {} - override public fun add(e : E) : Boolean {} - override public fun remove(o : Any?) : Boolean {} - override public fun clear() : Unit {} - override fun addAll(c : java.util.Collection) : Boolean -} - -library -public trait Map { - open fun size() : Int - open fun isEmpty() : Boolean - open fun containsKey(key : Any?) : Boolean - open fun containsValue(value : Any?) : Boolean - open fun get(key : Any?) : V? - open fun put(key : K, value : V) : V? - open fun remove(key : Any?) : V? - open fun putAll(m : java.util.Map) : Unit - open fun clear() : Unit - open fun keySet() : java.util.Set - open fun values() : java.util.Collection -} - -library -public open class HashMap() : java.util.Map { - override public fun size() : Int {} - override public fun isEmpty() : Boolean {} - override public fun get(key : Any?) : V {} - override public fun containsKey(key : Any?) : Boolean {} - override public fun put(key : K, value : V) : V {} - override public fun putAll(m : java.util.Map) : Unit {} - override public fun remove(key : Any?) : V? {} - override public fun clear() : Unit {} - override public fun containsValue(value : Any?) : Boolean {} - override public fun keySet() : java.util.Set {} - override public fun values() : java.util.Collection {} -} - -library -public open class LinkedList() : List { - override public fun iterator() : java.util.Iterator {} - override public fun isEmpty() : Boolean {} - override public fun contains(o : Any?) : Boolean {} - override public fun size() : Int {} - override public fun add(e : E) : Boolean {} - override public fun remove(o : Any?) : Boolean {} - override public fun addAll(c : java.util.Collection) : Boolean {} - override public fun clear() : Unit {} - override public fun get(index : Int) : E {} - override public fun set(index : Int, element : E) : E {} - override public fun add(index : Int, element : E) : Unit {} - override public fun remove(index : Int) : E {} - public fun poll() : E? {} - public fun peek() : E? {} - public fun offer(e : E) : Boolean {} -} - -library -public class StringBuilder() { - public fun append(obj : Any) : StringBuilder - public fun toString() : String -} \ No newline at end of file diff --git a/k2js/out/production/jslib/core/json.kt b/k2js/out/production/jslib/core/json.kt deleted file mode 100644 index df624aad0be..00000000000 --- a/k2js/out/production/jslib/core/json.kt +++ /dev/null @@ -1,18 +0,0 @@ -package js - -import java.util.*; -import js.library - -native -class Json() { - -} - -library("jsonSet") -fun Json.set(paramName : String, value : Any?) : Unit {} - -library("jsonGet") -fun Json.get(paramName : String) : Any? = null - -library("jsonFromTuples") -fun json(vararg pairs : Tuple2) = Json() diff --git a/k2js/out/production/jslib/core/math.kt b/k2js/out/production/jslib/core/math.kt deleted file mode 100644 index 3566b782aa6..00000000000 --- a/k2js/out/production/jslib/core/math.kt +++ /dev/null @@ -1,32 +0,0 @@ -package js; - -import js.native - -native -class MathClass() { - val PI : Double = 1.0; - fun random() : Double = 0.0; - fun abs(value : Double) = 0.0 - fun acos(value : Double) = 0.0 - fun asin(value : Double) = 0.0 - fun atan(value : Double) = 0.0 - fun atan2(x : Double, y : Double) = 0.0 - fun cos(value : Double) = 0.0 - fun sin(value : Double) = 0.0 - fun exp(value : Double) = 0.0 - fun max(vararg values : Double) = 0.0 - fun max(vararg values : Int) : Int = js.noImpl - fun min(vararg values : Int) : Int = js.noImpl - fun min(vararg values : Double) = 0.0 - fun sqrt(value : Double) = 0.0 - fun tan(value : Double) = 0.0 - fun log(value : Double) = 0.0 - fun pow(base : Double, exp : Double) = 0.0 - fun round(value : Double) = 0.0 - fun floor(value : Double) = 0.0 - fun ceil(value : Double) = 0.0 - -} - -native -val Math = MathClass(); \ No newline at end of file diff --git a/k2js/out/production/jslib/helper/ip.kt b/k2js/out/production/jslib/helper/ip.kt deleted file mode 100644 index d6f47cc8296..00000000000 --- a/k2js/out/production/jslib/helper/ip.kt +++ /dev/null @@ -1,7 +0,0 @@ -package ip.helper - -import html5.HTMLInputElement -import js.native - -native -fun getInputElement() : HTMLInputElement = js.noImpl \ No newline at end of file diff --git a/k2js/out/production/jslib/html5/canvas.kt b/k2js/out/production/jslib/html5/canvas.kt deleted file mode 100644 index 6caa62ab6d4..00000000000 --- a/k2js/out/production/jslib/html5/canvas.kt +++ /dev/null @@ -1,117 +0,0 @@ -package html5 - -import js.native -import js.DomElement - -native -class Context() { - fun save() { - } - fun restore() { - } - - fun scale(x : Double, y : Double) { - } - fun rotate(angle : Double) { - } - fun translate(x : Double, y : Double) { - } - - fun clearRect(x : Double, y : Double, w : Double, h : Double) { - } - fun fillRect(x : Double, y : Double, w : Double, h : Double) { - } - fun strokeRect(x : Double, y : Double, w : Double, h : Double) { - } - - var globalAlpha : Double = 1.0; - var strokeStyle : Any = "" - var fillStyle : Any = "" - var lineWidth : Double = 1.0 - var shadowOffsetX : Double = 0.0 - var shadowOffsetY : Double = 0.0 - var shadowBlur : Double = 0.0 - var shadowColor : String = "" - var font : String = "" - - fun beginPath() { - } - fun moveTo(x : Double, y : Double) { - } - fun closePath() { - } - - fun lineTo(x : Double, y : Double) { - } - fun quadraticCurveTo(cpx : Double, cpy : Double, x : Double, y : Double) { - } - fun bezierCurveTo(cp1x : Double, cp1y : Double, cp2x : Double, cp2y : Double, x : Double, y : Double) { - } - fun arcTo(x1 : Double, y1 : Double, x2 : Double, y2 : Double, radius : Double) { - } - fun arc(x : Double, y : Double, radius : Double, startAngle : Double, endAngle : Double, anticlockwise : Boolean) { - } - - fun rect(x : Double, y : Double, w : Double, h : Double) { - } - fun fill() { - } - fun stroke() { - } - - fun fillText(text : String, x : Double, y : Double) { - } - fun fillText(text : String, x : Double, y : Double, maxWidth : Double) { - } - fun strokeText(text : String, x : Double, y : Double) { - } - fun strokeText(text : String, x : Double, y : Double, maxWidth : Double) { - } - - fun measureText(text : String) : TextMetrics = TextMetrics(); - - fun drawImage(image : HTMLImageElement, dx : Double, dy : Double) { - } - fun drawImage(image : HTMLImageElement, dx: Double, dy: Double, dw: Double, dh: Double) { - } - fun drawImage(image : HTMLImageElement, sx: Double, sy: Double, - sw: Double, sh: Double, dx: Double, dy: Double, dw: Double, dh: Double) { - } - - fun createLinearGradient(x0 : Double, y0 : Double, x1 : Double, y1 : Double) : CanvasGradient = CanvasGradient() - fun createRadialGradient(x0 : Double, y0 : Double, r0 : Double, x1 : Double, y1 : Double, r1 : Double) : CanvasGradient = CanvasGradient(); - -} - -native -open class HTMLImageElement() : DomElement() { -} - -native -class CanvasGradient() { - fun addColorStop(offset : Double, color : String) {} -} - - -native -class Canvas() : DomElement() { - var width = 0.0; - var height = 0.0; - - //DOMString toDataURL(in optional DOMString type, in any... args); - fun toDataURL() : String = js.noImpl - fun toDataURL(typ : String) : String = js.noImpl -} - -native -class TextMetrics() { - val width : Int = 0 -} - -/*custom helpers*/ -native -fun getContext() : Context = Context(); -native -fun getCanvas() : Canvas = Canvas(); -native -fun getKotlinLogo() : HTMLImageElement = HTMLImageElement(); \ No newline at end of file diff --git a/k2js/out/production/jslib/html5/files.kt b/k2js/out/production/jslib/html5/files.kt deleted file mode 100644 index 8e05d2af4ef..00000000000 --- a/k2js/out/production/jslib/html5/files.kt +++ /dev/null @@ -1,37 +0,0 @@ -package html5.files - -import js.native - -native -class FileReader() { - var onloadend : ((FileReaderEvent)->Unit)? = js.noImpl // - fun readAsDataURL(blob : Blob) = js.noImpl - val result : File = js.noImpl -} - -native -class FileReaderEvent() { - val target : FileReader = js.noImpl -} - -native -class FileList() { - fun item(index : Int) : File? = js.noImpl - val length : Int = js.noImpl -} - -native -class File() : Blob() { - val name : String = js.noImpl - // readonly attribute Date lastModifiedDate; -} - -native -open class Blob() { - val size : Int = js.noImpl - val `type` : String = js.noImpl - //Blob slice(optional long long start, - //optional long long end, - //optional DOMString contentType); - // -} diff --git a/k2js/out/production/jslib/html5/image.kt b/k2js/out/production/jslib/html5/image.kt deleted file mode 100644 index dc1ec502959..00000000000 --- a/k2js/out/production/jslib/html5/image.kt +++ /dev/null @@ -1,25 +0,0 @@ -package html5 - -import js.Exception -import js.native -import js.DomElement -import html5.files.FileList - -native -class HTMLInputElement() : DomElement() { - val files : FileList = js.noImpl - var onchange : (HTMLInputElementEvent)->Unit = js.noImpl -} - -native -class HTMLInputElementEvent() { - val target : HTMLInputElement = js.noImpl -} - -native -class Image() : HTMLImageElement() { - var height : Int = js.noImpl - var width : Int = js.noImpl - var src : String = js.noImpl - var onload : ()->Unit = js.noImpl -} \ No newline at end of file diff --git a/k2js/out/production/jslib/jquery/common.kt b/k2js/out/production/jslib/jquery/common.kt deleted file mode 100644 index 54ad3feb9dd..00000000000 --- a/k2js/out/production/jslib/jquery/common.kt +++ /dev/null @@ -1,72 +0,0 @@ -package jquery; - -import js.*; -import js.DomElement - -native -class JQuery() { - fun addClass(className : String) : JQuery = js.noImpl; - fun addClass(f : DomElement.(Int, String)->String) = js.noImpl; - - fun attr(attrName : String) = ""; - fun attr(attrName : String, value : String) = this; - - fun html() : String = ""; - fun html(s : String) = this; - fun html(f : DomElement.(Int, String)->String) = this; - - - fun hasClass(className : String) = true - fun removeClass(className : String) = this - fun height() = 0 - fun width() = 0 - - fun click() = this; - - fun mousedown(handler : DomElement.(MouseEvent)->Unit) = this; - fun mouseup(handler : DomElement.(MouseEvent)->Unit) = this; - fun mousemove(handler : DomElement.(MouseEvent)->Unit) = this; - - fun dblclick(handler : DomElement.(MouseClickEvent)->Unit) = this; - fun click(handler : DomElement.(MouseClickEvent)->Unit) = this; - - fun load(handler : DomElement.()->Unit) = this; - fun change(handler : DomElement.()->Unit) = this; - - fun append(str : String) = this; - fun ready(handler : ()->Unit) = this; - fun text(text : String) = this; - fun slideUp() = this; - fun hover(handlerInOut : DomElement.() -> Unit) = this; - fun hover(handlerIn : DomElement.() -> Unit, handlerOut : DomElement.() -> Unit) = this; - fun next() : JQuery = js.noImpl - fun parent() : JQuery = js.noImpl -} - -native -open class MouseEvent() { - val pageX : Double = 0.0; - val pageY : Double = 0.0; - fun preventDefault() {} - fun isDefaultPrevented() : Boolean = true; -} - -native -class MouseClickEvent() : MouseEvent() { - val which : Int = 0; -} - - - -native("$") -fun jq(selector : String) = JQuery(); -native("$") -fun jq(selector : String, context : DomElement) = JQuery(); -native("$") -fun jq(callback : () -> Unit) = JQuery(); -native("$") -fun jq(obj : JQuery) = JQuery(); -native("$") -fun jq(el : DomElement) = JQuery(); -native("$") -fun jq() = JQuery(); diff --git a/k2js/out/production/jslib/jquery/ui.kt b/k2js/out/production/jslib/jquery/ui.kt deleted file mode 100644 index e9ca87be43a..00000000000 --- a/k2js/out/production/jslib/jquery/ui.kt +++ /dev/null @@ -1,15 +0,0 @@ -package jquery.ui - - -//jquery UI -import jquery.JQuery -import js.native - -native -fun JQuery.buttonset() : JQuery = js.noImpl; -native -fun JQuery.dialog() : JQuery = js.noImpl; -native -fun JQuery.button() : JQuery = js.noImpl; -native -fun JQuery.accordion() : JQuery = js.noImpl diff --git a/k2js/out/production/jslib/pixastic/pixastic.kt b/k2js/out/production/jslib/pixastic/pixastic.kt deleted file mode 100644 index 66bcf91bf97..00000000000 --- a/k2js/out/production/jslib/pixastic/pixastic.kt +++ /dev/null @@ -1,11 +0,0 @@ -package jquery.pixastic - -import jquery.JQuery -import js.native - -native -fun JQuery.pixastic(actionName : String) = js.noImpl - -native -fun addAction(actionName : String, - process : (oldData : Array, newData : Array, width : Int, height : Int)->Unit) = js.noImpl \ No newline at end of file diff --git a/k2js/out/production/jslib/raphael/raphael.kt b/k2js/out/production/jslib/raphael/raphael.kt deleted file mode 100644 index e30b63b15c1..00000000000 --- a/k2js/out/production/jslib/raphael/raphael.kt +++ /dev/null @@ -1,62 +0,0 @@ -package raphael - -import js.*; -import js.*; - -native -open class Element() { - - fun attr(name : String, value : Any?) : Element = this - fun attr(nameToValue : Json) : Element = this - - fun click(handler : Element.()-> Unit) = this; - - fun mouseover(handler : Element.() -> Unit) = this - fun mouseout(handler : Element.() -> Unit) = this - - - fun getTotalLength() : Double = 0.0 - fun getPointAtLength(length : Double) : Point {} - - fun animate(params : Json, ms : Int, callback : ()-> Unit) : Element {} - fun animate(params : Json, ms : Int, s : String) : Element {} - fun animate(params : Json, ms : Int) : Element {} - //fun mouse -} - -native -class Set() : Element() { - fun push(el : Element) {} -} - -native -class Paper() { - fun path(pathString : String) : Element = Element(); - fun path() : Element = Element(); - - fun ellipse(x : Int, y : Int, rx : Int, ry : Int) : Element {} - fun circle(x : Int, y : Int, r : Int) : Element {} - fun set() : Set {} - - val customAttributes : Json = Json(); -} - -native("Raphael") -fun Raphael(elementId : String, width : Int, height : Int) : Paper = Paper(); -native("Raphael") -fun Raphael(elementId : String, width : Int, height : Int, initFun : Paper.() -> Unit) : Unit {} - -native -fun getColor() : Color {} -native -fun resetColors() {} - -native -class Color() {} - -native -class Point() { - val x = 0 - val y = 0 - val alpha = 0 -} diff --git a/k2js/out/production/stdlib/Arrays.kt b/k2js/out/production/stdlib/Arrays.kt deleted file mode 100644 index 48e1c8fc595..00000000000 --- a/k2js/out/production/stdlib/Arrays.kt +++ /dev/null @@ -1,103 +0,0 @@ -package std - -import java.io.ByteArrayInputStream - -import java.util.Arrays - -// Array "constructor" -inline fun array(vararg t : T) : Array = t - -// "constructors" for primitive types array -inline fun doubleArray(vararg content : Double) = content - -inline fun floatArray(vararg content : Float) = content - -inline fun longArray(vararg content : Long) = content - -inline fun intArray(vararg content : Int) = content - -inline fun charArray(vararg content : Char) = content - -inline fun shortArray(vararg content : Short) = content - -inline fun byteArray(vararg content : Byte) = content - -inline fun booleanArray(vararg content : Boolean) = content - -inline fun ByteArray.binarySearch(key: Byte) = Arrays.binarySearch(this, key) -inline fun ShortArray.binarySearch(key: Short) = Arrays.binarySearch(this, key) -inline fun IntArray.binarySearch(key: Int) = Arrays.binarySearch(this, key) -inline fun LongArray.binarySearch(key: Long) = Arrays.binarySearch(this, key) -inline fun FloatArray.binarySearch(key: Float) = Arrays.binarySearch(this, key) -inline fun DoubleArray.binarySearch(key: Double) = Arrays.binarySearch(this, key) -inline fun CharArray.binarySearch(key: Char) = Arrays.binarySearch(this, key) - -inline fun ByteArray.binarySearch(fromIndex: Int, toIndex: Int, key: Byte) = Arrays.binarySearch(this, fromIndex, toIndex, key) -inline fun ShortArray.binarySearch(fromIndex: Int, toIndex: Int, key: Short) = Arrays.binarySearch(this, fromIndex, toIndex, key) -inline fun IntArray.binarySearch(fromIndex: Int, toIndex: Int, key: Int) = Arrays.binarySearch(this, fromIndex, toIndex, key) -inline fun LongArray.binarySearch(fromIndex: Int, toIndex: Int, key: Long) = Arrays.binarySearch(this, fromIndex, toIndex, key) -inline fun FloatArray.binarySearch(fromIndex: Int, toIndex: Int, key: Float) = Arrays.binarySearch(this, fromIndex, toIndex, key) -inline fun DoubleArray.binarySearch(fromIndex: Int, toIndex: Int, key: Double) = Arrays.binarySearch(this, fromIndex, toIndex, key) -inline fun CharArray.binarySearch(fromIndex: Int, toIndex: Int, key: Char) = Arrays.binarySearch(this, fromIndex, toIndex, key) - -/* -inline fun Array.binarySearch(key: T, comparator: fun(T,T):Int) = Arrays.binarySearch(this, key, object: java.util.Comparator { - override fun compare(a: T, b: T) = comparator(a, b) - - override fun equals(obj: Any?) = obj.identityEquals(this) -}) -*/ -inline fun BooleanArray.fill(value: Boolean) = Arrays.fill(this, value) -inline fun ByteArray.fill(value: Byte) = Arrays.fill(this, value) -inline fun ShortArray.fill(value: Short) = Arrays.fill(this, value) -inline fun IntArray.fill(value: Int) = Arrays.fill(this, value) -inline fun LongArray.fill(value: Long) = Arrays.fill(this, value) -inline fun FloatArray.fill(value: Float) = Arrays.fill(this, value) -inline fun DoubleArray.fill(value: Double) = Arrays.fill(this, value) -inline fun CharArray.fill(value: Char) = Arrays.fill(this, value) - -inline fun Array.fill(value: T) = Arrays.fill(this as Array, value) - -inline fun ByteArray.sort() = Arrays.sort(this) -inline fun ShortArray.sort() = Arrays.sort(this) -inline fun IntArray.sort() = Arrays.sort(this) -inline fun LongArray.sort() = Arrays.sort(this) -inline fun FloatArray.sort() = Arrays.sort(this) -inline fun DoubleArray.sort() = Arrays.sort(this) -inline fun CharArray.sort() = Arrays.sort(this) - -inline fun ByteArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) -inline fun ShortArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) -inline fun IntArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) -inline fun LongArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) -inline fun FloatArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) -inline fun DoubleArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) -inline fun CharArray.sort(fromIndex: Int, toIndex: Int) = Arrays.sort(this, fromIndex, toIndex) - -inline fun BooleanArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun ByteArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun ShortArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun IntArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun LongArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun FloatArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun DoubleArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) -inline fun CharArray.copyOf(newLength: Int = this.size) = Arrays.copyOf(this, newLength) - -inline fun Array.copyOf(newLength: Int = this.size) : Array = Arrays.copyOf(this, newLength).sure() - -inline fun BooleanArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun ByteArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun ShortArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun IntArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun LongArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun FloatArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun DoubleArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) -inline fun CharArray.copyOfRange(from: Int, to: Int) = Arrays.copyOfRange(this, from, to) - -inline fun Array.copyOfRange(from: Int, to: Int) : Array = Arrays.copyOfRange(this, from, to).sure() - -inline val ByteArray.inputStream : ByteArrayInputStream - get() = ByteArrayInputStream(this) - -inline fun ByteArray.inputStream(offset: Int, length: Int) = ByteArrayInputStream(this, offset, length) - diff --git a/k2js/out/production/stdlib/Filter.kt b/k2js/out/production/stdlib/Filter.kt deleted file mode 100644 index bf458ae0fb8..00000000000 --- a/k2js/out/production/stdlib/Filter.kt +++ /dev/null @@ -1,64 +0,0 @@ -package std - -import java.util.* -import java.lang.Iterable - -/* -Filters given iterator -*/ -inline fun java.util.Iterator.filter(f: (T)-> Boolean) : java.util.Iterator = FilterIterator(this, f) - -/* -Adds filtered elements in to given container -*/ -inline fun > java.lang.Iterable.filterTo(var container: U, filter: (T)->Boolean) : U { - for(element in this) { - if(filter(element)) - container.add(element) - } - return container -} - -/* -Create iterator filtering given java.lang.Iterable -*/ -/* -inline fun java.lang.Iterable.filter(f: (T)->Boolean) : java.util.Iterator = (iterator() as java.util.Iterator).filter(f) -*/ - -private class FilterIterator(val original: java.util.Iterator, val filter: (T)-> Boolean) : java.util.Iterator { - var state = 0 - var nextElement: T? = null - - override fun hasNext(): Boolean = - when(state) { - 1 -> true // checked and next present - 2 -> false // checked and next not present - else -> { - while(original.hasNext()) { - val candidate = original.next() - if((filter)(candidate)) { - nextElement = candidate - state = 1 - true - } - } - state = 2 - false - } - } - - override fun next(): T = - if(state != 1) - throw java.util.NoSuchElementException() - else { - val res = nextElement as T - nextElement = null - state = 0 - res - } - - override fun remove() { - throw java.lang.UnsupportedOperationException() - } -} diff --git a/k2js/out/production/stdlib/Integer.kt b/k2js/out/production/stdlib/Integer.kt deleted file mode 100644 index 1010327414d..00000000000 --- a/k2js/out/production/stdlib/Integer.kt +++ /dev/null @@ -1,18 +0,0 @@ -package std - -inline fun Int.times(body : () -> Unit) { - var count = this; - while (count > 0) { - body() - count-- - } -} - -inline fun parseInt(str : String) : Int? { - try { - return Integer.parseInt(str).sure(); - } - catch (e : NumberFormatException) { - return null; - } -} diff --git a/k2js/out/production/stdlib/Iterators.kt b/k2js/out/production/stdlib/Iterators.kt deleted file mode 100644 index 7b3087e952e..00000000000 --- a/k2js/out/production/stdlib/Iterators.kt +++ /dev/null @@ -1,38 +0,0 @@ -package std.util - -import java.util.* -import java.util.Iterator - -/* -Add iterated elements to given container -*/ -fun > java.util.Iterator.to(container: U) : U { - while(hasNext()) - container.add(next()) - return container -} - -/* -Add iterated elements to java.util.ArrayList -*/ -inline fun java.util.Iterator.toArrayList() = to(ArrayList()) - -/* -Add iterated elements to java.util.LinkedList -*/ -inline fun java.util.Iterator.toLinkedList() = to(LinkedList()) - -/* -Add iterated elements to java.util.HashSet -*/ -inline fun java.util.Iterator.toHashSet() = to(HashSet()) - -/* -Add iterated elements to java.util.LinkedHashSet -*/ -inline fun java.util.Iterator.toLinkedHashSet() = to(LinkedHashSet()) - -/* -Add iterated elements to java.util.TreeSet -*/ -inline fun java.util.Iterator.toTreeSet() = to(TreeSet()) diff --git a/k2js/out/production/stdlib/JavaCollections.kt b/k2js/out/production/stdlib/JavaCollections.kt deleted file mode 100644 index d788529d489..00000000000 --- a/k2js/out/production/stdlib/JavaCollections.kt +++ /dev/null @@ -1,10 +0,0 @@ -package std.util - -import java.util.* - -/** Returns a new collection containing the results of applying the given function to each element in this collection */ -inline fun java.util.Collection.map(result: Collection = ArrayList(this.size), transform : (T) -> R) : Collection { - for (item in this) - result.add(transform(item)) - return result -} diff --git a/k2js/out/production/stdlib/JavaIo.kt b/k2js/out/production/stdlib/JavaIo.kt deleted file mode 100644 index 5897db01e3f..00000000000 --- a/k2js/out/production/stdlib/JavaIo.kt +++ /dev/null @@ -1,171 +0,0 @@ -package std.io - -import java.io.* -import java.nio.charset.* -import java.util.NoSuchElementException - -inline fun print(message : Any?) { System.out?.print(message) } -inline fun print(message : Int) { System.out?.print(message) } -inline fun print(message : Long) { System.out?.print(message) } -inline fun print(message : Byte) { System.out?.print(message) } -inline fun print(message : Short) { System.out?.print(message) } -inline fun print(message : Char) { System.out?.print(message) } -inline fun print(message : Boolean) { System.out?.print(message) } -inline fun print(message : Float) { System.out?.print(message) } -inline fun print(message : Double) { System.out?.print(message) } -inline fun print(message : CharArray) { System.out?.print(message) } - -inline fun println(message : Any?) { System.out?.println(message) } -inline fun println(message : Int) { System.out?.println(message) } -inline fun println(message : Long) { System.out?.println(message) } -inline fun println(message : Byte) { System.out?.println(message) } -inline fun println(message : Short) { System.out?.println(message) } -inline fun println(message : Char) { System.out?.println(message) } -inline fun println(message : Boolean) { System.out?.println(message) } -inline fun println(message : Float) { System.out?.println(message) } -inline fun println(message : Double) { System.out?.println(message) } -inline fun println(message : CharArray) { System.out?.println(message) } -inline fun println() { System.out?.println() } - -private val stdin : BufferedReader = BufferedReader(InputStreamReader(object : InputStream() { - override fun read() : Int { - return System.`in`?.read() ?: -1 - } - - override fun reset() { - System.`in`?.reset() - } - - override fun read(b: ByteArray?): Int { - return System.`in`?.read(b) ?: -1 - } - - override fun close() { - System.`in`?.close() - } - - override fun mark(readlimit: Int) { - System.`in`?.mark(readlimit) - } - - override fun skip(n: Long): Long { - return System.`in`?.skip(n) ?: -1.lng - } - - override fun available(): Int { - return System.`in`?.available() ?: 0 - } - - override fun markSupported(): Boolean { - return System.`in`?.markSupported() ?: false - } - - override fun read(b: ByteArray?, off: Int, len: Int): Int { - return System.`in`?.read(b, off, len) ?: -1 - } -})) - -inline fun readLine() : String? = stdin.readLine() - -/** Uses the given resource then closes it to ensure its closed again */ -inline fun T.foreach(block: (T)-> R) : R { - var closed = false - try { - return block(this) - } catch (e: Exception) { - closed = true - try { - this.close() - } catch (closeException: Exception) { - // eat the closeException as we are already throwing the original cause - // and we don't want to mask the real exception - - // TODO on Java 7 we should call - // e.addSuppressed(closeException) - // to work like try-with-resources - // http://docs.oracle.com/javase/tutorial/essential/exceptions/tryResourceClose.html#suppressed-exceptions - } - throw e - } finally { - if (!closed) { - this.close() - } - } -} - -fun InputStream.iterator() : ByteIterator = - object: ByteIterator() { - override val hasNext : Boolean - get() = available() > 0 - - override fun nextByte() = read().byt - } - -inline fun InputStream.buffered(bufferSize: Int) = BufferedInputStream(this, bufferSize) - -inline val InputStream.reader : InputStreamReader - get() = InputStreamReader(this) - -inline val InputStream.bufferedReader : BufferedReader - get() = BufferedReader(reader) - -inline fun InputStream.reader(charset: Charset) : InputStreamReader = InputStreamReader(this, charset) - -inline fun InputStream.reader(charsetName: String) = InputStreamReader(this, charsetName) - -inline fun InputStream.reader(charsetDecoder: CharsetDecoder) = InputStreamReader(this, charsetDecoder) - -inline val InputStream.buffered : BufferedInputStream - get() = if(this is BufferedInputStream) this else BufferedInputStream(this) - -// inline val Reader.buffered : BufferedReader -// get() = if(this is BufferedReader) this else BufferedReader(this) - -inline fun Reader.buffered(): BufferedReader = if(this is BufferedReader) this else BufferedReader(this) - -inline fun Reader.buffered(bufferSize: Int) = BufferedReader(this, bufferSize) - -inline fun Reader.foreachLine(block: (String) -> Unit): Unit { - this.foreach{ - val iter = buffered().lineIterator() - while (iter.hasNext) { - val elem = iter.next() - block(elem) - } - } -} - -inline fun Reader.useLines(block: (Iterator) -> T): T = this.buffered().foreach{block(it.lineIterator())} -/** - * Returns an iterator over each line. - * Note the caller must close the underlying BufferedReader - * when the iteration is finished; as the user may not complete the iteration loop (e.g. using a method like find() or any() on the iterator - * may terminate the iteration early. - *
- * We suggest you try the method useLines() instead which closes the stream when the processing is complete. - */ -inline fun BufferedReader.lineIterator() : Iterator = LineIterator(this) - -protected class LineIterator(val reader: BufferedReader) : Iterator { - private var nextValue: String? = null - private var done = false - - override val hasNext: Boolean - get() { - if (nextValue == null && !done) { - nextValue = reader.readLine() - if (nextValue == null) done = true - } - return nextValue != null - } - - override fun next(): String { - if (!hasNext) { - throw NoSuchElementException() - } - val answer = nextValue - nextValue = null - return answer.sure() - } -} - diff --git a/k2js/out/production/stdlib/JavaIterables.kt b/k2js/out/production/stdlib/JavaIterables.kt deleted file mode 100644 index 8815f7e929d..00000000000 --- a/k2js/out/production/stdlib/JavaIterables.kt +++ /dev/null @@ -1,163 +0,0 @@ -package std.util - -import java.util.* - -/** Returns true if any elements in the collection match the given predicate */ -inline fun java.lang.Iterable.any(predicate: (T)-> Boolean) : Boolean { - for (elem in this) { - if (predicate(elem)) { - return true - } - } - return false -} - -/** Returns true if all elements in the collection match the given predicate */ -inline fun java.lang.Iterable.all(predicate: (T)-> Boolean) : Boolean { - for (elem in this) { - if (!predicate(elem)) { - return false - } - } - return true -} - -/** Returns the number of items which match the given predicate */ -inline fun java.lang.Iterable.count(predicate: (T)-> Boolean) : Int { - var answer = 0 - for (elem in this) { - if (predicate(elem)) - answer += 1 - } - return answer -} - -/** Returns the first item in the collection which matches the given predicate or null if none matched */ -inline fun java.lang.Iterable.find(predicate: (T)-> Boolean) : T? { - for (elem in this) { - if (predicate(elem)) - return elem - } - return null -} - -/** Returns a new collection containing all elements in this collection which match the given predicate */ -inline fun java.lang.Iterable.filter(result: Collection = ArrayList(), predicate: (T)-> Boolean) : Collection { - for (elem in this) { - if (predicate(elem)) - result.add(elem) - } - return result -} - -/** Returns a new collection containing all elements in this collection which do not match the given predicate */ -inline fun java.lang.Iterable.filterNot(result: Collection = ArrayList(), predicate: (T)-> Boolean) : Collection { - for (elem in this) { - if (!predicate(elem)) - result.add(elem) - } - return result -} - -/** - * Returns the result of transforming each item in the collection to a one or more values which - * are concatenated together into a single collection - */ -inline fun java.lang.Iterable.flatMap(result: Collection = ArrayList(), transform: (T)-> Collection) : Collection { - for (elem in this) { - val coll = transform(elem) - if (coll != null) { - for (r in coll) { - result.add(r) - } - } - } - return result -} - -/** Performs the given operation on each element inside the collection */ -inline fun java.lang.Iterable.foreach(operation: (element: T) -> Unit) { - for (elem in this) - operation(elem) -} - -/** - * Folds all the values from from left to right with the initial value to perform the operation on sequential pairs of values - * - * For example to sum together all numeric values in a collection of numbers it would be - * {code}val total = numbers.fold(0){(a, b) -> a + b}{code} - */ -inline fun java.lang.Iterable.fold(initial: T, operation: (it: T, it2: T) -> T): T { - var answer = initial - for (elem in this) { - answer = operation(answer, elem) - } - return answer -} - -/** - * Folds all the values from right to left with the initial value to perform the operation on sequential pairs of values - */ -inline fun java.lang.Iterable.foldRight(initial: T, operation: (it: T, it2: T) -> T): T { - val reversed = this.reverse() - return reversed.fold(initial, operation) -} - -/** - * Iterates through the collection performing the transformation on each element and using the result - * as the key in a map to group elements by the result - */ -inline fun java.lang.Iterable.groupBy(result: Map> = HashMap>(), toKey: (T)-> K) : Map> { - for (elem in this) { - val key = toKey(elem) - val list = result.getOrElseUpdate(key){ ArrayList() } - list.add(elem) - } - return result -} - - -/** Creates a String from all the elements in the collection, using the seperator between them and using the given prefix and postfix if supplied */ -inline fun java.lang.Iterable.join(separator: String, prefix: String = "", postfix: String = "") : String { - val buffer = StringBuilder(prefix) - var first = true - for (elem in this) { - if (first) - first = false - else - buffer.append(separator) - buffer.append(elem) - } - buffer.append(postfix) - return buffer.toString().sure() -} - -/** Returns a reversed List of this collection */ -inline fun java.lang.Iterable.reverse() : List { - val answer = LinkedList() - for (elem in this) { - answer.addFirst(elem) - } - return answer -} - -inline fun > java.lang.Iterable.to(result: C) : C { - for (elem in this) - result.add(elem) - return result -} - -inline fun java.lang.Iterable.toLinkedList() : LinkedList = this.to(LinkedList()) - -inline fun java.lang.Iterable.toList() : List = this.to(ArrayList()) - -inline fun java.lang.Iterable.toSet() : Set = this.to(HashSet()) - -/** - TODO figure out necessary variance/generics ninja stuff... :) -inline fun java.lang.Iterable.toSortedList(transform: fun(T) : java.lang.Comparable<*>) : List { - val answer = this.toList() - answer.sort(transform) - return answer -} -*/ diff --git a/k2js/out/production/stdlib/JavaIterablesSpecial.kt b/k2js/out/production/stdlib/JavaIterablesSpecial.kt deleted file mode 100644 index 3a564fabeb8..00000000000 --- a/k2js/out/production/stdlib/JavaIterablesSpecial.kt +++ /dev/null @@ -1,85 +0,0 @@ -package std.util -// Number of extension function for ava.lang.Iterable that shouldn't participate in auto generation - -import java.util.Collection -import java.util.List -import java.util.AbstractList - -/** - * Count the number of elements in collection. - * - * If base collection implements Collection interface method Collection#size() will be used. - * Otherwise, this method determines the count by iterating through the all items. - */ -fun java.lang.Iterable.count() : Int { - if (this is Collection) { - return this.size() - } - - var number : Int = 0 - for (elem in this) { - ++number - } - return number -} - -/** - * Get the first element in the collection. - * - * Will throw an exception if there are no elements - * TODO: Specify type of the exception - */ -inline fun java.lang.Iterable.first() : T { - if (this is AbstractList) { - return this.get(0) - } - - return this.iterator().sure().next() -} - -/** - * Get the last element in the collection. - * - * If base collection implements List interface, the combination of size() and get() - * methods will be used for getting last element. Otherwise, this method determines the - * last item by iterating through the all items. - * - * Will throw an exception if there are no elements. - * TODO: Specify type of the exception - */ -fun java.lang.Iterable.last() : T { - if (this is List) { - return this.get(this.size() - 1); - } - - val iterator = this.iterator().sure() - var last : T = iterator.next() - - while (iterator.hasNext()) { - last = iterator.next() - } - - return last; -} - -/** - * Checks if collection contains given item. - * - * Method checks equality of the objects with T.equals method. - * If collection implements java.util.AbstractCollection an overridden implementation of the contains - * method will be used. - */ -fun java.lang.Iterable.contains(item : T) : Boolean { - std.io.println("!!!!!") - if (this is java.util.AbstractCollection) { - return this.contains(item); - } - - for (var elem in this) { - if (elem.equals(item)) { - return true - } - } - - return false -} diff --git a/k2js/out/production/stdlib/JavaLang.kt b/k2js/out/production/stdlib/JavaLang.kt deleted file mode 100644 index 66009d500cf..00000000000 --- a/k2js/out/production/stdlib/JavaLang.kt +++ /dev/null @@ -1,14 +0,0 @@ -package std - -import java.lang.Class -import java.lang.Object - -val T.javaClass : Class - get() = jet.runtime.Intrinsics.getJavaClass(this) as Class - -fun javaClass() : Class = (typeinfo() as org.jetbrains.jet.rt.TypeInfoImpl).getJavaClass().sure() - -val TypeInfo.javaClassForType : Class - get() { - return (this as org.jetbrains.jet.rt.TypeInfoImpl).getJavaClass().sure() - } diff --git a/k2js/out/production/stdlib/JavaMath.kt b/k2js/out/production/stdlib/JavaMath.kt deleted file mode 100644 index 726ad082f58..00000000000 --- a/k2js/out/production/stdlib/JavaMath.kt +++ /dev/null @@ -1,27 +0,0 @@ -package std.math - -import java.math.BigInteger -import java.math.BigDecimal - -fun BigInteger.plus(other: BigInteger) = this.add(other).sure() - -fun BigInteger.minus(other: BigInteger) = this.subtract(other).sure() - -fun BigInteger.times(other: BigInteger) = this.multiply(other).sure() - -fun BigInteger.div(other: BigInteger) = this.divide(other).sure() - -fun BigInteger.minus() = this.negate().sure() - - -fun BigDecimal.plus(other: BigDecimal) = this.add(other).sure() - -fun BigDecimal.minus(other: BigDecimal) = this.subtract(other).sure() - -fun BigDecimal.times(other: BigDecimal) = this.multiply(other).sure() - -fun BigDecimal.div(other: BigDecimal) = this.divide(other).sure() - -fun BigDecimal.mod(other: BigDecimal) = this.remainder(other).sure() - -fun BigDecimal.minus() = this.negate().sure() \ No newline at end of file diff --git a/k2js/out/production/stdlib/JavaUtil.kt b/k2js/out/production/stdlib/JavaUtil.kt deleted file mode 100644 index 36fc28165ec..00000000000 --- a/k2js/out/production/stdlib/JavaUtil.kt +++ /dev/null @@ -1,86 +0,0 @@ -package std.util - -import java.util.* - -/** Returns the size of the collection */ -val Collection<*>.size : Int - get() = size() - -/** Returns true if this collection is empty */ -val Collection<*>.empty : Boolean - get() = isEmpty() - -/** Returns a new ArrayList with a variable number of initial elements */ -inline fun arrayList(vararg values: T) : ArrayList = values.to(ArrayList(values.size)) - -/** Returns a new LinkedList with a variable number of initial elements */ -inline fun linkedList(vararg values: T) : LinkedList = values.to(LinkedList()) - -/** Returns a new HashSet with a variable number of initial elements */ -inline fun hashSet(vararg values: T) : HashSet = values.to(HashSet(values.size)) - -val Collection<*>.indices : IntRange - get() = 0..size-1 - -inline fun java.util.Collection.toArray() : Array { - val answer = Array(this.size) - var idx = 0 - for (elem in this) - answer[idx++] = elem - return answer as Array -} - -/** TODO these functions don't work when they generate the Array versions when they are in JavaIterables */ -inline fun > java.lang.Iterable.toSortedList() : List = toList().sort() - -inline fun > java.lang.Iterable.toSortedList(comparator: java.util.Comparator) : List = toList().sort(comparator) - - - -// List APIs - -inline fun > List.sort() : List { - Collections.sort(this) - return this -} - -inline fun > List.sort(comparator: java.util.Comparator) : List { - Collections.sort(this, comparator) - return this -} - -/** - TODO figure out necessary variance/generics ninja stuff... :) -inline fun List.sort(transform: fun(T) : java.lang.Comparable<*>) : List { - val comparator = java.util.Comparator() { - fun compare(o1: T, o2: T): Int { - val v1 = transform(o1) - val v2 = transform(o2) - if (v1 == v2) { - return 0 - } else { - return v1.compareTo(v2) - } - } - } - answer.sort(comparator) -} -*/ - -val List.head : T? - get() = this.get(0) - -val List.first : T? - get() = this.head - -val List.tail : T? - get() { - val s = this.size - return if (s > 0) this.get(s - 1) else null - } - -val List.last : T? - get() = this.tail - - - diff --git a/k2js/out/production/stdlib/JavaUtilMap.kt b/k2js/out/production/stdlib/JavaUtilMap.kt deleted file mode 100644 index cafdafc967d..00000000000 --- a/k2js/out/production/stdlib/JavaUtilMap.kt +++ /dev/null @@ -1,52 +0,0 @@ -package std.util - -import java.util.Map as JMap - -// Temporary workaround: commenting out -//import java.util.Map.Entry as JEntry - -// Map APIs - -/** Returns the size of the map */ -val JMap<*,*>.size : Int - get() = size() - -/** Returns true if this map is empty */ -val JMap<*,*>.empty : Boolean - get() = isEmpty() - -/** Provides [] access to maps */ -fun JMap.set(key : K, value : V) = this.put(key, value) - - -/** Returns the key of the entry */ -// Temporary workaround: commenting out -//val JEntry.key : K -// get() = getKey().sure() - -/** Returns the value of the entry */ -// Temporary workaround: commenting out -//val JEntry.value : V -// get() = getValue().sure() - -/** Returns the value for the given key or returns the result of the defaultValue function if there was no entry for the given key */ -inline fun java.util.Map.getOrElse(key: K, defaultValue: ()-> V) : V { - val current = this.get(key) - if (current != null) { - return current - } else { - return defaultValue() - } -} - -/** Returns the value for the given key or the result of the defaultValue function is put into the map for the given value and returned */ -inline fun java.util.Map.getOrElseUpdate(key: K, defaultValue: ()-> V) : V { - val current = this.get(key) - if (current != null) { - return current - } else { - val answer = defaultValue() - this.put(key, answer) - return answer - } -} diff --git a/k2js/out/production/stdlib/Standard.kt b/k2js/out/production/stdlib/Standard.kt deleted file mode 100644 index bcbd9db2ac1..00000000000 --- a/k2js/out/production/stdlib/Standard.kt +++ /dev/null @@ -1,71 +0,0 @@ -package std - -import java.util.Collection -import java.util.ArrayList -import java.util.LinkedList -import java.util.HashSet -import java.util.LinkedHashSet -import java.util.TreeSet - -/* -Helper to make jet.Iterator usable in for -*/ -inline fun jet.Iterator.iterator() = this - -/* -Helper to make java.util.Iterator usable in for -*/ -inline fun java.util.Iterator.iterator() = this - -/* -Helper to make java.util.Enumeration usable in for -*/ -fun java.util.Enumeration.iterator(): Iterator = object: Iterator { - override val hasNext: Boolean - get() = hasMoreElements() - - override fun next() = nextElement() -} - -/* - * Extension functions on the standard Kotlin types to behave like the java.lang.* and java.util.* collections - */ - -/* -Add iterated elements to given container -*/ -fun > Iterator.to(container: U) : U { - while(hasNext) - container.add(next()) - return container -} - -/* -Add iterated elements to java.util.ArrayList -*/ -inline fun Iterator.toArrayList() = to(ArrayList()) - -/* -Add iterated elements to java.util.LinkedList -*/ -inline fun Iterator.toLinkedList() = to(LinkedList()) - -/* -Add iterated elements to java.util.HashSet -*/ -inline fun Iterator.toHashSet() = to(HashSet()) - -/* -Add iterated elements to java.util.LinkedHashSet -*/ -inline fun Iterator.toLinkedHashSet() = to(LinkedHashSet()) - -/* -Add iterated elements to java.util.TreeSet -*/ -inline fun Iterator.toTreeSet() = to(TreeSet()) - -/* -Run function f -*/ -inline fun run(f: () -> T) = f() diff --git a/k2js/out/production/stdlib/String.kt b/k2js/out/production/stdlib/String.kt deleted file mode 100644 index e756e338ff4..00000000000 --- a/k2js/out/production/stdlib/String.kt +++ /dev/null @@ -1,83 +0,0 @@ -package std - -import java.io.StringReader - -inline fun String.lastIndexOf(s: String) = (this as java.lang.String).lastIndexOf(s) - -inline fun String.lastIndexOf(s: Char) = (this as java.lang.String).lastIndexOf(s.toString()) - -inline fun String.equalsIgnoreCase(s: String) = (this as java.lang.String).equalsIgnoreCase(s) - -inline fun String.indexOf(s : String) = (this as java.lang.String).indexOf(s) - -inline fun String.indexOf(p0 : String, p1 : Int) = (this as java.lang.String).indexOf(p0, p1) - -inline fun String.replace(s: Char, s1 : Char) = (this as java.lang.String).replace(s, s1).sure() - -inline fun String.replaceAll(s: String, s1 : String) = (this as java.lang.String).replaceAll(s, s1).sure() - -inline fun String.trim() = (this as java.lang.String).trim().sure() - -inline fun String.toUpperCase() = (this as java.lang.String).toUpperCase().sure() - -inline fun String.toLowerCase() = (this as java.lang.String).toLowerCase().sure() - -inline fun String.length() = (this as java.lang.String).length() - -inline fun String.getBytes() = (this as java.lang.String).getBytes().sure() - -inline fun String.toCharArray() = (this as java.lang.String).toCharArray().sure() - -inline fun String.format(s : String, vararg objects : Any?) = java.lang.String.format(s, objects).sure() - -inline fun String.split(s : String) = (this as java.lang.String).split(s) - -inline fun String.substring(i : Int) = (this as java.lang.String).substring(i).sure() - -inline fun String.substring(i0 : Int, i1 : Int) = (this as java.lang.String).substring(i0, i1).sure() - -inline fun String.startsWith(prefix: String) = (this as java.lang.String).startsWith(prefix) - -inline fun String.startsWith(prefix: String, toffset: Int) = (this as java.lang.String).startsWith(prefix, toffset) - -inline fun String.contains(seq: CharSequence) : Boolean = (this as java.lang.String).contains(seq) - -inline fun String.endsWith(seq: String) : Boolean = (this as java.lang.String).endsWith(seq) - -inline val String.size : Int - get() = length() - -inline val String.reader : StringReader - get() = StringReader(this) - -// "constructors" for String - -inline fun String(bytes : ByteArray, i : Int, i1 : Int, s : String) = java.lang.String(bytes, i, i1, s) as String - -inline fun String(bytes : ByteArray, i : Int, i1 : Int, charset : java.nio.charset.Charset) = java.lang.String(bytes, i, i1, charset) as String - -inline fun String(bytes : ByteArray, s : String?) = java.lang.String(bytes, s) as String - -inline fun String(bytes : ByteArray, charset : java.nio.charset.Charset) = java.lang.String(bytes, charset) as String - -inline fun String(bytes : ByteArray, i : Int, i1 : Int) = java.lang.String(bytes, i, i1) as String - -inline fun String(bytes : ByteArray) = java.lang.String(bytes) as String - -inline fun String(chars : CharArray) = java.lang.String(chars) as String - -inline fun String(stringBuffer : java.lang.StringBuffer) = java.lang.String(stringBuffer) as String - -inline fun String(stringBuilder : java.lang.StringBuilder) = java.lang.String(stringBuilder) as String - -/* -Iterator for characters of given CharSequence -*/ -inline fun CharSequence.iterator() : CharIterator = object: jet.CharIterator() { - private var index = 0 - - public override fun nextChar(): Char = get(index++) - - public override val hasNext: Boolean - get() = index < length -} diff --git a/k2js/out/production/stdlib/System.kt b/k2js/out/production/stdlib/System.kt deleted file mode 100644 index bd761eac5fe..00000000000 --- a/k2js/out/production/stdlib/System.kt +++ /dev/null @@ -1,19 +0,0 @@ -package std.util - -/** -Executes current block and returns elapsed time in milliseconds -*/ -fun measureTimeMillis(block: () -> Unit) : Long { - val start = System.currentTimeMillis() - block() - return System.currentTimeMillis() - start -} - -/** -Executes current block and returns elapsed time in nanoseconds -*/ -fun measureTimeNano(block: () -> Unit) : Long { - val start = System.nanoTime() - block() - return System.nanoTime() - start -} diff --git a/k2js/out/production/stdlib/concurrent/FunctionalList.kt b/k2js/out/production/stdlib/concurrent/FunctionalList.kt deleted file mode 100644 index d3b4f2cd1ff..00000000000 --- a/k2js/out/production/stdlib/concurrent/FunctionalList.kt +++ /dev/null @@ -1,57 +0,0 @@ -package std.concurrent - -abstract class FunctionalList(public val size: Int) { - public abstract val head: T - public abstract val tail: FunctionalList - - val empty : Boolean - get() = size == 0 - - fun add(element: T) : FunctionalList = FunctionalList.Standard(element, this) - - fun reversed() : FunctionalList { - if(empty) - return this - - var cur = tail - var new = of(head) - - while(!cur.empty) { - new = new.add(cur.head) - cur = cur.tail - } - return new - } - - fun iterator() = object: Iterator { - var cur = this@FunctionalList - - override fun next(): T { - if(cur.empty) - throw java.util.NoSuchElementException() - - val head = cur.head - cur = cur.tail - return head - } - - override val hasNext: Boolean - get() = !cur.empty - } - - class object { - class Empty() : FunctionalList(0) { - override val head: T - get() = throw java.util.NoSuchElementException() - override val tail: FunctionalList - get() = throw java.util.NoSuchElementException() - } - - class Standard(override val head: T, override val tail: FunctionalList) : FunctionalList(tail.size+1) - - fun emptyList() = Empty() - - fun of(element: T) : FunctionalList = FunctionalList.Standard(element,emptyList()) - } -} - diff --git a/k2js/out/production/stdlib/concurrent/FunctionalQueue.kt b/k2js/out/production/stdlib/concurrent/FunctionalQueue.kt deleted file mode 100644 index 3dc6ee83303..00000000000 --- a/k2js/out/production/stdlib/concurrent/FunctionalQueue.kt +++ /dev/null @@ -1,30 +0,0 @@ -package std.concurrent - -import java.util.concurrent.Executor -import jet.Iterator - -class FunctionalQueue ( - val input: FunctionalList = FunctionalList.emptyList(), - val output: FunctionalList = FunctionalList.emptyList()) { - - val size : Int - get() = input.size + output.size - - val empty : Boolean - get() = size == 0 - - fun add(element: T) = FunctionalQueue(input add element, output) - - fun addFirst(element: T) = FunctionalQueue(input, output add element) - - fun removeFirst() : #(T,FunctionalQueue) = - if(output.empty) { - if(input.empty) - throw java.util.NoSuchElementException() - else - FunctionalQueue(FunctionalList.emptyList(), input.reversed()).removeFirst() - } - else { - #(output.head, FunctionalQueue(input, output.tail)) - } -} diff --git a/k2js/out/production/stdlib/concurrent/Locks.kt b/k2js/out/production/stdlib/concurrent/Locks.kt deleted file mode 100644 index 54a5126f751..00000000000 --- a/k2js/out/production/stdlib/concurrent/Locks.kt +++ /dev/null @@ -1,58 +0,0 @@ -package std.concurrent - -import java.util.concurrent.locks.Lock -import java.util.concurrent.locks.ReadWriteLock -import java.util.concurrent.locks.ReentrantReadWriteLock -import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock - -/* -Executes given calculation under lock -Returns result of the calculation -*/ -inline fun Lock.withLock(action: ()->T) : T { - lock() - try { - return action() - } - finally { - unlock(); - } -} - -/* -Executes given calculation under read lock -Returns result of the calculation -*/ -inline fun ReentrantReadWriteLock.read(action: ()->T) : T { - val rl = readLock().sure() - rl.lock() - try { - return action() - } - finally { - rl.unlock() - } -} - -/* -Executes given calculation under write lock. -The method does upgrade from read to write lock if needed -If such write has been initiated by checking some condition, the condition must be rechecked inside the action to avoid possible races -Returns result of the calculation -*/ -inline fun ReentrantReadWriteLock.write(action: ()->T) : T { - val rl = readLock().sure() - - val readCount = if (getWriteHoldCount() == 0) getReadHoldCount() else 0 - readCount times { rl.unlock() } - - val wl = writeLock().sure() - wl.lock() - try { - return action() - } - finally { - readCount times { rl.lock() } - wl.unlock() - } -} diff --git a/k2js/out/production/stdlib/concurrent/Thread.kt b/k2js/out/production/stdlib/concurrent/Thread.kt deleted file mode 100644 index a6ecf1eaee3..00000000000 --- a/k2js/out/production/stdlib/concurrent/Thread.kt +++ /dev/null @@ -1,53 +0,0 @@ -package std.concurrent - -import java.lang.* -import java.util.concurrent.Executor - -inline val currentThread : Thread - get() = Thread.currentThread().sure() - -inline var Thread.name : String - get() = getName().sure() - set(name: String) { setName(name) } - -inline var Thread.daemon : Boolean - get() = isDaemon() - set(on: Boolean) { setDaemon(on) } - -inline val Thread.alive : Boolean - get() = isAlive() - -inline var Thread.priority : Int - get() = getPriority() - set(prio: Int) { setPriority(prio) } - -inline var Thread.contextClassLoader : ClassLoader? - get() = getContextClassLoader() - set(loader: ClassLoader?) { setContextClassLoader(loader) } - -fun thread(start: Boolean = true, daemon: Boolean = false, contextClassLoader: ClassLoader? = null, name: String? = null, priority: Int = -1, block: ()->Unit) : Thread { - val thread = object: Thread() { - override fun run() { - block() - } - } - if(daemon) - thread.setDaemon(true) - if(priority > 0) - thread.setPriority(priority) - if(name != null) - thread.setName(name) - if(contextClassLoader != null) - thread.setContextClassLoader(contextClassLoader) - if(start) - thread.start() - return thread -} - -inline fun Executor.execute(action: ()->Unit) { - execute(object: Runnable{ - override fun run() { - action() - } - }) -} diff --git a/k2js/out/production/stdlib/concurrent/Timer.kt b/k2js/out/production/stdlib/concurrent/Timer.kt deleted file mode 100644 index 5278efcba4d..00000000000 --- a/k2js/out/production/stdlib/concurrent/Timer.kt +++ /dev/null @@ -1,71 +0,0 @@ -package std.concurrent - -import java.util.Timer -import java.util.TimerTask -import java.util.Date - -fun Timer.schedule(delay: Long, action: TimerTask.()->Unit) : TimerTask { - val task = createTask(action) - schedule(task, delay) - return task -} - -fun Timer.schedule(time: Date, action: TimerTask.()->Unit) : TimerTask { - val task = createTask(action) - schedule(task, time) - return task -} - -fun Timer.schedule(delay: Long, period: Long, action: TimerTask.()->Unit) : TimerTask { - val task = createTask(action) - schedule(task, delay, period) - return task -} - -fun Timer.schedule(time: Date, period: Long, action: TimerTask.()->Unit) : TimerTask { - val task = createTask(action) - schedule(task, time, period) - return task -} - -fun Timer.scheduleAtFixedRate(delay: Long, period: Long, action: TimerTask.()->Unit) : TimerTask { - val task = createTask(action) - scheduleAtFixedRate(task, delay, period) - return task -} - -fun Timer.scheduleAtFixedRate(time: Date, period: Long, action: TimerTask.()->Unit) : TimerTask { - val task = createTask(action) - scheduleAtFixedRate(task, time, period) - return task -} - -fun timer(name: String? = null, daemon: Boolean = false, initialDelay: Long = 0.lng, period: Long, action: TimerTask.()->Unit) : Timer { - val timer = if(name == null) Timer(daemon) else Timer(name, daemon) - timer.schedule(initialDelay, period, action) - return timer -} - -fun timer(name: String? = null, daemon: Boolean = false, startAt: Date, period: Long, action: TimerTask.()->Unit) : Timer { - val timer = if(name == null) Timer(daemon) else Timer(name, daemon) - timer.schedule(startAt, period, action) - return timer -} - -fun fixedRateTimer(name: String? = null, daemon: Boolean = false, initialDelay: Long = 0.lng, period: Long, action: TimerTask.()->Unit) : Timer { - val timer = if(name == null) Timer(daemon) else Timer(name, daemon) - timer.scheduleAtFixedRate(initialDelay, period, action) - return timer -} - -fun fixedRateTimer(name: String? = null, daemon: Boolean = false, startAt: Date, period : Long, action: TimerTask.()->Unit) : Timer { - val timer = if(name == null) Timer(daemon) else Timer(name, daemon) - timer.scheduleAtFixedRate(startAt, period, action) - return timer -} - -private fun createTask(action: TimerTask.()->Unit) : TimerTask = object: TimerTask() { - override fun run() { - action() - } -} \ No newline at end of file diff --git a/k2js/out/production/stdlib/dom/Dom.kt b/k2js/out/production/stdlib/dom/Dom.kt deleted file mode 100644 index 268d58d4a2a..00000000000 --- a/k2js/out/production/stdlib/dom/Dom.kt +++ /dev/null @@ -1,104 +0,0 @@ -package std.dom - -import std.* -import org.w3c.dom.* - - -// Properties - -var Element.id : String -get() = this.getAttribute("id")?: "" -set(value) { - this.setAttribute("id", value) -} - -var Element.style : String -get() = this.getAttribute("style")?: "" -set(value) { - this.setAttribute("style", value) -} - -// TODO can we come up with a better name; 'class' is a reserved word? -var Element.cssClass : String -get() = this.getAttribute("class")?: "" -set(value) { - this.setAttribute("class", value) -} - -// Syntax sugar - -inline fun Node.plus(child: Node?): Node { - if (child != null) { - this.appendChild(child) - } - return this -} - -inline fun Element.plus(text: String?): Element = this.addText(text) - -inline fun Element.plusAssign(text: String?): Element = this.addText(text) - - -// Builder - -/* -Creates a new element which can be configured via a function -*/ -fun Document.createElement(name: String, init: Element.()-> Unit): Element { - val elem = this.createElement(name).sure() - elem.init() - return elem -} - -/* -Creates a new element to an element which has an owner Document which can be configured via a function -*/ -fun Element.createElement(name: String, doc: Document? = null, init: Element.()-> Unit): Element { - val elem = ownerDocument(doc).createElement(name).sure() - elem.init() - return elem -} - -/* -Returns the owner document of the element or uses the provided document -*/ -fun Node.ownerDocument(doc: Document? = null): Document { - val answer = if (this is Document) this as Document - else if (doc == null) this.getOwnerDocument() - else doc - - if (answer == null) { - throw IllegalArgumentException("Element does not have an ownerDocument and none was provided for: ${this}") - } else { - return answer - } -} - -/* -Adds a newly created element which can be configured via a function -*/ -fun Document.addElement(name: String, init: Element.()-> Unit): Element { - val child = createElement(name, init) - this.appendChild(child) - return child -} - -/* -Adds a newly created element to an element which has an owner Document which can be configured via a function -*/ -fun Element.addElement(name: String, doc: Document? = null, init: Element.()-> Unit): Element { - val child = createElement(name, doc, init) - this.appendChild(child) - return child -} - -/* -Adds a newly created text node to an element which either already has an owner Document or one must be provided as a parameter -*/ -fun Element.addText(text: String?, doc: Document? = null): Element { - if (text != null) { - val child = ownerDocument(doc).createTextNode(text) - this.appendChild(child) - } - return this -} diff --git a/k2js/out/production/stdlib/dom/DomJVM.kt b/k2js/out/production/stdlib/dom/DomJVM.kt deleted file mode 100644 index f281b56f358..00000000000 --- a/k2js/out/production/stdlib/dom/DomJVM.kt +++ /dev/null @@ -1,53 +0,0 @@ -/** - * JVM specific API implementations using JAXB and so forth which would not be used when compiling to JS - */ -package std.dom - -import org.w3c.dom.* -import javax.xml.parsers.DocumentBuilder -import javax.xml.parsers.DocumentBuilderFactory -import javax.xml.transform.Transformer -import javax.xml.transform.TransformerFactory -import javax.xml.transform.Source -import javax.xml.transform.dom.DOMSource -import javax.xml.transform.stream.StreamResult - -import java.io.StringWriter -import javax.xml.transform.OutputKeys - -fun createDocument(builder: DocumentBuilder): Document { - return builder.newDocument().sure() -} - -fun createDocument(builderFactory: DocumentBuilderFactory = DocumentBuilderFactory.newInstance().sure()): Document { - return createDocument(builderFactory.newDocumentBuilder().sure()) -} - -fun createTransformer(source: Source? = null, factory: TransformerFactory = TransformerFactory.newInstance().sure()): Transformer { - val transformer = if (source != null) { - factory.newTransformer(source) - } else { - factory.newTransformer() - } - return transformer.sure() -} - -fun Node.toXmlString(xmlDeclaration: Boolean = this is Document): String { - return nodeToXmlString(this, xmlDeclaration) -} - -/* -fun Document.toXmlString(xmlDeclaration: Boolean = true): String { - return nodeToXmlString(this, xmlDeclaration) -} -*/ - -fun nodeToXmlString(node: Node, xmlDeclaration: Boolean): String { - val transformer = createTransformer() - transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, if (xmlDeclaration) "no" else "yes") - val buffer = StringWriter() - transformer.transform(DOMSource(node), StreamResult(buffer)) - return buffer.toString().sure() - -} - diff --git a/k2js/out/production/stdlib/generated/ArraysFromJavaCollections.kt b/k2js/out/production/stdlib/generated/ArraysFromJavaCollections.kt deleted file mode 100644 index 12db122013e..00000000000 --- a/k2js/out/production/stdlib/generated/ArraysFromJavaCollections.kt +++ /dev/null @@ -1,11 +0,0 @@ -// NOTE this file is auto-generated from stdlib/ktSrc/JavaCollections.kt -package std - -import java.util.* - -/** Returns a new collection containing the results of applying the given function to each element in this collection */ -inline fun Array.map(result: Collection = ArrayList(this.size), transform : (T) -> R) : Collection { - for (item in this) - result.add(transform(item)) - return result -} diff --git a/k2js/out/production/stdlib/generated/ArraysFromJavaIterables.kt b/k2js/out/production/stdlib/generated/ArraysFromJavaIterables.kt deleted file mode 100644 index 9794644f7d7..00000000000 --- a/k2js/out/production/stdlib/generated/ArraysFromJavaIterables.kt +++ /dev/null @@ -1,109 +0,0 @@ -// NOTE this file is auto-generated from stdlib/ktSrc/JavaIterables.kt -package std - -import java.util.* - -/** Returns true if any elements in the collection match the given predicate */ -inline fun Array.any(predicate: (T)-> Boolean) : Boolean { - for (elem in this) { - if (predicate(elem)) { - return true - } - } - return false -} - -/** Returns true if all elements in the collection match the given predicate */ -inline fun Array.all(predicate: (T)-> Boolean) : Boolean { - for (elem in this) { - if (!predicate(elem)) { - return false - } - } - return true -} - -/** Returns the first item in the collection which matches the given predicate or null if none matched */ -inline fun Array.find(predicate: (T)-> Boolean) : T? { - for (elem in this) { - if (predicate(elem)) - return elem - } - return null -} - -/** Returns a new collection containing all elements in this collection which match the given predicate */ -inline fun Array.filter(result: Collection = ArrayList(), predicate: (T)-> Boolean) : Collection { - for (elem in this) { - if (predicate(elem)) - result.add(elem) - } - return result -} - -/** Returns a new collection containing all elements in this collection which do not match the given predicate */ -inline fun Array.filterNot(result: Collection = ArrayList(), predicate: (T)-> Boolean) : Collection { - for (elem in this) { - if (!predicate(elem)) - result.add(elem) - } - return result -} - -/** - * Returns the result of transforming each item in the collection to a one or more values which - * are concatenated together into a single collection - */ -inline fun Array.flatMap(result: Collection = ArrayList(), transform: (T)-> Collection) : Collection { - for (elem in this) { - val coll = transform(elem) - if (coll != null) { - for (r in coll) { - result.add(r) - } - } - } - return result -} - -/** Performs the given operation on each element inside the collection */ -inline fun Array.foreach(operation: (element: T) -> Unit) { - for (elem in this) - operation(elem) -} - -/** Creates a String from all the elements in the collection, using the seperator between them and using the given prefix and postfix if supplied */ -inline fun Array.join(separator: String, prefix: String = "", postfix: String = "") : String { - val buffer = StringBuilder(prefix) - var first = true - for (elem in this) { - if (first) - first = false - else - buffer.append(separator) - buffer.append(elem) - } - buffer.append(postfix) - return buffer.toString().sure() -} - -inline fun > Array.to(result: C) : C { - for (elem in this) - result.add(elem) - return result -} - -inline fun Array.toLinkedList() : LinkedList = this.to(LinkedList()) - -inline fun Array.toList() : List = this.to(ArrayList()) - -inline fun Array.toSet() : Set = this.to(HashSet()) - -/** - TODO figure out necessary variance/generics ninja stuff... :) -inline fun Array.toSortedList(transform: fun(T) : java.lang.Comparable<*>) : List { - val answer = this.toList() - answer.sort(transform) - return answer -} -*/ diff --git a/k2js/out/production/stdlib/generated/JavaUtilIterablesFromJavaCollections.kt b/k2js/out/production/stdlib/generated/JavaUtilIterablesFromJavaCollections.kt deleted file mode 100644 index e4592189fca..00000000000 --- a/k2js/out/production/stdlib/generated/JavaUtilIterablesFromJavaCollections.kt +++ /dev/null @@ -1,11 +0,0 @@ -// NOTE this file is auto-generated from stdlib/ktSrc/JavaCollections.kt -package std.util - -import java.util.* - -/** Returns a new collection containing the results of applying the given function to each element in this collection */ -inline fun java.lang.Iterable.map(result: Collection = ArrayList(), transform : (T) -> R) : Collection { - for (item in this) - result.add(transform(item)) - return result -} diff --git a/k2js/out/production/stdlib/generated/StandardFromJavaCollections.kt b/k2js/out/production/stdlib/generated/StandardFromJavaCollections.kt deleted file mode 100644 index e94ec1d52d3..00000000000 --- a/k2js/out/production/stdlib/generated/StandardFromJavaCollections.kt +++ /dev/null @@ -1,11 +0,0 @@ -// NOTE this file is auto-generated from stdlib/ktSrc/JavaCollections.kt -package std - -import java.util.* - -/** Returns a new collection containing the results of applying the given function to each element in this collection */ -inline fun Iterable.map(result: Collection = ArrayList(), transform : (T) -> R) : Collection { - for (item in this) - result.add(transform(item)) - return result -} diff --git a/k2js/out/production/stdlib/generated/StandardFromJavaIterables.kt b/k2js/out/production/stdlib/generated/StandardFromJavaIterables.kt deleted file mode 100644 index 00a566350ec..00000000000 --- a/k2js/out/production/stdlib/generated/StandardFromJavaIterables.kt +++ /dev/null @@ -1,109 +0,0 @@ -// NOTE this file is auto-generated from stdlib/ktSrc/JavaIterables.kt -package std - -import java.util.* - -/** Returns true if any elements in the collection match the given predicate */ -inline fun Iterable.any(predicate: (T)-> Boolean) : Boolean { - for (elem in this) { - if (predicate(elem)) { - return true - } - } - return false -} - -/** Returns true if all elements in the collection match the given predicate */ -inline fun Iterable.all(predicate: (T)-> Boolean) : Boolean { - for (elem in this) { - if (!predicate(elem)) { - return false - } - } - return true -} - -/** Returns the first item in the collection which matches the given predicate or null if none matched */ -inline fun Iterable.find(predicate: (T)-> Boolean) : T? { - for (elem in this) { - if (predicate(elem)) - return elem - } - return null -} - -/** Returns a new collection containing all elements in this collection which match the given predicate */ -inline fun Iterable.filter(result: Collection = ArrayList(), predicate: (T)-> Boolean) : Collection { - for (elem in this) { - if (predicate(elem)) - result.add(elem) - } - return result -} - -/** Returns a new collection containing all elements in this collection which do not match the given predicate */ -inline fun Iterable.filterNot(result: Collection = ArrayList(), predicate: (T)-> Boolean) : Collection { - for (elem in this) { - if (!predicate(elem)) - result.add(elem) - } - return result -} - -/** - * Returns the result of transforming each item in the collection to a one or more values which - * are concatenated together into a single collection - */ -inline fun Iterable.flatMap(result: Collection = ArrayList(), transform: (T)-> Collection) : Collection { - for (elem in this) { - val coll = transform(elem) - if (coll != null) { - for (r in coll) { - result.add(r) - } - } - } - return result -} - -/** Performs the given operation on each element inside the collection */ -inline fun Iterable.foreach(operation: (element: T) -> Unit) { - for (elem in this) - operation(elem) -} - -/** Creates a String from all the elements in the collection, using the seperator between them and using the given prefix and postfix if supplied */ -inline fun Iterable.join(separator: String, prefix: String = "", postfix: String = "") : String { - val buffer = StringBuilder(prefix) - var first = true - for (elem in this) { - if (first) - first = false - else - buffer.append(separator) - buffer.append(elem) - } - buffer.append(postfix) - return buffer.toString().sure() -} - -inline fun > Iterable.to(result: C) : C { - for (elem in this) - result.add(elem) - return result -} - -inline fun Iterable.toLinkedList() : LinkedList = this.to(LinkedList()) - -inline fun Iterable.toList() : List = this.to(ArrayList()) - -inline fun Iterable.toSet() : Set = this.to(HashSet()) - -/** - TODO figure out necessary variance/generics ninja stuff... :) -inline fun Iterable.toSortedList(transform: fun(T) : java.lang.Comparable<*>) : List { - val answer = this.toList() - answer.sort(transform) - return answer -} -*/ diff --git a/k2js/out/production/stdlib/jet/BooleanIterable.class b/k2js/out/production/stdlib/jet/BooleanIterable.class deleted file mode 100644 index 0bbaeeb5f9f..00000000000 Binary files a/k2js/out/production/stdlib/jet/BooleanIterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/BooleanIterator.class b/k2js/out/production/stdlib/jet/BooleanIterator.class deleted file mode 100644 index e5de89abd5f..00000000000 Binary files a/k2js/out/production/stdlib/jet/BooleanIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ByteIterable.class b/k2js/out/production/stdlib/jet/ByteIterable.class deleted file mode 100644 index 4c843f9f0d7..00000000000 Binary files a/k2js/out/production/stdlib/jet/ByteIterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ByteIterator.class b/k2js/out/production/stdlib/jet/ByteIterator.class deleted file mode 100644 index 54942895d46..00000000000 Binary files a/k2js/out/production/stdlib/jet/ByteIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ByteRange$MyIterator.class b/k2js/out/production/stdlib/jet/ByteRange$MyIterator.class deleted file mode 100644 index fc68f40d2c3..00000000000 Binary files a/k2js/out/production/stdlib/jet/ByteRange$MyIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ByteRange.class b/k2js/out/production/stdlib/jet/ByteRange.class deleted file mode 100644 index 83499e05605..00000000000 Binary files a/k2js/out/production/stdlib/jet/ByteRange.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/CharIterable.class b/k2js/out/production/stdlib/jet/CharIterable.class deleted file mode 100644 index 4a0ffdeacf3..00000000000 Binary files a/k2js/out/production/stdlib/jet/CharIterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/CharIterator.class b/k2js/out/production/stdlib/jet/CharIterator.class deleted file mode 100644 index 1ce7eaf9187..00000000000 Binary files a/k2js/out/production/stdlib/jet/CharIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/CharRange$MyIterator.class b/k2js/out/production/stdlib/jet/CharRange$MyIterator.class deleted file mode 100644 index 8f379f69d27..00000000000 Binary files a/k2js/out/production/stdlib/jet/CharRange$MyIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/CharRange.class b/k2js/out/production/stdlib/jet/CharRange.class deleted file mode 100644 index 598259786a9..00000000000 Binary files a/k2js/out/production/stdlib/jet/CharRange.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/DefaultJetObject.class b/k2js/out/production/stdlib/jet/DefaultJetObject.class deleted file mode 100644 index a69bd72e8c2..00000000000 Binary files a/k2js/out/production/stdlib/jet/DefaultJetObject.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/DoubleIterable.class b/k2js/out/production/stdlib/jet/DoubleIterable.class deleted file mode 100644 index 2184b39b43c..00000000000 Binary files a/k2js/out/production/stdlib/jet/DoubleIterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/DoubleIterator.class b/k2js/out/production/stdlib/jet/DoubleIterator.class deleted file mode 100644 index 76170cad341..00000000000 Binary files a/k2js/out/production/stdlib/jet/DoubleIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/DoubleRange$MyIterator.class b/k2js/out/production/stdlib/jet/DoubleRange$MyIterator.class deleted file mode 100644 index faaf41646da..00000000000 Binary files a/k2js/out/production/stdlib/jet/DoubleRange$MyIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/DoubleRange.class b/k2js/out/production/stdlib/jet/DoubleRange.class deleted file mode 100644 index 84a4feb8cfb..00000000000 Binary files a/k2js/out/production/stdlib/jet/DoubleRange.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction0.class b/k2js/out/production/stdlib/jet/ExtensionFunction0.class deleted file mode 100644 index 50711016e33..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction0.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction1.class b/k2js/out/production/stdlib/jet/ExtensionFunction1.class deleted file mode 100644 index 2d582b2ab65..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction10.class b/k2js/out/production/stdlib/jet/ExtensionFunction10.class deleted file mode 100644 index 72c1b0508e8..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction10.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction11.class b/k2js/out/production/stdlib/jet/ExtensionFunction11.class deleted file mode 100644 index 08e2a7ca4dd..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction11.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction12.class b/k2js/out/production/stdlib/jet/ExtensionFunction12.class deleted file mode 100644 index 6d5160e7544..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction12.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction13.class b/k2js/out/production/stdlib/jet/ExtensionFunction13.class deleted file mode 100644 index 8aad1c630ed..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction13.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction14.class b/k2js/out/production/stdlib/jet/ExtensionFunction14.class deleted file mode 100644 index f51f42da5b6..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction14.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction15.class b/k2js/out/production/stdlib/jet/ExtensionFunction15.class deleted file mode 100644 index 5a722e99381..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction15.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction16.class b/k2js/out/production/stdlib/jet/ExtensionFunction16.class deleted file mode 100644 index c9f63ed31e4..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction16.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction17.class b/k2js/out/production/stdlib/jet/ExtensionFunction17.class deleted file mode 100644 index 88e8f0fc2ba..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction17.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction18.class b/k2js/out/production/stdlib/jet/ExtensionFunction18.class deleted file mode 100644 index b5702e72379..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction18.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction19.class b/k2js/out/production/stdlib/jet/ExtensionFunction19.class deleted file mode 100644 index 66ac7aaf08f..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction19.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction2.class b/k2js/out/production/stdlib/jet/ExtensionFunction2.class deleted file mode 100644 index 5a7f89205ec..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction2.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction20.class b/k2js/out/production/stdlib/jet/ExtensionFunction20.class deleted file mode 100644 index ccae62cb808..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction20.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction21.class b/k2js/out/production/stdlib/jet/ExtensionFunction21.class deleted file mode 100644 index b9197103b22..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction21.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction22.class b/k2js/out/production/stdlib/jet/ExtensionFunction22.class deleted file mode 100644 index e4a213f8642..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction22.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction3.class b/k2js/out/production/stdlib/jet/ExtensionFunction3.class deleted file mode 100644 index de3d2a3f7cb..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction3.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction4.class b/k2js/out/production/stdlib/jet/ExtensionFunction4.class deleted file mode 100644 index f4585c00ef7..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction4.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction5.class b/k2js/out/production/stdlib/jet/ExtensionFunction5.class deleted file mode 100644 index b2c7d09a4a5..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction5.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction6.class b/k2js/out/production/stdlib/jet/ExtensionFunction6.class deleted file mode 100644 index 51607183702..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction6.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction7.class b/k2js/out/production/stdlib/jet/ExtensionFunction7.class deleted file mode 100644 index 762ee76241e..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction7.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction8.class b/k2js/out/production/stdlib/jet/ExtensionFunction8.class deleted file mode 100644 index 2e7ae583fd7..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction8.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ExtensionFunction9.class b/k2js/out/production/stdlib/jet/ExtensionFunction9.class deleted file mode 100644 index 32bbf02586a..00000000000 Binary files a/k2js/out/production/stdlib/jet/ExtensionFunction9.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/FloatIterable.class b/k2js/out/production/stdlib/jet/FloatIterable.class deleted file mode 100644 index c5d0cb7d0e8..00000000000 Binary files a/k2js/out/production/stdlib/jet/FloatIterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/FloatIterator.class b/k2js/out/production/stdlib/jet/FloatIterator.class deleted file mode 100644 index 59da8c2f1f5..00000000000 Binary files a/k2js/out/production/stdlib/jet/FloatIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/FloatRange$MyIterator.class b/k2js/out/production/stdlib/jet/FloatRange$MyIterator.class deleted file mode 100644 index 5c01b59fe58..00000000000 Binary files a/k2js/out/production/stdlib/jet/FloatRange$MyIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/FloatRange.class b/k2js/out/production/stdlib/jet/FloatRange.class deleted file mode 100644 index a4351005054..00000000000 Binary files a/k2js/out/production/stdlib/jet/FloatRange.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function0.class b/k2js/out/production/stdlib/jet/Function0.class deleted file mode 100644 index 9f6aa08281a..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function0.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function1.class b/k2js/out/production/stdlib/jet/Function1.class deleted file mode 100644 index 6426310d619..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function10.class b/k2js/out/production/stdlib/jet/Function10.class deleted file mode 100644 index 74fff27d525..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function10.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function11.class b/k2js/out/production/stdlib/jet/Function11.class deleted file mode 100644 index b89f3c686dc..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function11.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function12.class b/k2js/out/production/stdlib/jet/Function12.class deleted file mode 100644 index c3c0e35f796..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function12.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function13.class b/k2js/out/production/stdlib/jet/Function13.class deleted file mode 100644 index bbf6ae010bc..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function13.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function14.class b/k2js/out/production/stdlib/jet/Function14.class deleted file mode 100644 index c455359f17f..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function14.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function15.class b/k2js/out/production/stdlib/jet/Function15.class deleted file mode 100644 index c9a053707fe..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function15.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function16.class b/k2js/out/production/stdlib/jet/Function16.class deleted file mode 100644 index de173044756..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function16.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function17.class b/k2js/out/production/stdlib/jet/Function17.class deleted file mode 100644 index 010e900b04c..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function17.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function18.class b/k2js/out/production/stdlib/jet/Function18.class deleted file mode 100644 index 34f229cb66a..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function18.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function19.class b/k2js/out/production/stdlib/jet/Function19.class deleted file mode 100644 index e7bf140334c..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function19.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function2.class b/k2js/out/production/stdlib/jet/Function2.class deleted file mode 100644 index a4c3e2b45db..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function2.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function20.class b/k2js/out/production/stdlib/jet/Function20.class deleted file mode 100644 index 341ee1a4f0a..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function20.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function21.class b/k2js/out/production/stdlib/jet/Function21.class deleted file mode 100644 index f421de32cd0..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function21.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function22.class b/k2js/out/production/stdlib/jet/Function22.class deleted file mode 100644 index dcb66d1594f..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function22.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function3.class b/k2js/out/production/stdlib/jet/Function3.class deleted file mode 100644 index 5655fac3744..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function3.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function4.class b/k2js/out/production/stdlib/jet/Function4.class deleted file mode 100644 index 547d883bc9c..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function4.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function5.class b/k2js/out/production/stdlib/jet/Function5.class deleted file mode 100644 index 6f30c906564..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function5.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function6.class b/k2js/out/production/stdlib/jet/Function6.class deleted file mode 100644 index ee63cc67160..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function6.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function7.class b/k2js/out/production/stdlib/jet/Function7.class deleted file mode 100644 index 05a595a85bd..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function7.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function8.class b/k2js/out/production/stdlib/jet/Function8.class deleted file mode 100644 index 8ca27a9a86c..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function8.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Function9.class b/k2js/out/production/stdlib/jet/Function9.class deleted file mode 100644 index 366f019cf31..00000000000 Binary files a/k2js/out/production/stdlib/jet/Function9.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/IntIterable.class b/k2js/out/production/stdlib/jet/IntIterable.class deleted file mode 100644 index 4fe090e4b9e..00000000000 Binary files a/k2js/out/production/stdlib/jet/IntIterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/IntIterator.class b/k2js/out/production/stdlib/jet/IntIterator.class deleted file mode 100644 index 1cdf77f3237..00000000000 Binary files a/k2js/out/production/stdlib/jet/IntIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/IntRange$MyIterator.class b/k2js/out/production/stdlib/jet/IntRange$MyIterator.class deleted file mode 100644 index 0100458372b..00000000000 Binary files a/k2js/out/production/stdlib/jet/IntRange$MyIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/IntRange.class b/k2js/out/production/stdlib/jet/IntRange.class deleted file mode 100644 index e1dcb613796..00000000000 Binary files a/k2js/out/production/stdlib/jet/IntRange.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Iterable.class b/k2js/out/production/stdlib/jet/Iterable.class deleted file mode 100644 index c4f783a2bcc..00000000000 Binary files a/k2js/out/production/stdlib/jet/Iterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Iterator.class b/k2js/out/production/stdlib/jet/Iterator.class deleted file mode 100644 index a8330222e11..00000000000 Binary files a/k2js/out/production/stdlib/jet/Iterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/JetObject.class b/k2js/out/production/stdlib/jet/JetObject.class deleted file mode 100644 index 567b5815b4e..00000000000 Binary files a/k2js/out/production/stdlib/jet/JetObject.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/LongIterable.class b/k2js/out/production/stdlib/jet/LongIterable.class deleted file mode 100644 index b22306e9330..00000000000 Binary files a/k2js/out/production/stdlib/jet/LongIterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/LongIterator.class b/k2js/out/production/stdlib/jet/LongIterator.class deleted file mode 100644 index c3ad6118d2d..00000000000 Binary files a/k2js/out/production/stdlib/jet/LongIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/LongRange$MyIterator.class b/k2js/out/production/stdlib/jet/LongRange$MyIterator.class deleted file mode 100644 index eef6b8f6a3e..00000000000 Binary files a/k2js/out/production/stdlib/jet/LongRange$MyIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/LongRange.class b/k2js/out/production/stdlib/jet/LongRange.class deleted file mode 100644 index 60003b9e7c1..00000000000 Binary files a/k2js/out/production/stdlib/jet/LongRange.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/NoPatternMatchedException.class b/k2js/out/production/stdlib/jet/NoPatternMatchedException.class deleted file mode 100644 index 17e68f06867..00000000000 Binary files a/k2js/out/production/stdlib/jet/NoPatternMatchedException.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Range.class b/k2js/out/production/stdlib/jet/Range.class deleted file mode 100644 index 44e8f096b4d..00000000000 Binary files a/k2js/out/production/stdlib/jet/Range.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ShortIterable.class b/k2js/out/production/stdlib/jet/ShortIterable.class deleted file mode 100644 index f1d05522ec8..00000000000 Binary files a/k2js/out/production/stdlib/jet/ShortIterable.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ShortIterator.class b/k2js/out/production/stdlib/jet/ShortIterator.class deleted file mode 100644 index 762e05a697f..00000000000 Binary files a/k2js/out/production/stdlib/jet/ShortIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ShortRange$MyIterator.class b/k2js/out/production/stdlib/jet/ShortRange$MyIterator.class deleted file mode 100644 index 38805e95a8c..00000000000 Binary files a/k2js/out/production/stdlib/jet/ShortRange$MyIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/ShortRange.class b/k2js/out/production/stdlib/jet/ShortRange.class deleted file mode 100644 index 2370a29d63f..00000000000 Binary files a/k2js/out/production/stdlib/jet/ShortRange.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple0.class b/k2js/out/production/stdlib/jet/Tuple0.class deleted file mode 100644 index 94e12965e44..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple0.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple1.class b/k2js/out/production/stdlib/jet/Tuple1.class deleted file mode 100644 index 1578f8f970d..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple10.class b/k2js/out/production/stdlib/jet/Tuple10.class deleted file mode 100644 index d0d984caf78..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple10.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple11.class b/k2js/out/production/stdlib/jet/Tuple11.class deleted file mode 100644 index ce61d758ca9..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple11.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple12.class b/k2js/out/production/stdlib/jet/Tuple12.class deleted file mode 100644 index 65bfb2ca043..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple12.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple13.class b/k2js/out/production/stdlib/jet/Tuple13.class deleted file mode 100644 index 34128f94875..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple13.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple14.class b/k2js/out/production/stdlib/jet/Tuple14.class deleted file mode 100644 index 06a850ec285..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple14.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple15.class b/k2js/out/production/stdlib/jet/Tuple15.class deleted file mode 100644 index e166df71826..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple15.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple16.class b/k2js/out/production/stdlib/jet/Tuple16.class deleted file mode 100644 index 1a9beb8c7a5..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple16.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple17.class b/k2js/out/production/stdlib/jet/Tuple17.class deleted file mode 100644 index a34c862d7df..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple17.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple18.class b/k2js/out/production/stdlib/jet/Tuple18.class deleted file mode 100644 index 4c30def1b56..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple18.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple19.class b/k2js/out/production/stdlib/jet/Tuple19.class deleted file mode 100644 index c67db5ae251..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple19.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple2.class b/k2js/out/production/stdlib/jet/Tuple2.class deleted file mode 100644 index 635d6d9a53e..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple2.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple20.class b/k2js/out/production/stdlib/jet/Tuple20.class deleted file mode 100644 index 1b6ce91c263..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple20.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple21.class b/k2js/out/production/stdlib/jet/Tuple21.class deleted file mode 100644 index 854b4d121a9..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple21.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple22.class b/k2js/out/production/stdlib/jet/Tuple22.class deleted file mode 100644 index acda19f0385..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple22.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple3.class b/k2js/out/production/stdlib/jet/Tuple3.class deleted file mode 100644 index e963ddba7a3..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple3.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple4.class b/k2js/out/production/stdlib/jet/Tuple4.class deleted file mode 100644 index 8fa2e093e05..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple4.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple5.class b/k2js/out/production/stdlib/jet/Tuple5.class deleted file mode 100644 index 36dd286be11..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple5.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple6.class b/k2js/out/production/stdlib/jet/Tuple6.class deleted file mode 100644 index 7e53b797160..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple6.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple7.class b/k2js/out/production/stdlib/jet/Tuple7.class deleted file mode 100644 index 2c90416a6df..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple7.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple8.class b/k2js/out/production/stdlib/jet/Tuple8.class deleted file mode 100644 index 6228f7c9239..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple8.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/Tuple9.class b/k2js/out/production/stdlib/jet/Tuple9.class deleted file mode 100644 index efd7c0e1e77..00000000000 Binary files a/k2js/out/production/stdlib/jet/Tuple9.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/TypeCastException.class b/k2js/out/production/stdlib/jet/TypeCastException.class deleted file mode 100644 index 2a16f921272..00000000000 Binary files a/k2js/out/production/stdlib/jet/TypeCastException.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/TypeInfo$1.class b/k2js/out/production/stdlib/jet/TypeInfo$1.class deleted file mode 100644 index adc3a49e508..00000000000 Binary files a/k2js/out/production/stdlib/jet/TypeInfo$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/TypeInfo$2.class b/k2js/out/production/stdlib/jet/TypeInfo$2.class deleted file mode 100644 index 5f4095a6adb..00000000000 Binary files a/k2js/out/production/stdlib/jet/TypeInfo$2.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/TypeInfo$3.class b/k2js/out/production/stdlib/jet/TypeInfo$3.class deleted file mode 100644 index ccdf1ef5c8e..00000000000 Binary files a/k2js/out/production/stdlib/jet/TypeInfo$3.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/TypeInfo.class b/k2js/out/production/stdlib/jet/TypeInfo.class deleted file mode 100644 index a9217cb09d4..00000000000 Binary files a/k2js/out/production/stdlib/jet/TypeInfo.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/modules/AllModules.class b/k2js/out/production/stdlib/jet/modules/AllModules.class deleted file mode 100644 index 9c1c9d324f0..00000000000 Binary files a/k2js/out/production/stdlib/jet/modules/AllModules.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/modules/Module.class b/k2js/out/production/stdlib/jet/modules/Module.class deleted file mode 100644 index 6bd245bf7a3..00000000000 Binary files a/k2js/out/production/stdlib/jet/modules/Module.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$1.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$1.class deleted file mode 100644 index ac8a6549dc8..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayBooleanIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayBooleanIterator.class deleted file mode 100644 index 1b048e8db1e..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayBooleanIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayByteIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayByteIterator.class deleted file mode 100644 index e2683fd48bf..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayByteIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayCharacterIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayCharacterIterator.class deleted file mode 100644 index c44a7156739..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayCharacterIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayDoubleIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayDoubleIterator.class deleted file mode 100644 index 254a11a7a38..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayDoubleIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayFloatIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayFloatIterator.class deleted file mode 100644 index c0675863f82..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayFloatIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayIntegerIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayIntegerIterator.class deleted file mode 100644 index 71c12f52969..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayIntegerIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayLongIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayLongIterator.class deleted file mode 100644 index 2d7482b852f..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayLongIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayShortIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayShortIterator.class deleted file mode 100644 index c0a3bdde0e2..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$ArrayShortIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$GenericIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator$GenericIterator.class deleted file mode 100644 index 310659f1366..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator$GenericIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/ArrayIterator.class b/k2js/out/production/stdlib/jet/runtime/ArrayIterator.class deleted file mode 100644 index 77cf4586109..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/ArrayIterator.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/Intrinsics$1.class b/k2js/out/production/stdlib/jet/runtime/Intrinsics$1.class deleted file mode 100644 index 4edabe4924b..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/Intrinsics$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/Intrinsics$JetNullPointerException.class b/k2js/out/production/stdlib/jet/runtime/Intrinsics$JetNullPointerException.class deleted file mode 100644 index 3aec2414d35..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/Intrinsics$JetNullPointerException.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/Intrinsics.class b/k2js/out/production/stdlib/jet/runtime/Intrinsics.class deleted file mode 100644 index 154c8e3dbf3..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/Intrinsics.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/Ranges.class b/k2js/out/production/stdlib/jet/runtime/Ranges.class deleted file mode 100644 index 2069ee977db..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/Ranges.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Boolean.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Boolean.class deleted file mode 100644 index a70db88e494..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Boolean.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Byte.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Byte.class deleted file mode 100644 index dbbf4f3e7e7..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Byte.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Char.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Char.class deleted file mode 100644 index 4823f88b21d..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Char.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Double.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Double.class deleted file mode 100644 index 5f73ce1bbae..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Double.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Float.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Float.class deleted file mode 100644 index 522bbf9d0a7..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Float.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Int.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Int.class deleted file mode 100644 index 431fcebe8b0..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Int.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Long.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Long.class deleted file mode 100644 index 6fc639a2dcd..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Long.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Object.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Object.class deleted file mode 100644 index a27f033cc2f..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Object.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar$Short.class b/k2js/out/production/stdlib/jet/runtime/SharedVar$Short.class deleted file mode 100644 index 1220388c8a6..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar$Short.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/SharedVar.class b/k2js/out/production/stdlib/jet/runtime/SharedVar.class deleted file mode 100644 index b4e76ad3815..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/SharedVar.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetClass.class b/k2js/out/production/stdlib/jet/runtime/typeinfo/JetClass.class deleted file mode 100644 index 1dd02445ef8..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetClass.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetConstructor.class b/k2js/out/production/stdlib/jet/runtime/typeinfo/JetConstructor.class deleted file mode 100644 index d07cf5db30f..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetConstructor.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetMethod.class b/k2js/out/production/stdlib/jet/runtime/typeinfo/JetMethod.class deleted file mode 100644 index 973a8ee6d86..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetMethod.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeDescriptor.class b/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeDescriptor.class deleted file mode 100644 index 6ac855f73ed..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeDescriptor.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeParameter.class b/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeParameter.class deleted file mode 100644 index adc5002474a..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeParameter.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeProjection.class b/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeProjection.class deleted file mode 100644 index 61dba1807b6..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetTypeProjection.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetValueParameter.class b/k2js/out/production/stdlib/jet/runtime/typeinfo/JetValueParameter.class deleted file mode 100644 index 63dbd0247ba..00000000000 Binary files a/k2js/out/production/stdlib/jet/runtime/typeinfo/JetValueParameter.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Const.class b/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Const.class deleted file mode 100644 index e3f40094c27..00000000000 Binary files a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Const.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Pattern.class b/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Pattern.class deleted file mode 100644 index 5b1cbdb87f2..00000000000 Binary files a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Pattern.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$TypeInfoPatternProjection$1.class b/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$TypeInfoPatternProjection$1.class deleted file mode 100644 index c3db0f8f388..00000000000 Binary files a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$TypeInfoPatternProjection$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$TypeInfoPatternProjection.class b/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$TypeInfoPatternProjection.class deleted file mode 100644 index 09ddd9df33a..00000000000 Binary files a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$TypeInfoPatternProjection.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Var.class b/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Var.class deleted file mode 100644 index 8b2391e51a1..00000000000 Binary files a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern$Var.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern.class b/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern.class deleted file mode 100644 index 2a1f6768864..00000000000 Binary files a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoPattern.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoProjection.class b/k2js/out/production/stdlib/jet/typeinfo/TypeInfoProjection.class deleted file mode 100644 index de728fe29df..00000000000 Binary files a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoProjection.class and /dev/null differ diff --git a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoVariance.class b/k2js/out/production/stdlib/jet/typeinfo/TypeInfoVariance.class deleted file mode 100644 index 577beb0caf4..00000000000 Binary files a/k2js/out/production/stdlib/jet/typeinfo/TypeInfoVariance.class and /dev/null differ diff --git a/k2js/out/production/stdlib/modules/ModuleBuilder.kt b/k2js/out/production/stdlib/modules/ModuleBuilder.kt deleted file mode 100644 index 487ef408f20..00000000000 --- a/k2js/out/production/stdlib/modules/ModuleBuilder.kt +++ /dev/null @@ -1,47 +0,0 @@ -package kotlin.modules - -import java.util.* -import jet.modules.* - -fun module(name: String, callback: ModuleBuilder.() -> Unit) { - val builder = ModuleBuilder(name) - builder.callback() - AllModules.modules?.add(builder) -} - -class SourcesBuilder(val parent: ModuleBuilder) { - fun plusAssign(pattern: String) { - parent.addSourceFiles(pattern) - } -} - -class ClasspathBuilder(val parent: ModuleBuilder) { - fun plusAssign(name: String) { - parent.addClasspathEntry(name) - } -} - -open class ModuleBuilder(val name: String): Module { - // http://youtrack.jetbrains.net/issue/KT-904 - private val sourceFiles0: ArrayList = ArrayList() - private val classpathRoots0: ArrayList = ArrayList() - - val sources: SourcesBuilder - get() = SourcesBuilder(this) - - val classpath: ClasspathBuilder - get() = ClasspathBuilder(this) - - fun addSourceFiles(pattern: String) { - sourceFiles0.add(pattern) - } - - fun addClasspathEntry(name: String) { - classpathRoots0.add(name) - } - - override fun getSourceFiles(): List? = sourceFiles0 - override fun getClasspathRoots(): List? = classpathRoots0 - override fun getModuleName(): String? = name -} - diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/Signature.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/Signature.class deleted file mode 100644 index ded17fb3747..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/Signature.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl$1.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl$1.class deleted file mode 100644 index 0a71c63159d..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl$2.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl$2.class deleted file mode 100644 index 526240c6cc5..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl$2.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl.class deleted file mode 100644 index 4cff09d2427..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoImpl.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$1.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$1.class deleted file mode 100644 index 53c93550d63..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$2.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$2.class deleted file mode 100644 index 507b74c06dd..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$2.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$3.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$3.class deleted file mode 100644 index 87c93a0464e..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1$3.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1.class deleted file mode 100644 index ea6c0d310e2..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$2.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$2.class deleted file mode 100644 index 9fe0a7aa652..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$2.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$3.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$3.class deleted file mode 100644 index b14e8ccf9d3..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1$3.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1.class deleted file mode 100644 index 6d1178d564e..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$2.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$2.class deleted file mode 100644 index 9e77962f975..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$2.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$3.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$3.class deleted file mode 100644 index 7adf26c17d8..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$3.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$ArraySignature$1.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$ArraySignature$1.class deleted file mode 100644 index 1254afa9766..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$ArraySignature$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$ArraySignature.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$ArraySignature.class deleted file mode 100644 index b36c6cbc18f..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$ArraySignature.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter$1$1.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter$1$1.class deleted file mode 100644 index cb869b19a06..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter$1$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter$1.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter$1.class deleted file mode 100644 index e746a9fa0f3..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter.class deleted file mode 100644 index 7eb64cd529b..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser$SignatureParserJetSignatureAdapter.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser.class deleted file mode 100644 index 00fb5c5639a..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoParser.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoProjectionImpl.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoProjectionImpl.class deleted file mode 100644 index cee559a3502..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoProjectionImpl.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoUtils.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoUtils.class deleted file mode 100644 index 6cd38eda27b..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoUtils.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoVar.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoVar.class deleted file mode 100644 index cf4eebaded1..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/TypeInfoVar.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureAdapter.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureAdapter.class deleted file mode 100644 index 1e00c207bcf..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureAdapter.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureExceptionsAdapter.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureExceptionsAdapter.class deleted file mode 100644 index 9ca663be9a5..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureExceptionsAdapter.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureReader.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureReader.class deleted file mode 100644 index 628bc793912..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureReader.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureVariance.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureVariance.class deleted file mode 100644 index 70579b0327c..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureVariance.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureVisitor.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureVisitor.class deleted file mode 100644 index 286bcf837b6..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureVisitor.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureWriter$1.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureWriter$1.class deleted file mode 100644 index 195b999043c..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureWriter$1.class and /dev/null differ diff --git a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureWriter.class b/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureWriter.class deleted file mode 100644 index 0d3fe618703..00000000000 Binary files a/k2js/out/production/stdlib/org/jetbrains/jet/rt/signature/JetSignatureWriter.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer$1.class b/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer$1.class deleted file mode 100644 index 55b8fb64ccb..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer$JsConfiguration.class b/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer$JsConfiguration.class deleted file mode 100644 index 14f56141141..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer$JsConfiguration.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer.class b/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer.class deleted file mode 100644 index b3df255100d..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/analyze/Analyzer.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/config/Config.class b/k2js/out/production/translator/org/jetbrains/k2js/config/Config.class deleted file mode 100644 index 0a53dc3b315..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/config/Config.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/config/IDEAConfig.class b/k2js/out/production/translator/org/jetbrains/k2js/config/IDEAConfig.class deleted file mode 100644 index b240f0dfa1e..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/config/IDEAConfig.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/config/TestConfig$1.class b/k2js/out/production/translator/org/jetbrains/k2js/config/TestConfig$1.class deleted file mode 100644 index a737c923435..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/config/TestConfig$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/config/TestConfig.class b/k2js/out/production/translator/org/jetbrains/k2js/config/TestConfig.class deleted file mode 100644 index 1c810ea2a09..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/config/TestConfig.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/facade/K2JSTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/facade/K2JSTranslator.class deleted file mode 100644 index fc04f04051b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/facade/K2JSTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/facade/K2JSTranslatorUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/facade/K2JSTranslatorUtils.class deleted file mode 100644 index e279a430f93..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/facade/K2JSTranslatorUtils.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/generate/CodeGenerator.class b/k2js/out/production/translator/org/jetbrains/k2js/generate/CodeGenerator.class deleted file mode 100644 index de5e617153b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/generate/CodeGenerator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/Aliaser.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/Aliaser.class deleted file mode 100644 index 39dff663cf1..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/Aliaser.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/DynamicContext.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/DynamicContext.class deleted file mode 100644 index a3cf259e6ae..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/DynamicContext.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/Namer.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/Namer.class deleted file mode 100644 index 931e80c2935..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/Namer.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/NamingScope.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/NamingScope.class deleted file mode 100644 index ef346fffdee..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/NamingScope.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses$1.class deleted file mode 100644 index f2d5f3cd5da..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses$Builder.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses$Builder.class deleted file mode 100644 index 9b7a0d99475..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses$Builder.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses.class deleted file mode 100644 index afefb41cc2b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StandardClasses.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$1.class deleted file mode 100644 index 702fb772dc3..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$1.class deleted file mode 100644 index de1d1d9c5c7..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$10.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$10.class deleted file mode 100644 index 1b80238dde3..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$10.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$2.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$2.class deleted file mode 100644 index 68a970538b3..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$2.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$3.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$3.class deleted file mode 100644 index 58de4d54d8a..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$3.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$4.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$4.class deleted file mode 100644 index 82f89150319..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$4.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$5.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$5.class deleted file mode 100644 index 534d4dca531..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$5.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$6.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$6.class deleted file mode 100644 index 018be2474da..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$6.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$7.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$7.class deleted file mode 100644 index dd51ac6c3ae..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$7.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$8.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$8.class deleted file mode 100644 index 3937e4ad173..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$8.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$9.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$9.class deleted file mode 100644 index e7c033228ee..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator$9.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator.class deleted file mode 100644 index 986659dc5d2..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$NameGenerator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$1.class deleted file mode 100644 index d3b30af9489..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$2.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$2.class deleted file mode 100644 index 6883565197d..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$2.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$3.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$3.class deleted file mode 100644 index 279d2d01548..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$3.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$4.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$4.class deleted file mode 100644 index f98ac7618d1..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$4.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$5.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$5.class deleted file mode 100644 index 10d693ccf57..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator$5.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator.class deleted file mode 100644 index 7bbf52a9846..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierGenerator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$1.class deleted file mode 100644 index dcf8e7c7a19..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$2.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$2.class deleted file mode 100644 index 43ccba2e532..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$2.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$3.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$3.class deleted file mode 100644 index d2d2484bb2a..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator$3.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator.class deleted file mode 100644 index 136dbff629f..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$QualifierIsNullGenerator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$1.class deleted file mode 100644 index a1aab1d77d2..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$2.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$2.class deleted file mode 100644 index c96e980ce1e..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$2.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$3.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$3.class deleted file mode 100644 index 5892a1dfb12..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$3.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$4.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$4.class deleted file mode 100644 index 4cad1f61b1b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator$4.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator.class deleted file mode 100644 index 0d5e7ea6866..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext$ScopeGenerator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext.class deleted file mode 100644 index 9c88388283d..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/StaticContext.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/TemporaryVariable.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/TemporaryVariable.class deleted file mode 100644 index 611dd0af6a9..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/TemporaryVariable.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/TranslationContext.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/TranslationContext.class deleted file mode 100644 index a04372fcb00..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/TranslationContext.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/generator/Generator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/generator/Generator.class deleted file mode 100644 index 136fede43e2..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/generator/Generator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/generator/Rule.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/context/generator/Rule.class deleted file mode 100644 index aceefab61d9..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/context/generator/Rule.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.class deleted file mode 100644 index 06761378d68..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/ClassTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/ClassTranslator.class deleted file mode 100644 index b13cb1bdfb4..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/ClassTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/DeclarationBodyVisitor.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/DeclarationBodyVisitor.class deleted file mode 100644 index acb89b3f536..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/DeclarationBodyVisitor.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/NamespaceDeclarationTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/NamespaceDeclarationTranslator.class deleted file mode 100644 index 77f77d63eb2..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/NamespaceDeclarationTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.class deleted file mode 100644 index de072f1f24d..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/PropertyTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/PropertyTranslator.class deleted file mode 100644 index 8dd88f57a66..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/declaration/PropertyTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/ExpressionVisitor.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/ExpressionVisitor.class deleted file mode 100644 index 1b72f350b3d..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/ExpressionVisitor.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/ForTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/ForTranslator.class deleted file mode 100644 index eb3db5d03f5..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/ForTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/FunctionTranslator$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/FunctionTranslator$1.class deleted file mode 100644 index 4db7dc9d5e7..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/FunctionTranslator$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/FunctionTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/FunctionTranslator.class deleted file mode 100644 index d1a8ab4a534..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/FunctionTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/PatternTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/PatternTranslator.class deleted file mode 100644 index a8d0838ab99..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/PatternTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator$1.class deleted file mode 100644 index 1774008904a..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator$EntryVisitor.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator$EntryVisitor.class deleted file mode 100644 index 89339878eb9..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator$EntryVisitor.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator.class deleted file mode 100644 index cb7b534b825..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/StringTemplateTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/TryTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/TryTranslator.class deleted file mode 100644 index eb44b6bd0fa..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/TryTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/WhenTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/WhenTranslator.class deleted file mode 100644 index cf74f3926b5..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/expression/WhenTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/general/AbstractTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/general/AbstractTranslator.class deleted file mode 100644 index 3ea600a2e68..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/general/AbstractTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/general/Translation.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/general/Translation.class deleted file mode 100644 index 6bda847891d..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/general/Translation.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/general/TranslatorVisitor.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/general/TranslatorVisitor.class deleted file mode 100644 index 7c65d666546..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/general/TranslatorVisitor.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/AbstractInitializerTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/AbstractInitializerTranslator.class deleted file mode 100644 index 6f5f9a5d6e0..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/AbstractInitializerTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.class deleted file mode 100644 index fcef9bf7bea..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/InitializerVisitor.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/InitializerVisitor.class deleted file mode 100644 index fbee763c329..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/InitializerVisitor.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/NamespaceInitializerTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/NamespaceInitializerTranslator.class deleted file mode 100644 index a0d44e4c2b7..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/initializer/NamespaceInitializerTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/CompareToIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/CompareToIntrinsic.class deleted file mode 100644 index 28df2220c06..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/CompareToIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/EqualsIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/EqualsIntrinsic.class deleted file mode 100644 index e7265f43275..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/EqualsIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/FunctionIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/FunctionIntrinsic.class deleted file mode 100644 index fd3c86c9817..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/FunctionIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsic.class deleted file mode 100644 index cc87bea628c..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics$1.class deleted file mode 100644 index 200aee2f8d7..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics$IntrinsicDeclarationVisitor.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics$IntrinsicDeclarationVisitor.class deleted file mode 100644 index 8d69bf9582e..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics$IntrinsicDeclarationVisitor.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics.class deleted file mode 100644 index bf3114ca26b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/Intrinsics.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayFunctionConstructorIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayFunctionConstructorIntrinsic.class deleted file mode 100644 index 4d232811db7..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayFunctionConstructorIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayGetIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayGetIntrinsic.class deleted file mode 100644 index c3f7084078a..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayGetIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayIndicesIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayIndicesIntrinsic.class deleted file mode 100644 index a6d36fcfd5c..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayIndicesIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayIteratorIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayIteratorIntrinsic.class deleted file mode 100644 index bcb1a580013..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayIteratorIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayNullConstructorIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayNullConstructorIntrinsic.class deleted file mode 100644 index d21f722d56b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArrayNullConstructorIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArraySetIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArraySetIntrinsic.class deleted file mode 100644 index 984e764202e..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArraySetIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArraySizeIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArraySizeIntrinsic.class deleted file mode 100644 index 9508e07970e..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/array/ArraySizeIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveBinaryOperationIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveBinaryOperationIntrinsic.class deleted file mode 100644 index 45792e418b5..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveBinaryOperationIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveCompareToIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveCompareToIntrinsic.class deleted file mode 100644 index 1f16142de25..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveCompareToIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveEqualsIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveEqualsIntrinsic.class deleted file mode 100644 index 54d59fe259b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveEqualsIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveRangeToIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveRangeToIntrinsic.class deleted file mode 100644 index 00ddc748d44..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveRangeToIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveUnaryOperationIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveUnaryOperationIntrinsic.class deleted file mode 100644 index 914c0916aeb..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveUnaryOperationIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/string/CharAtIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/string/CharAtIntrinsic.class deleted file mode 100644 index d847a97ba07..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/string/CharAtIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/string/LengthIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/string/LengthIntrinsic.class deleted file mode 100644 index 7322d293f2b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/string/LengthIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/tuple/TupleAccessIntrinsic.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/tuple/TupleAccessIntrinsic.class deleted file mode 100644 index 4cfdc7622d5..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/intrinsic/tuple/TupleAccessIntrinsic.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/AssignmentTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/AssignmentTranslator.class deleted file mode 100644 index 7b6594c6c62..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/AssignmentTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.class deleted file mode 100644 index 1a461268252..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/CompareToTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/CompareToTranslator.class deleted file mode 100644 index 841ede7d436..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/CompareToTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IncrementTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IncrementTranslator.class deleted file mode 100644 index 3060da32013..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IncrementTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IntrinsicAssignmentTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IntrinsicAssignmentTranslator.class deleted file mode 100644 index eefe43bec8d..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IntrinsicAssignmentTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IntrinsicIncrementTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IntrinsicIncrementTranslator.class deleted file mode 100644 index 2e70a8bd14d..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/IntrinsicIncrementTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OperatorTable.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OperatorTable.class deleted file mode 100644 index ee6c297fcb3..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OperatorTable.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.class deleted file mode 100644 index b89ec807f8c..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.class deleted file mode 100644 index 3ff52a3a5a9..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.class deleted file mode 100644 index 9dbe4cc129c..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/AccessTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/AccessTranslator.class deleted file mode 100644 index d0fd9bfb184..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/AccessTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ArrayAccessTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ArrayAccessTranslator.class deleted file mode 100644 index 925e1e3ee49..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ArrayAccessTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallBuilder.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallBuilder.class deleted file mode 100644 index 058251befa2..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallBuilder.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallExpressionTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallExpressionTranslator.class deleted file mode 100644 index 7f1b922db32..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallExpressionTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$1.class deleted file mode 100644 index a03585a4af2..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$2.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$2.class deleted file mode 100644 index 389f90ac41b..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$2.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$3.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$3.class deleted file mode 100644 index ac72cd05f27..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$3.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$CallParameters.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$CallParameters.class deleted file mode 100644 index 1a2b0dd6f7f..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator$CallParameters.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator.class deleted file mode 100644 index eff97b301ae..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$1.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$1.class deleted file mode 100644 index 11bf54772e5..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$2.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$2.class deleted file mode 100644 index c448fea6eb0..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$2.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$CallConstructor.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$CallConstructor.class deleted file mode 100644 index c66c26e2c37..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType$CallConstructor.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType.class deleted file mode 100644 index 27094251066..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/CallType.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/KotlinPropertyAccessTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/KotlinPropertyAccessTranslator.class deleted file mode 100644 index 89d3da98388..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/KotlinPropertyAccessTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/NativePropertyAccessTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/NativePropertyAccessTranslator.class deleted file mode 100644 index d19d4ce678a..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/NativePropertyAccessTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/PropertyAccessTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/PropertyAccessTranslator.class deleted file mode 100644 index 374df25795a..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/PropertyAccessTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/QualifiedExpressionTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/QualifiedExpressionTranslator.class deleted file mode 100644 index af51cbad365..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/QualifiedExpressionTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ReferenceAccessTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ReferenceAccessTranslator.class deleted file mode 100644 index 79080ce34ff..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ReferenceAccessTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ReferenceTranslator.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ReferenceTranslator.class deleted file mode 100644 index 32e2e701cc2..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/reference/ReferenceTranslator.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/AnnotationsUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/AnnotationsUtils.class deleted file mode 100644 index 6228fd87c48..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/AnnotationsUtils.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/BindingUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/BindingUtils.class deleted file mode 100644 index 5fb575f9146..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/BindingUtils.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/ClassSorter.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/ClassSorter.class deleted file mode 100644 index b948afd2e85..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/ClassSorter.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/DescriptorUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/DescriptorUtils.class deleted file mode 100644 index 6371e87c551..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/DescriptorUtils.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/PsiUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/PsiUtils.class deleted file mode 100644 index 6109092a792..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/PsiUtils.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/TranslationUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/TranslationUtils.class deleted file mode 100644 index 33f42f9b4ad..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/translate/utils/TranslationUtils.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/utils/GenerationUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/utils/GenerationUtils.class deleted file mode 100644 index 434a267c837..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/utils/GenerationUtils.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetFileUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/utils/JetFileUtils.class deleted file mode 100644 index 9436f995d40..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetFileUtils.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$1$1.class b/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$1$1.class deleted file mode 100644 index adb777e51b7..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$1$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$1.class b/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$1.class deleted file mode 100644 index e64592a32db..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$2$1.class b/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$2$1.class deleted file mode 100644 index 6cbaadad570..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$2$1.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$2.class b/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$2.class deleted file mode 100644 index 68c36efeb71..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils$2.class and /dev/null differ diff --git a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils.class b/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils.class deleted file mode 100644 index f6d2db30d1a..00000000000 Binary files a/k2js/out/production/translator/org/jetbrains/k2js/utils/JetTestUtils.class and /dev/null differ diff --git a/k2js/out/production/util/org/jetbrains/jet/plugin/compiler/PathUtil.class b/k2js/out/production/util/org/jetbrains/jet/plugin/compiler/PathUtil.class deleted file mode 100644 index d659457aa3b..00000000000 Binary files a/k2js/out/production/util/org/jetbrains/jet/plugin/compiler/PathUtil.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetLiteFixture$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetLiteFixture$1.class deleted file mode 100644 index 44626181a67..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetLiteFixture$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetLiteFixture.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetLiteFixture.class deleted file mode 100644 index 9cc699cc514..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetLiteFixture.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$1.class deleted file mode 100644 index d5865ed7957..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$2.class deleted file mode 100644 index 4dab837116d..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$3.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$3.class deleted file mode 100644 index 2e2ab428abb..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$3.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$4.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$4.class deleted file mode 100644 index b38885b8fb1..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$4.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$NamedTestFactory.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$NamedTestFactory.class deleted file mode 100644 index 00ac4bc66c1..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder$NamedTestFactory.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder.class deleted file mode 100644 index 1c040a3c7e1..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestCaseBuilder.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$1$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$1$1.class deleted file mode 100644 index e4c1d3a98ed..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$1$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$1.class deleted file mode 100644 index 3f648ea9aca..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$2$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$2$1.class deleted file mode 100644 index 1c3b2108b0e..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$2$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$2.class deleted file mode 100644 index 002efa1e629..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$3$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$3$1.class deleted file mode 100644 index 9056624b375..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$3$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$3.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$3.class deleted file mode 100644 index dc105ee01aa..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$3.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$TestFileFactory.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$TestFileFactory.class deleted file mode 100644 index 66c83676c89..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils$TestFileFactory.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils.class deleted file mode 100644 index 2e3b130e24e..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/JetTestUtils.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$1.class deleted file mode 100644 index d2c5fcc5bd4..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$2.class deleted file mode 100644 index ea3d513570b..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$3.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$3.class deleted file mode 100644 index 9c87a408b64..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$3.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$4.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$4.class deleted file mode 100644 index cd73523cf99..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest$4.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest.class deleted file mode 100644 index 534f0ebc9f7..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/cfg/JetControlFlowTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$1.class deleted file mode 100644 index 97fdab61fbf..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$2.class deleted file mode 100644 index 037895884b3..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$3.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$3.class deleted file mode 100644 index 9d664d83255..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$3.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$4.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$4.class deleted file mode 100644 index 6878e12f459..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$4.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$5.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$5.class deleted file mode 100644 index 62149acc0e3..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$5.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$TheTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$TheTest$1.class deleted file mode 100644 index 181efa9414d..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$TheTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$TheTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$TheTest.class deleted file mode 100644 index cd95ad08a55..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest$TheTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest.class deleted file mode 100644 index 47f4ac7b740..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/CheckerTestUtilTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$1.class deleted file mode 100644 index b57e430c92f..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$2.class deleted file mode 100644 index e2fdc5b3aa9..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$TestFile$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$TestFile$1.class deleted file mode 100644 index 9118d4970f0..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$TestFile$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$TestFile.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$TestFile.class deleted file mode 100644 index 9faf4dd49ad..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest$TestFile.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.class deleted file mode 100644 index b844c3758f5..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/checkers/JetDiagnosticsTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/AnnotationGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/AnnotationGenTest.class deleted file mode 100644 index c4c7719595c..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/AnnotationGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ArrayGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ArrayGenTest.class deleted file mode 100644 index c2ba23c0a73..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ArrayGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/BridgeMethodGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/BridgeMethodGenTest.class deleted file mode 100644 index 47f64beb0dc..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/BridgeMethodGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ClassGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ClassGenTest.class deleted file mode 100644 index 5f718a14011..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ClassGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ClosuresGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ClosuresGenTest.class deleted file mode 100644 index 50b3f74f9ab..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ClosuresGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/CodegenTestCase$MyClassLoader.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/CodegenTestCase$MyClassLoader.class deleted file mode 100644 index 14d4117bf04..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/CodegenTestCase$MyClassLoader.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/CodegenTestCase.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/CodegenTestCase.class deleted file mode 100644 index f4861a8b1c3..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/CodegenTestCase.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ControlStructuresTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ControlStructuresTest.class deleted file mode 100644 index 5b2f86ada37..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ControlStructuresTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.class deleted file mode 100644 index 47b20da436d..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ExtensionFunctionsTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.class deleted file mode 100644 index 47f22aac70b..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/FunctionGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/FunctionGenTest.class deleted file mode 100644 index cd618f8b906..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/FunctionGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/NamespaceGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/NamespaceGenTest.class deleted file mode 100644 index 97991d59be7..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/NamespaceGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ObjectGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ObjectGenTest.class deleted file mode 100644 index dc6810bdd7b..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/ObjectGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PatternMatchingTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PatternMatchingTest.class deleted file mode 100644 index d63a8fd9a0d..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PatternMatchingTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PrimitiveTypesTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PrimitiveTypesTest.class deleted file mode 100644 index 2cbc62399db..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PrimitiveTypesTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PropertyGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PropertyGenTest.class deleted file mode 100644 index bb5d1d8621c..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/PropertyGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/SafeRefTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/SafeRefTest.class deleted file mode 100644 index b423b5fd0bf..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/SafeRefTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/StdlibTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/StdlibTest.class deleted file mode 100644 index 5174cb56a4c..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/StdlibTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/StringsTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/StringsTest.class deleted file mode 100644 index 422be6480a2..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/StringsTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/SuperGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/SuperGenTest.class deleted file mode 100644 index feb1560e244..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/SuperGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TestlibTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TestlibTest.class deleted file mode 100644 index 30c2068652c..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TestlibTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TraitsTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TraitsTest.class deleted file mode 100644 index 392b0dc74af..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TraitsTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TupleGenTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TupleGenTest.class deleted file mode 100644 index 6d6aa7932c5..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TupleGenTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TypeInfoTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TypeInfoTest$1.class deleted file mode 100644 index 06e69516abb..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TypeInfoTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TypeInfoTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TypeInfoTest.class deleted file mode 100644 index 22b4640be5d..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/TypeInfoTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/VarArgTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/VarArgTest.class deleted file mode 100644 index 4b1e1324be4..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/codegen/VarArgTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.class deleted file mode 100644 index 199d9ba6604..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileEnvironmentTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileJavaAgainstKotlinTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileJavaAgainstKotlinTest$1.class deleted file mode 100644 index 3092d9c530f..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileJavaAgainstKotlinTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileJavaAgainstKotlinTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileJavaAgainstKotlinTest.class deleted file mode 100644 index 2668dc95e69..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileJavaAgainstKotlinTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest$1.class deleted file mode 100644 index 75bc1e2a33e..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest$1Filter.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest$1Filter.class deleted file mode 100644 index 6da835ea945..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest$1Filter.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest.class deleted file mode 100644 index 70138bb4e21..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/CompileKotlinAgainstKotlinTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$1.class deleted file mode 100644 index 53b66058c1a..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$FullContentSerialier.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$FullContentSerialier.class deleted file mode 100644 index 3d5363c4dd6..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$FullContentSerialier.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$NamespacePrefixSerializer.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$NamespacePrefixSerializer.class deleted file mode 100644 index b23e0d82067..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$NamespacePrefixSerializer.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$Serializer.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$Serializer.class deleted file mode 100644 index bb1f89da7cf..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$Serializer.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$ValueParameterSerializer.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$ValueParameterSerializer.class deleted file mode 100644 index 7a29b2089b4..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator$ValueParameterSerializer.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator.class deleted file mode 100644 index 4e4b8de9788..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/NamespaceComparator.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadJavaBinaryClassTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadJavaBinaryClassTest$1.class deleted file mode 100644 index eaac51dd4d6..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadJavaBinaryClassTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadJavaBinaryClassTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadJavaBinaryClassTest.class deleted file mode 100644 index bf61d2bdf64..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadJavaBinaryClassTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadKotlinBinaryClassTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadKotlinBinaryClassTest$1.class deleted file mode 100644 index 33d2781eb0c..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadKotlinBinaryClassTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadKotlinBinaryClassTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadKotlinBinaryClassTest.class deleted file mode 100644 index ad688b3bf2a..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/ReadKotlinBinaryClassTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/TestCaseWithTmpdir.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/TestCaseWithTmpdir.class deleted file mode 100644 index 1f721c2cd41..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/TestCaseWithTmpdir.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1.class deleted file mode 100644 index df256c830cd..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1$1.class deleted file mode 100644 index 6a906ef18fb..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1$2.class deleted file mode 100644 index 1f725404d4f..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1.class deleted file mode 100644 index 2c74b9a02ac..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor.class deleted file mode 100644 index 8ed9ca7328d..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$1Visitor.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$ActualSignature.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$ActualSignature.class deleted file mode 100644 index 53c99940179..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$ActualSignature.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$Expectation.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$Expectation.class deleted file mode 100644 index 466f336e4fa..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest$Expectation.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest.class deleted file mode 100644 index d6a6e47cb89..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/compiler/WriteSignatureTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/lang/psi/JetPsiUtilTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/lang/psi/JetPsiUtilTest.class deleted file mode 100644 index 8dcf2ee95f9..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/lang/psi/JetPsiUtilTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetCodeConformanceTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetCodeConformanceTest.class deleted file mode 100644 index 27dc1e06f19..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetCodeConformanceTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest$1.class deleted file mode 100644 index 7c7bb9aaae2..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest$2.class deleted file mode 100644 index 917d73b41c0..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest.class deleted file mode 100644 index 8432df42432..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/parsing/JetParsingTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData$1.class deleted file mode 100644 index b0eb9ba89da..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData$Position.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData$Position.class deleted file mode 100644 index 48116c83f11..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData$Position.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData.class deleted file mode 100644 index 4fbfc2b73d4..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExpectedResolveData.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExtensibleResolveTestCase$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExtensibleResolveTestCase$1.class deleted file mode 100644 index 4e274341bc1..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExtensibleResolveTestCase$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExtensibleResolveTestCase.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExtensibleResolveTestCase.class deleted file mode 100644 index c473e48433e..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/ExtensibleResolveTestCase.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest$1.class deleted file mode 100644 index 58604d2923a..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest$2.class deleted file mode 100644 index 5f7494cc843..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest.class deleted file mode 100644 index 582aec89388..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/resolve/JetResolveTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/runtime/JetNpeTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/runtime/JetNpeTest.class deleted file mode 100644 index 710935f0543..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/runtime/JetNpeTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest$JetDefaultModalityModifiersTestCase.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest$JetDefaultModalityModifiersTestCase.class deleted file mode 100644 index 209b5fb9b81..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest$JetDefaultModalityModifiersTestCase.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest.class deleted file mode 100644 index 0a9e4efa058..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetDefaultModalityModifiersTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetOverloadTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetOverloadTest.class deleted file mode 100644 index 61ed04b42f0..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetOverloadTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetOverridingTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetOverridingTest.class deleted file mode 100644 index 0db7a668d6f..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetOverridingTest.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$1.class deleted file mode 100644 index da9e2af5d72..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions$1.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions$1.class deleted file mode 100644 index 5a51f2c4e28..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions$1.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions$2.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions$2.class deleted file mode 100644 index a8e3c457455..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions$2.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions.class deleted file mode 100644 index 15def5c44d4..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest$ClassDefinitions.class and /dev/null differ diff --git a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest.class b/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest.class deleted file mode 100644 index 6748e849a65..00000000000 Binary files a/k2js/out/test/compiler-tests/org/jetbrains/jet/types/JetTypeCheckerTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/AbstractExpressionTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/AbstractExpressionTest.class deleted file mode 100644 index 4cb446e4fcc..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/AbstractExpressionTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ArrayListTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ArrayListTest.class deleted file mode 100644 index b5275ff20f3..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ArrayListTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/BaseTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/BaseTest.class deleted file mode 100644 index f7aacc8065e..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/BaseTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/BasicClassTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/BasicClassTest.class deleted file mode 100644 index 2f60336e4dd..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/BasicClassTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ClassInheritanceTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ClassInheritanceTest.class deleted file mode 100644 index 93b0de01ed2..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ClassInheritanceTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ConditionalTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ConditionalTest.class deleted file mode 100644 index e4836cdafbe..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ConditionalTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExampleTestSuite$1.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExampleTestSuite$1.class deleted file mode 100644 index 198174d0ebd..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExampleTestSuite$1.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExampleTestSuite.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExampleTestSuite.class deleted file mode 100644 index 6c6f310cf51..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExampleTestSuite.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExtensionFunctionTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExtensionFunctionTest.class deleted file mode 100644 index 5ed0193b3ea..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExtensionFunctionTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExtensionPropertyTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExtensionPropertyTest.class deleted file mode 100644 index ae2efb7b08e..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ExtensionPropertyTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ForTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ForTest.class deleted file mode 100644 index bb2f61f93cf..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ForTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/FunctionTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/FunctionTest.class deleted file mode 100644 index f6773db70e6..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/FunctionTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/JavaClassesTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/JavaClassesTest.class deleted file mode 100644 index 60565244cc6..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/JavaClassesTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/KotlinLibTest$1.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/KotlinLibTest$1.class deleted file mode 100644 index e84986fcd7a..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/KotlinLibTest$1.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/KotlinLibTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/KotlinLibTest.class deleted file mode 100644 index f5adedec1cb..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/KotlinLibTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MiscTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MiscTest.class deleted file mode 100644 index b58e030532e..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MiscTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MultiFileTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MultiFileTest.class deleted file mode 100644 index 50cd836d0a2..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MultiFileTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MultiNamespaceTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MultiNamespaceTest.class deleted file mode 100644 index a6ee234328f..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/MultiNamespaceTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/NameClashesTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/NameClashesTest.class deleted file mode 100644 index d5b089fedcd..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/NameClashesTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ObjectTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ObjectTest.class deleted file mode 100644 index 671b58a1584..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/ObjectTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/OperatorOverloadingTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/OperatorOverloadingTest.class deleted file mode 100644 index af15b9263f4..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/OperatorOverloadingTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/PatternMatchingTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/PatternMatchingTest.class deleted file mode 100644 index 1d03d2b21af..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/PatternMatchingTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/PropertyAccessTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/PropertyAccessTest.class deleted file mode 100644 index 32d55e0680a..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/PropertyAccessTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RTTITest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RTTITest.class deleted file mode 100644 index 16fd7d3126a..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RTTITest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RangeTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RangeTest.class deleted file mode 100644 index b77a0bfdfc1..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RangeTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoFunctionResultChecker.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoFunctionResultChecker.class deleted file mode 100644 index 8921a012972..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoFunctionResultChecker.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoPropertyTypesChecker.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoPropertyTypesChecker.class deleted file mode 100644 index 1021d7d81f4..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoPropertyTypesChecker.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoResultChecker.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoResultChecker.class deleted file mode 100644 index 991a6de63e1..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoResultChecker.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoSystemOutputChecker.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoSystemOutputChecker.class deleted file mode 100644 index d00410e8f59..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoSystemOutputChecker.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoUtils.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoUtils.class deleted file mode 100644 index b218d3cfd54..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/RhinoUtils.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/SimpleTestSuite$1.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/SimpleTestSuite$1.class deleted file mode 100644 index de27cff1635..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/SimpleTestSuite$1.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/SimpleTestSuite.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/SimpleTestSuite.class deleted file mode 100644 index a0b3e39142a..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/SimpleTestSuite.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/StandardClassesTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/StandardClassesTest.class deleted file mode 100644 index e7c6d7f11d9..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/StandardClassesTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/StringTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/StringTest.class deleted file mode 100644 index ffd7a1a2b51..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/StringTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$1.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$1.class deleted file mode 100644 index c7bdac391bf..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$1.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$2.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$2.class deleted file mode 100644 index 0cf76801ad7..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$2.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$SingleFileTester.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$SingleFileTester.class deleted file mode 100644 index c5b4b2ec24a..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite$SingleFileTester.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite.class deleted file mode 100644 index 8906648b535..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/Suite.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TraitTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TraitTest.class deleted file mode 100644 index 4299b66a4c6..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TraitTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslationTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslationTest.class deleted file mode 100644 index bc7fef386df..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslationTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$1.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$1.class deleted file mode 100644 index b48b1935344..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$1.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$2.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$2.class deleted file mode 100644 index 9f8d58ea61d..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$2.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$3.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$3.class deleted file mode 100644 index 3d7af1d5936..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$3.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$4.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$4.class deleted file mode 100644 index 246bc30329f..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$4.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$NamedTestFactory.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$NamedTestFactory.class deleted file mode 100644 index 9427573a389..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder$NamedTestFactory.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder.class deleted file mode 100644 index 1f789cf25e3..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TranslatorTestCaseBuilder.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TupleTest.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TupleTest.class deleted file mode 100644 index a78f38ea2ac..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/TupleTest.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/WebDemoExamples1Test.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/WebDemoExamples1Test.class deleted file mode 100644 index ee937e6b5db..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/WebDemoExamples1Test.class and /dev/null differ diff --git a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/WebDemoExamples2Test.class b/k2js/out/test/translatorTests/org/jetbrains/k2js/test/WebDemoExamples2Test.class deleted file mode 100644 index 823b8196544..00000000000 Binary files a/k2js/out/test/translatorTests/org/jetbrains/k2js/test/WebDemoExamples2Test.class and /dev/null differ diff --git a/k2js/translator/testFiles/class/out/classInstantiation.js b/k2js/translator/testFiles/class/out/classInstantiation.js deleted file mode 100644 index dd262ccec77..00000000000 --- a/k2js/translator/testFiles/class/out/classInstantiation.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Test = Kotlin.Class.create({initialize:function(){ - } - }); - return {Test_0:Test}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var test = new foo.Test_0; - return true; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/class/out/classWithoutNamespace.js b/k2js/translator/testFiles/class/out/classWithoutNamespace.js deleted file mode 100644 index d15ad6a889c..00000000000 --- a/k2js/translator/testFiles/class/out/classWithoutNamespace.js +++ /dev/null @@ -1,26 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(a){ - this.$a = a; - { - this.$a = 3; - } - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {A:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new Anonymous.A(1)).get_a() == 3; - } -} -}, {A:classes.A}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/class/out/complexExpressionAsConstructorParameter.js b/k2js/translator/testFiles/class/out/complexExpressionAsConstructorParameter.js deleted file mode 100644 index 2110aec74d3..00000000000 --- a/k2js/translator/testFiles/class/out/complexExpressionAsConstructorParameter.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Test = Kotlin.Class.create({initialize:function(a, b){ - this.$c = a; - this.$d = b; - } - , get_c:function(){ - return this.$c; - } - , get_d:function(){ - return this.$d; - } - }); - return {Test_0:Test}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var test = new foo.Test_0(1 + 6 * 3, 10 % 2); - return test.get_c() == 19 && test.get_d() == 0; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/class/out/constructorWithParameter.js b/k2js/translator/testFiles/class/out/constructorWithParameter.js deleted file mode 100644 index 21bbff908d6..00000000000 --- a/k2js/translator/testFiles/class/out/constructorWithParameter.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Test = Kotlin.Class.create({initialize:function(a){ - this.$b = a; - } - , get_b:function(){ - return this.$b; - } - }); - return {Test_0:Test}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var test = new foo.Test_0(1); - return test.get_b() == 1; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/class/out/constructorWithPropertiesAsParameters.js b/k2js/translator/testFiles/class/out/constructorWithPropertiesAsParameters.js deleted file mode 100644 index 6cfad6ef0d1..00000000000 --- a/k2js/translator/testFiles/class/out/constructorWithPropertiesAsParameters.js +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var A = Kotlin.Class.create({initialize:function(b, a){ - this.$b = b; - this.$a = a; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {A_0:A}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var c = new foo.A_0(1, '1'); - c.set_b(2); - c.set_a('2'); - return c.get_b() == 2 && c.get_a() == '2'; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/class/out/incrementProperty.js b/k2js/translator/testFiles/class/out/incrementProperty.js deleted file mode 100644 index 4d85dc808ed..00000000000 --- a/k2js/translator/testFiles/class/out/incrementProperty.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Slot = Kotlin.Class.create({initialize:function(){ - this.$vitality = 10000; - } - , get_vitality:function(){ - return this.$vitality; - } - , set_vitality:function(tmp$0){ - this.$vitality = tmp$0; - } - , increaseVitality:function(delta){ - { - this.set_vitality(this.get_vitality() + delta); - if (this.get_vitality() > 65535) - this.set_vitality(65535); - } - } - }); - return {Slot_0:Slot}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var s = new foo.Slot_0; - s.increaseVitality(1000); - if (s.get_vitality() == 11000) - return 'OK'; - else - return 'fail'; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/class/out/methodDeclarationAndCall.js b/k2js/translator/testFiles/class/out/methodDeclarationAndCall.js deleted file mode 100644 index 15b23e7a16f..00000000000 --- a/k2js/translator/testFiles/class/out/methodDeclarationAndCall.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Test = Kotlin.Class.create({initialize:function(){ - } - , method:function(){ - { - return true; - } - } - }); - return {Test_0:Test}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var test = new foo.Test_0; - return test.method(); - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/class/out/propertiesAsParametersInitialized.js b/k2js/translator/testFiles/class/out/propertiesAsParametersInitialized.js deleted file mode 100644 index 0463524396e..00000000000 --- a/k2js/translator/testFiles/class/out/propertiesAsParametersInitialized.js +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var A = Kotlin.Class.create({initialize:function(b, a){ - this.$b = b; - this.$a = a; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {A_0:A}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var c = new foo.A_0(2, '2'); - return c.get_b() == 2 && c.get_a() == '2'; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/class/out/propertyAccess.js b/k2js/translator/testFiles/class/out/propertyAccess.js deleted file mode 100644 index fff3a97d69c..00000000000 --- a/k2js/translator/testFiles/class/out/propertyAccess.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Test = Kotlin.Class.create({initialize:function(){ - this.$p = true; - } - , get_p:function(){ - return this.$p; - } - }); - return {Test_0:Test}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - return (new foo.Test_0).get_p(); - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/class/out/simpleInitializer.js b/k2js/translator/testFiles/class/out/simpleInitializer.js deleted file mode 100644 index 7eba4fc61ab..00000000000 --- a/k2js/translator/testFiles/class/out/simpleInitializer.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Test = Kotlin.Class.create({initialize:function(){ - { - this.$a = 3; - } - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {Test_0:Test}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - return (new foo.Test_0).get_a() == 3; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/examples/out/KT-921.js b/k2js/translator/testFiles/examples/out/KT-921.js deleted file mode 100644 index f4261476a01..00000000000 --- a/k2js/translator/testFiles/examples/out/KT-921.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - classes = function(){ - var Viewable = Kotlin.Class.create({initialize:function(){ - this.$items = new Kotlin.ArrayList; - } - , get_items:function(){ - return this.$items; - } - , add:function(item_0){ - this.get_items().add(item_0); - } - , remove:function(item_0){ - this.get_items().remove(item_0); - } - , view:function(lifetime, viewer){ - { - tmp$0 = this.get_items().iterator(); - while (tmp$0.hasNext()) { - item = tmp$0.next(); - { - viewer(lifetime, item); - } - } - } - } - }); - var Lifetime = Kotlin.Class.create({initialize:function(){ - this.$attached = new Kotlin.ArrayList; - } - , get_attached:function(){ - return this.$attached; - } - , attach:function(action){ - this.get_attached().add(action); - } - , close_0:function(){ - { - tmp$0 = this.get_attached().iterator(); - while (tmp$0.hasNext()) { - x = tmp$0.next(); - { - x(); - } - } - } - this.get_attached().clear(); - } - }); - return {Lifetime_0:Lifetime, Viewable_0:Viewable}; - } - (); - Anonymous = Kotlin.Namespace.create({initialize:function(){ - } - , lifetime_0:function(body){ - var l = new Anonymous.Lifetime_0; - body(l); - l.close_0(); - } - , Dump:function(items){ - { - tmp$0 = items.iterator(); - while (tmp$0.hasNext()) { - item = tmp$0.next(); - { - Kotlin.System.out() != null?Kotlin.System.out().print(Kotlin.toString(item) + ', '):null; - } - } - } - Kotlin.System.out() != null?Kotlin.System.out().println():null; - } - , main:function(args){ - var v = new Anonymous.Viewable_0; - var x = new Kotlin.ArrayList; - v.add(1); - v.add(2); - Anonymous.lifetime_0((tmp$0_0 = this , function(it){ - return v.view(it, (tmp$0 = this , function(itemLifetime, item){ - x.add(item); - Anonymous.Dump(x); - return itemLifetime.attach(); - } - )); - } - )); - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/examples/out/closureWithParameter.js b/k2js/translator/testFiles/examples/out/closureWithParameter.js deleted file mode 100644 index 3fb2e2e509d..00000000000 --- a/k2js/translator/testFiles/examples/out/closureWithParameter.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return Anonymous.apply('OK', function(arg){ - { - return arg; - } - } - ); - } -} -, apply:function(arg, f){ - { - return f(arg); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/closureWithParameterAndBoxing.js b/k2js/translator/testFiles/examples/out/closureWithParameterAndBoxing.js deleted file mode 100644 index cd1791d1d3e..00000000000 --- a/k2js/translator/testFiles/examples/out/closureWithParameterAndBoxing.js +++ /dev/null @@ -1,28 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - if (Anonymous.apply(5, function(arg){ - { - return arg + 13; - } - } - ) == 18) - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -, apply:function(arg, f){ - { - return f(arg); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/diamondInheritance.js b/k2js/translator/testFiles/examples/out/diamondInheritance.js deleted file mode 100644 index 54b0c51ee46..00000000000 --- a/k2js/translator/testFiles/examples/out/diamondInheritance.js +++ /dev/null @@ -1,50 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$v = 0; - } - , get_v:function(){ - return this.$v; - } - , set_v:function(tmp$0){ - this.$v = tmp$0; - } - }); - var tmp$1 = Kotlin.Trait.create(tmp$0, {}); - var tmp$2 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - } - }); - var tmp$3 = Kotlin.Class.create(tmp$2, tmp$1, {initialize:function(){ - this.super_init(); - } - }); - return {Right:tmp$1, Left:tmp$2, D:tmp$3, Base:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, vl:function(l){ - { - return l.get_v(); - } -} -, vr:function(r){ - { - return r.get_v(); - } -} -, box:function(){ - { - var d = new Anonymous.D; - d.set_v(42); - if (d.get_v() != 42) - return 'Fail #1'; - if (Anonymous.vl(d) != 42) - return 'Fail #2'; - if (Anonymous.vr(d) != 42) - return 'Fail #3'; - return 'OK'; - } -} -}, {Base:classes.Base, Left:classes.Left, Right:classes.Right, D:classes.D}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/doubleEnclosedLocalVariable.js b/k2js/translator/testFiles/examples/out/doubleEnclosedLocalVariable.js deleted file mode 100644 index 6d8e80a38b9..00000000000 --- a/k2js/translator/testFiles/examples/out/doubleEnclosedLocalVariable.js +++ /dev/null @@ -1,35 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var cl = 39; - if (Anonymous.sum(200, function(){ - { - var ff = function(){ - { - return cl; - } - } - ; - return ff(); - } - } - ) == 239) - tmp$0 = 'OK'; - else - tmp$0 = 'FAIL'; - return tmp$0; - } -} -, sum:function(arg, f){ - { - return arg + f(); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/enclosingLocalVariable.js b/k2js/translator/testFiles/examples/out/enclosingLocalVariable.js deleted file mode 100644 index c97a6e06d41..00000000000 --- a/k2js/translator/testFiles/examples/out/enclosingLocalVariable.js +++ /dev/null @@ -1,41 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var cl = 39; - if (Anonymous.sum(200, function(){ - { - var m = function(){ - { - var r = function(){ - { - return cl; - } - } - ; - return r(); - } - } - ; - return m(); - } - } - ) == 239) - tmp$0 = 'OK'; - else - tmp$0 = 'FAIL'; - return tmp$0; - } -} -, sum:function(arg, f){ - { - return arg + f(); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/enclosingThis.js b/k2js/translator/testFiles/examples/out/enclosingThis.js deleted file mode 100644 index 1fd99f7521c..00000000000 --- a/k2js/translator/testFiles/examples/out/enclosingThis.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Point_0 = Kotlin.Class.create({initialize:function(x, y){ - this.$x = x; - this.$y = y; - } - , get_x:function(){ - return this.$x; - } - , get_y:function(){ - return this.$y; - } - , mul:function(){ - { - var tmp$0; - return tmp$0 = this , function(scalar){ - { - return new Anonymous.Point(tmp$0.get_x() * scalar, tmp$0.get_y() * scalar); - } - } - ; - } - } - }); - return {Point:Point_0}; - } - (); - var Anonymous = Kotlin.Namespace.create({initialize:function(){ - Anonymous.$m = (new Anonymous.Point(2, 3)).mul(); - } - , get_m:function(){ - return Anonymous.$m; - } - , box:function(){ - { - var answer = Anonymous.get_m()(5); - return answer.get_x() == 10 && answer.get_y() == 15?'OK':'FAIL'; - } - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/examples/out/extensionClosure.js b/k2js/translator/testFiles/examples/out/extensionClosure.js deleted file mode 100644 index f49da63c02d..00000000000 --- a/k2js/translator/testFiles/examples/out/extensionClosure.js +++ /dev/null @@ -1,40 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(x, y){ - this.$x = x; - this.$y = y; - } - , get_x:function(){ - return this.$x; - } - , get_y:function(){ - return this.$y; - } - }); - return {Point:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var answer = Anonymous.apply(new Anonymous.Point(3, 5), function(scalar){ - { - return new Anonymous.Point(this.get_x() * scalar, this.get_y() * scalar); - } - } - ); - if (answer.get_x() == 6 && answer.get_y() == 10) - tmp$0 = 'OK'; - else - tmp$0 = 'FAIL'; - return tmp$0; - } -} -, apply:function(arg, f){ - { - return f.call(arg, 2); - } -} -}, {Point:classes.Point}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/funDelegation.js b/k2js/translator/testFiles/examples/out/funDelegation.js deleted file mode 100644 index 256a85c899f..00000000000 --- a/k2js/translator/testFiles/examples/out/funDelegation.js +++ /dev/null @@ -1,41 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({}); - var tmp$1 = Kotlin.Class.create({initialize:function(){ - } - , n_0:function(n){ - { - return n + 1; - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - } - }); - var tmp$3 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - } - }); - return {Base:tmp$1, Derived2:tmp$2, Derived1:tmp$3, Abstract:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, test:function(s){ - { - return s.n_0(238) == 239; - } -} -, box:function(){ - { - if (!Anonymous.test(new Anonymous.Base)) - return 'Fail #1'; - if (!Anonymous.test(new Anonymous.Derived1)) - return 'Fail #2'; - if (!Anonymous.test(new Anonymous.Derived2)) - return 'Fail #3'; - return 'OK'; - } -} -}, {Base:classes.Base, Abstract:classes.Abstract, Derived1:classes.Derived1, Derived2:classes.Derived2}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/generic.js b/k2js/translator/testFiles/examples/out/generic.js deleted file mode 100644 index 89c902fe806..00000000000 --- a/k2js/translator/testFiles/examples/out/generic.js +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var Anonymous = Kotlin.Namespace.create({initialize:function(){ - } - , findAll:function(receiver, predicate){ - { - var tmp$0; - var result = new Kotlin.ArrayList(0); - { - tmp$0 = this.iterator(); - while (tmp$0.hasNext()) { - var t = tmp$0.next(); - { - if (predicate(t)) - result.add(t); - } - } - } - return result; - } - } - , box:function(){ - { - var list = new Kotlin.ArrayList(0); - list.add(2); - list.add(3); - list.add(5); - var m = list.Anonymous.findAll(list, function(name_0){ - { - return name_0 < 4; - } - } - ); - return m.size() == 2?'OK':'fail'; - } - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/examples/out/incrementProperty.js b/k2js/translator/testFiles/examples/out/incrementProperty.js deleted file mode 100644 index a4365ed3ba1..00000000000 --- a/k2js/translator/testFiles/examples/out/incrementProperty.js +++ /dev/null @@ -1,35 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$vitality = 10000; - } - , get_vitality:function(){ - return this.$vitality; - } - , set_vitality:function(tmp$0){ - this.$vitality = tmp$0; - } - , increaseVitality:function(delta){ - { - this.set_vitality(this.get_vitality() + delta); - if (this.get_vitality() > 65535) - this.set_vitality(65535); - } - } - }); - return {Slot:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var s = new Anonymous.Slot; - s.increaseVitality(1000); - if (s.get_vitality() == 11000) - return 'OK'; - else - return 'fail'; - } -} -}, {Slot:classes.Slot}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/inheritedMethod.js b/k2js/translator/testFiles/examples/out/inheritedMethod.js deleted file mode 100644 index d7760fa7097..00000000000 --- a/k2js/translator/testFiles/examples/out/inheritedMethod.js +++ /dev/null @@ -1,37 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , xyzzy:function(){ - { - return 'xyzzy'; - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - } - , test:function(){ - { - return this.xyzzy(); - } - } - }); - return {Bar:tmp$1, Foo:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var bar = new Anonymous.Bar; - var f = bar.test(); - if (f == 'xyzzy') - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -}, {Foo:classes.Foo, Bar:classes.Bar}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/initializerBlock.js b/k2js/translator/testFiles/examples/out/initializerBlock.js deleted file mode 100644 index b6e7745ddf5..00000000000 --- a/k2js/translator/testFiles/examples/out/initializerBlock.js +++ /dev/null @@ -1,28 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - { - this.$f = 610; - } - } - , get_f:function(){ - return this.$f; - } - , set_f:function(tmp$0){ - this.$f = tmp$0; - } - }); - return {C:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new Anonymous.C; - if (c.get_f() != 610) - return 'fail'; - return 'OK'; - } -} -}, {C:classes.C}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/initializerBlockDImpl.js b/k2js/translator/testFiles/examples/out/initializerBlockDImpl.js deleted file mode 100644 index 3d204758755..00000000000 --- a/k2js/translator/testFiles/examples/out/initializerBlockDImpl.js +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - classes = function(){ - var World = Kotlin.Class.create({initialize:function(){ - this.$items = new Kotlin.ArrayList; - this.$foo = new this.Item; - } - , get_items:function(){ - return this.$items; - } - , get_foo:function(){ - return this.$foo; - } - }); - return {World:World}; - } - (); - Anonymous = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - var w = new Anonymous.World; - if (w.get_items().size() !== 1) - return 'fail'; - return 'OK'; - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/examples/out/jquery.js b/k2js/translator/testFiles/examples/out/jquery.js deleted file mode 100644 index 8e19dfc32ed..00000000000 --- a/k2js/translator/testFiles/examples/out/jquery.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var Anonymous = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var aa = Kotlin.jQuery('a').attr('a'); - return 'OK'; - } - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/examples/out/kt242.js b/k2js/translator/testFiles/examples/out/kt242.js deleted file mode 100644 index b3b19087add..00000000000 --- a/k2js/translator/testFiles/examples/out/kt242.js +++ /dev/null @@ -1,32 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var i = 7; - var j = null; - var k = 7; - if (i == 7) { - } - if (7 == i) { - } - if (j == 7) { - } - if (7 == j) { - } - if (i == k) { - } - if (k == i) { - } - if (j == k) { - } - if (k == j) { - } - return 'OK'; - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/kt248.js b/k2js/translator/testFiles/examples/out/kt248.js deleted file mode 100644 index 9fa7468f699..00000000000 --- a/k2js/translator/testFiles/examples/out/kt248.js +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - classes = function(){ - return {}; - } - (); - Anonymous = Namespace.create({initialize:function(){ - } - , box:function(){ - var b = true; - var i = 1; - var j = 1; - var s = 's'; - return 'OK'; - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/examples/out/kt446.js b/k2js/translator/testFiles/examples/out/kt446.js deleted file mode 100644 index 2cf69d1b63c..00000000000 --- a/k2js/translator/testFiles/examples/out/kt446.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - classes = function(){ - return {}; - } - (); - Anonymous = Namespace.create({initialize:function(){ - } - , box:function(){ - var s = 's'; - s += 1; - return s === 's1'?'OK':'fail'; - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/examples/out/newInstanceDefaultConstructor.js b/k2js/translator/testFiles/examples/out/newInstanceDefaultConstructor.js deleted file mode 100644 index d4ed4fcf556..00000000000 --- a/k2js/translator/testFiles/examples/out/newInstanceDefaultConstructor.js +++ /dev/null @@ -1,25 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , foo:function(){ - { - return 610; - } - } - }); - return {SimpleClass:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new Anonymous.SimpleClass; - if (c.foo() == 610) { - return 'OK'; - } - return 'FAIL'; - } -} -}, {SimpleClass:classes.SimpleClass}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/overloadBinaryOperator.js b/k2js/translator/testFiles/examples/out/overloadBinaryOperator.js deleted file mode 100644 index 5f488407a1c..00000000000 --- a/k2js/translator/testFiles/examples/out/overloadBinaryOperator.js +++ /dev/null @@ -1,43 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$contents = new Kotlin.ArrayList; - } - , get_contents:function(){ - return this.$contents; - } - , add:function(item){ - { - this.get_contents().add(item); - } - } - , plus:function(b){ - { - var result = new Anonymous.ArrayWrapper; - result.get_contents().addAll(this.get_contents()); - result.get_contents().addAll(b.get_contents()); - return result; - } - } - }); - return {ArrayWrapper:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var v1 = new Anonymous.ArrayWrapper; - var v2 = new Anonymous.ArrayWrapper; - v1.add('foo'); - v2.add('bar'); - var v3 = v1.plus(v2); - if (v3.get_contents().size() == 2) - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -}, {ArrayWrapper:classes.ArrayWrapper}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/overloadPlusAssignReturn.js b/k2js/translator/testFiles/examples/out/overloadPlusAssignReturn.js deleted file mode 100644 index eaaa7e822bc..00000000000 --- a/k2js/translator/testFiles/examples/out/overloadPlusAssignReturn.js +++ /dev/null @@ -1,46 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$contents = new Kotlin.ArrayList; - } - , get_contents:function(){ - return this.$contents; - } - , add:function(item){ - { - this.get_contents().add(item); - } - } - , plusAssign:function(rhs){ - { - this.get_contents().addAll(rhs.get_contents()); - } - } - , get:function(index){ - { - return this.get_contents().get(index); - } - } - }); - return {ArrayWrapper:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var v1 = new Anonymous.ArrayWrapper; - var v2 = new Anonymous.ArrayWrapper; - v1.add('foo'); - var v3 = v1; - v2.add('bar'); - v1.plusAssign(v2); - if (v1.get_contents().size() == 2 && v3.get_contents().size() == 2) - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -}, {ArrayWrapper:classes.ArrayWrapper}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/overloadPlusToPlusAssign.js b/k2js/translator/testFiles/examples/out/overloadPlusToPlusAssign.js deleted file mode 100644 index cab890a4d6d..00000000000 --- a/k2js/translator/testFiles/examples/out/overloadPlusToPlusAssign.js +++ /dev/null @@ -1,49 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$contents = new Kotlin.ArrayList; - } - , get_contents:function(){ - return this.$contents; - } - , add:function(item){ - { - this.get_contents().add(item); - } - } - , plus:function(rhs){ - { - var result = new Anonymous.ArrayWrapper; - result.get_contents().addAll(this.get_contents()); - result.get_contents().addAll(rhs.get_contents()); - return result; - } - } - , get:function(index){ - { - return this.get_contents().get(index); - } - } - }); - return {ArrayWrapper:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var v1 = new Anonymous.ArrayWrapper; - var v2 = new Anonymous.ArrayWrapper; - v1.add('foo'); - var v3 = v1; - v2.add('bar'); - v1 = v1.plus(v2); - if (v1.get_contents().size() == 2 && v3.get_contents().size() == 1) - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -}, {ArrayWrapper:classes.ArrayWrapper}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/overloadUnaryOperator.js b/k2js/translator/testFiles/examples/out/overloadUnaryOperator.js deleted file mode 100644 index d34c9c395c9..00000000000 --- a/k2js/translator/testFiles/examples/out/overloadUnaryOperator.js +++ /dev/null @@ -1,57 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$contents = new Kotlin.ArrayList; - } - , get_contents:function(){ - return this.$contents; - } - , add:function(item){ - { - this.get_contents().add(item); - } - } - , minus:function(){ - { - var tmp$0; - var result = new Anonymous.ArrayWrapper; - result.get_contents().addAll(this.get_contents()); - var i = this.get_contents().size(); - { - tmp$0 = this.get_contents().iterator(); - while (tmp$0.hasNext()) { - var a = tmp$0.next(); - { - result.get_contents().set(--i, a); - } - } - } - return result; - } - } - , get:function(index){ - { - return this.get_contents().get(index); - } - } - }); - return {ArrayWrapper:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var v1 = new Anonymous.ArrayWrapper; - v1.add('foo'); - v1.add('bar'); - var v2 = v1.minus(); - if (v2.get(0) == 'bar' && v2.get(1) == 'foo') - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -}, {ArrayWrapper:classes.ArrayWrapper}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/propertyDelegation.js b/k2js/translator/testFiles/examples/out/propertyDelegation.js deleted file mode 100644 index ad0ee0ddbd9..00000000000 --- a/k2js/translator/testFiles/examples/out/propertyDelegation.js +++ /dev/null @@ -1,68 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({}); - var tmp$1 = Kotlin.Class.create({initialize:function(){ - this.$plain = 239; - this.$readwrite = 0; - } - , get_plain:function(){ - return this.$plain; - } - , get_read:function(){ - { - return 239; - } - } - , get_readwrite:function(){ - { - return this.$readwrite + 1; - } - } - , set_readwrite:function(n){ - { - this.$readwrite = n; - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - } - }); - var tmp$3 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - } - }); - return {Base:tmp$1, Derived2:tmp$2, Derived1:tmp$3, Abstract:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, code:function(s){ - { - if (s.get_plain() != 239) - return 1; - if (s.get_read() != 239) - return 2; - s.set_readwrite(238); - if (s.get_readwrite() != 239) - return 3; - return 0; - } -} -, test:function(s){ - { - return Anonymous.code(s) == 0; - } -} -, box:function(){ - { - if (!Anonymous.test(new Anonymous.Base)) - return 'Fail #1'; - if (!Anonymous.test(new Anonymous.Derived1)) - return 'Fail #2'; - if (!Anonymous.test(new Anonymous.Derived2)) - return 'Fail #3'; - return 'OK'; - } -} -}, {Base:classes.Base, Abstract:classes.Abstract, Derived1:classes.Derived1, Derived2:classes.Derived2}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/rightHandOverride.js b/k2js/translator/testFiles/examples/out/rightHandOverride.js deleted file mode 100644 index 26fdddc2654..00000000000 --- a/k2js/translator/testFiles/examples/out/rightHandOverride.js +++ /dev/null @@ -1,37 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , f:function(){ - { - return 42; - } - } - }); - var tmp$1 = Kotlin.Trait.create({}); - var tmp$2 = Kotlin.Class.create(tmp$0, tmp$1, {initialize:function(){ - this.super_init(); - } - , f:function(){ - { - return 239; - } - } - }); - return {Left:tmp$1, D:tmp$2, Right:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var r = new Anonymous.Right; - var d = new Anonymous.D; - if (r.f() != 42) - return 'Fail #1'; - if (d.f() != 239) - return 'Fail #2'; - return 'OK'; - } -} -}, {Left:classes.Left, Right:classes.Right, D:classes.D}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/simplestClosure.js b/k2js/translator/testFiles/examples/out/simplestClosure.js deleted file mode 100644 index d0d632f712e..00000000000 --- a/k2js/translator/testFiles/examples/out/simplestClosure.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return Anonymous.invoker(function(){ - { - return 'OK'; - } - } - ); - } -} -, invoker:function(gen){ - { - return gen(); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/examples/out/simplestClosureAndBoxing.js b/k2js/translator/testFiles/examples/out/simplestClosureAndBoxing.js deleted file mode 100644 index ddfb2abdd0e..00000000000 --- a/k2js/translator/testFiles/examples/out/simplestClosureAndBoxing.js +++ /dev/null @@ -1,28 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - if (Anonymous.int_invoker(function(){ - { - return 7; - } - } - ) == 7) - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -, int_invoker:function(gen){ - { - return gen(); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/expression/conditional/out/elseif.js b/k2js/translator/testFiles/expression/conditional/out/elseif.js deleted file mode 100644 index fc777c6cc98..00000000000 --- a/k2js/translator/testFiles/expression/conditional/out/elseif.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var a = 2; - var b = 3; - var c = 4; - if (a < 2) { - return a; - } - else if (a > 2) { - return b; - } - else if (a == c) { - return c; - } - else { - return 5; - } - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/conditional/out/if.js b/k2js/translator/testFiles/expression/conditional/out/if.js deleted file mode 100644 index 1e7f752385a..00000000000 --- a/k2js/translator/testFiles/expression/conditional/out/if.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var a = 2; - var b = 3; - var c = 4; - if (a < 2) { - return a; - } - if (a > 2) { - return b; - } - if (a == c) { - return c; - } - else { - return 5; - } - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/conditional/out/ifAsExpressionWithThrow.js b/k2js/translator/testFiles/expression/conditional/out/ifAsExpressionWithThrow.js deleted file mode 100644 index fb918e77094..00000000000 --- a/k2js/translator/testFiles/expression/conditional/out/ifAsExpressionWithThrow.js +++ /dev/null @@ -1,18 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - var tmp$0; - if (true) - throw new Kotlin.Exception; - else - tmp$0 = false; - { - return tmp$0; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/conditional/out/ifElseAsExpression.js b/k2js/translator/testFiles/expression/conditional/out/ifElseAsExpression.js deleted file mode 100644 index ade1f8928b6..00000000000 --- a/k2js/translator/testFiles/expression/conditional/out/ifElseAsExpression.js +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var tmp$0; - var a = 2; - if (a == 2) - tmp$0 = true; - else - tmp$0 = false; - return tmp$0; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/for/out/forIteratesOverArray.js b/k2js/translator/testFiles/expression/for/out/forIteratesOverArray.js deleted file mode 100644 index b9b88e76207..00000000000 --- a/k2js/translator/testFiles/expression/for/out/forIteratesOverArray.js +++ /dev/null @@ -1,36 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a1 = Kotlin.nullArray(10); -} -, get_a1:function(){ - return $a1; -} -, box:function(){ - { - var tmp$0; - var c = 0; - var d = 0; - foo.get_a1()[3] = 3; - foo.get_a1()[5] = 5; - { - tmp$0 = Kotlin.arrayIterator(foo.get_a1()); - while (tmp$0.hasNext()) { - var a = tmp$0.next(); - { - if (a != null) { - c += 1; - } - else { - d += 1; - } - } - } - } - return c == 2 && d == 8; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/for/out/forOnEmptyArray.js b/k2js/translator/testFiles/expression/for/out/forOnEmptyArray.js deleted file mode 100644 index 238a9adac77..00000000000 --- a/k2js/translator/testFiles/expression/for/out/forOnEmptyArray.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a1 = Kotlin.nullArray(0); -} -, get_a1:function(){ - return $a1; -} -, box:function(){ - { - var tmp$0; - { - tmp$0 = Kotlin.arrayIterator(foo.get_a1()); - while (tmp$0.hasNext()) { - var a = tmp$0.next(); - { - return false; - } - } - } - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/KT-921.js b/k2js/translator/testFiles/expression/function/out/KT-921.js deleted file mode 100644 index d1e2f1d2dbf..00000000000 --- a/k2js/translator/testFiles/expression/function/out/KT-921.js +++ /dev/null @@ -1,115 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$items = new Kotlin.ArrayList; - } - , get_items:function(){ - return this.$items; - } - , add:function(item){ - { - this.get_items().add(item); - } - } - , remove:function(item){ - { - this.get_items().remove(item); - } - } - , view:function(lifetime, viewer){ - { - var tmp$0; - { - tmp$0 = this.get_items().iterator(); - while (tmp$0.hasNext()) { - var item = tmp$0.next(); - { - viewer(lifetime, item); - } - } - } - } - } - }); - var tmp$1 = Kotlin.Class.create({initialize:function(){ - this.$attached = new Kotlin.ArrayList; - } - , get_attached:function(){ - return this.$attached; - } - , attach:function(action){ - { - this.get_attached().add(action); - } - } - , close_0:function(){ - { - var tmp$0; - { - tmp$0 = this.get_attached().iterator(); - while (tmp$0.hasNext()) { - var x = tmp$0.next(); - { - x(); - } - } - } - this.get_attached().clear(); - } - } - }); - return {Lifetime:tmp$1, Viewable:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, lifetime:function(body){ - { - var l = new Anonymous.Lifetime; - body(l); - l.close_0(); - } -} -, Dump:function(items){ - { - var tmp$0; - { - tmp$0 = items.iterator(); - while (tmp$0.hasNext()) { - var item = tmp$0.next(); - { - Kotlin.print(jet.toString(item) + ', '); - } - } - } - Kotlin.println(); - } -} -, main:function(args){ - { - var v = new Anonymous.Viewable; - var x = new Kotlin.ArrayList; - v.add(1); - v.add(2); - Anonymous.lifetime(function(it){ - { - v.view(it, function(itemLifetime, item){ - { - x.add(item); - Anonymous.Dump(x); - itemLifetime.attach(function(){ - { - x.remove(item); - Anonymous.Dump(x); - } - } - ); - } - } - ); - } - } - ); - } -} -}, {Lifetime:classes.Lifetime, Viewable:classes.Viewable}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/adderClosure.js b/k2js/translator/testFiles/expression/function/out/adderClosure.js deleted file mode 100644 index 5c66dfd3ca8..00000000000 --- a/k2js/translator/testFiles/expression/function/out/adderClosure.js +++ /dev/null @@ -1,22 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var sum = 0; - var adder = function(a){ - { - sum += a; - } - } - ; - adder(3); - adder(2); - return sum == 5; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/closureWithParameter.js b/k2js/translator/testFiles/expression/function/out/closureWithParameter.js deleted file mode 100644 index d00213404f4..00000000000 --- a/k2js/translator/testFiles/expression/function/out/closureWithParameter.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return foo.apply('OK', function(arg){ - { - return arg; - } - } - ); - } -} -, apply:function(arg, f){ - { - return f(arg); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/closureWithParameterAndBoxing.js b/k2js/translator/testFiles/expression/function/out/closureWithParameterAndBoxing.js deleted file mode 100644 index 7688c70ab67..00000000000 --- a/k2js/translator/testFiles/expression/function/out/closureWithParameterAndBoxing.js +++ /dev/null @@ -1,28 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - if (foo.apply(5, function(arg){ - { - return arg + 13; - } - } - ) == 18) - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -, apply:function(arg, f){ - { - return f(arg); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/defaultParameters.js b/k2js/translator/testFiles/expression/function/out/defaultParameters.js deleted file mode 100644 index 2b08a8210e6..00000000000 --- a/k2js/translator/testFiles/expression/function/out/defaultParameters.js +++ /dev/null @@ -1,26 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, f:function(a, b){ - { - return a + b; - } -} -, box:function(){ - { - if (foo.f(1, 2) != 3) - return false; - if (foo.f(1, 3) != 4) - return false; - if (foo.f(3, 3) != 6) - return false; - if (foo.f(2, 3) != 5) - return false; - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/enclosingThis.js b/k2js/translator/testFiles/expression/function/out/enclosingThis.js deleted file mode 100644 index 3c2c756ba2d..00000000000 --- a/k2js/translator/testFiles/expression/function/out/enclosingThis.js +++ /dev/null @@ -1,45 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(x, y){ - this.$x = x; - this.$y = y; - } - , get_x:function(){ - return this.$x; - } - , get_y:function(){ - return this.$y; - } - , mul:function(){ - { - var tmp$0; - return tmp$0 = this , function(scalar){ - { - return new Anonymous.Point(tmp$0.get_x() * scalar, tmp$0.get_y() * scalar); - } - } - ; - } - } - }); - return {Point:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ - $m = (new Anonymous.Point(2, 3)).mul(); -} -, get_m:function(){ - return $m; -} -, box:function(){ - { - var tmp$0; - var answer = Anonymous.get_m()(5); - if (answer.get_x() == 10 && answer.get_y() == 15) - tmp$0 = 'OK'; - else - tmp$0 = 'FAIL'; - return tmp$0; - } -} -}, {Point:classes.Point}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/expressionAsFunction.js b/k2js/translator/testFiles/expression/function/out/expressionAsFunction.js deleted file mode 100644 index e21ec08d719..00000000000 --- a/k2js/translator/testFiles/expression/function/out/expressionAsFunction.js +++ /dev/null @@ -1,88 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $d = function(a){ - { - return a + 1; - } - } - ; - $p = function(a){ - { - return a * 3; - } - } - ; - $list = new Kotlin.ArrayList; -} -, get_d:function(){ - return $d; -} -, get_p:function(){ - return $p; -} -, get_list:function(){ - return $list; -} -, chain:function(start){ - { - var tmp$0; - var res = start; - { - tmp$0 = foo.get_list().iterator(); - while (tmp$0.hasNext()) { - var func = tmp$0.next(); - { - res = func(res); - } - } - } - return res; - } -} -, box:function(){ - { - if (foo.chain(0) != 0) { - return false; - } - foo.get_list().add(foo.get_d()); - if (foo.get_list().get(0)(0) != 1) { - return false; - } - foo.get_list().add(foo.get_p()); - if (foo.get_list().get(1)(10) != 30) { - return false; - } - if (foo.chain(0) != 3) { - return false; - } - foo.get_list().add(function(it){ - { - return it * it; - } - } - ); - foo.get_list().add(function(it){ - { - return it - 100; - } - } - ); - if (foo.chain(2) != -19) { - return false; - } - if (function(a){ - { - return a * a; - } - } - (3) != 9) { - return false; - } - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/functionInsideFunction.js b/k2js/translator/testFiles/expression/function/out/functionInsideFunction.js deleted file mode 100644 index e96efde42e6..00000000000 --- a/k2js/translator/testFiles/expression/function/out/functionInsideFunction.js +++ /dev/null @@ -1,37 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - function f(){ - { - return 3; - } - } - - return f() + f() == 6 && foo.b() == 24; - } -} -, b:function(){ - { - function a(){ - { - function c(){ - { - return 4; - } - } - - return c() * 3; - } - } - - var a$0 = 2; - return a() * a$0; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/functionLiteral.js b/k2js/translator/testFiles/expression/function/out/functionLiteral.js deleted file mode 100644 index b72884eedca..00000000000 --- a/k2js/translator/testFiles/expression/function/out/functionLiteral.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var sum = 0; - var addFive = function(a){ - { - return a + 5; - } - } - ; - sum = addFive(sum); - return sum == 5; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/functionLiteralAsLastParameter.js b/k2js/translator/testFiles/expression/function/out/functionLiteralAsLastParameter.js deleted file mode 100644 index 7a455995c5a..00000000000 --- a/k2js/translator/testFiles/expression/function/out/functionLiteralAsLastParameter.js +++ /dev/null @@ -1,32 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, f:function(a){ - { - return a(1); - } -} -, box:function(){ - { - if (foo.f(function(it){ - { - return it + 2; - } - } - ) != 3) - return false; - if (foo.f(function(a){ - { - return a * 300; - } - } - ) != 300) - return false; - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/functionLiteralAsParameter.js b/k2js/translator/testFiles/expression/function/out/functionLiteralAsParameter.js deleted file mode 100644 index 8d97ec5fb70..00000000000 --- a/k2js/translator/testFiles/expression/function/out/functionLiteralAsParameter.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, apply:function(f, t){ - { - return f(t); - } -} -, box:function(){ - { - return foo.apply(function(a){ - { - return a + 5; - } - } - , 3) == 8; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/functionUsedBeforeDeclaration.js b/k2js/translator/testFiles/expression/function/out/functionUsedBeforeDeclaration.js deleted file mode 100644 index b34d6e96aac..00000000000 --- a/k2js/translator/testFiles/expression/function/out/functionUsedBeforeDeclaration.js +++ /dev/null @@ -1,18 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return foo.f(); - } -} -, f:function(){ - { - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/functionWithTwoParametersCall.js b/k2js/translator/testFiles/expression/function/out/functionWithTwoParametersCall.js deleted file mode 100644 index 73a04aaf12e..00000000000 --- a/k2js/translator/testFiles/expression/function/out/functionWithTwoParametersCall.js +++ /dev/null @@ -1,18 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, sum:function(param1, param2){ - { - return param1 + param2; - } -} -, box:function(){ - { - return foo.sum(1, 5) == 6; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/implicitItParameter.js b/k2js/translator/testFiles/expression/function/out/implicitItParameter.js deleted file mode 100644 index 12f0b1da6e8..00000000000 --- a/k2js/translator/testFiles/expression/function/out/implicitItParameter.js +++ /dev/null @@ -1,37 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, test:function(f, p){ - { - return f(p); - } -} -, box:function(){ - { - if (!foo.test(function(it){ - { - return it + 1 == 2; - } - } - , 1)) - return false; - if (!foo.test(function(it){ - { - return it > 1; - } - } - , 3)) - return false; - return foo.test(function(it){ - { - return it < 1 == false; - } - } - , 1); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/loopClosure.js b/k2js/translator/testFiles/expression/function/out/loopClosure.js deleted file mode 100644 index de725a25368..00000000000 --- a/k2js/translator/testFiles/expression/function/out/loopClosure.js +++ /dev/null @@ -1,34 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $b = 0; -} -, get_b:function(){ - return $b; -} -, set_b:function(tmp$0){ - $b = tmp$0; -} -, loop:function(times){ - { - while (times > 0) { - var u = function(value){ - { - foo.set_b(foo.get_b() + 1); - } - } - ; - u(times--); - } - } -} -, box:function(){ - { - foo.loop(5); - return foo.get_b() == 5; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/namedArguments.js b/k2js/translator/testFiles/expression/function/out/namedArguments.js deleted file mode 100644 index e33cccbd6c0..00000000000 --- a/k2js/translator/testFiles/expression/function/out/namedArguments.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, test:function(x, y){ - { - return y - x; - } -} -, box:function(){ - { - if (foo.test(1, 2) != 1) { - return false; - } - if (foo.test(1, 2) != 1) { - return false; - } - if (foo.test(1, 2) != 1) { - return false; - } - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/function/out/vararg.js b/k2js/translator/testFiles/expression/function/out/vararg.js deleted file mode 100644 index 3e93b7088b6..00000000000 --- a/k2js/translator/testFiles/expression/function/out/vararg.js +++ /dev/null @@ -1,34 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, testSize:function(expectedSize, i){ - { - return i.length == expectedSize; - } -} -, testSum:function(expectedSum, i){ - { - var tmp$0; - var sum = 0; - { - tmp$0 = Kotlin.arrayIterator(i); - while (tmp$0.hasNext()) { - var j = tmp$0.next(); - { - sum += j; - } - } - } - return expectedSum == sum; - } -} -, box:function(){ - { - return foo.testSize(0, []) && foo.testSum(0, []) && foo.testSize(3, [1, 1, 1]) && foo.testSum(3, [1, 1, 1]) && foo.testSize(6, [1, 1, 1, 2, 3, 4]) && foo.testSum(30, [10, 20, 0]); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/misc/out/KT-962.js b/k2js/translator/testFiles/expression/misc/out/KT-962.js deleted file mode 100644 index c854c5d32be..00000000000 --- a/k2js/translator/testFiles/expression/misc/out/KT-962.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var Anonymous = Kotlin.Namespace.create({initialize:function(){ - } - , stdout:function(){ - { - var tmp$0; - tmp$0 = Kotlin.System.out() , tmp$0 != null?tmp$0.println('stdout'):null; - return Kotlin.System.out(); - } - } - , main:function(args){ - { - var tmp$0; - tmp$0 = Anonymous.stdout() , tmp$0 != null?tmp$0.println('Hello, world!'):null; - } - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/expression/misc/out/intRange.js b/k2js/translator/testFiles/expression/misc/out/intRange.js deleted file mode 100644 index 1c3a79a9e7f..00000000000 --- a/k2js/translator/testFiles/expression/misc/out/intRange.js +++ /dev/null @@ -1,207 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(start, size, reversed){ - this.$start = start; - this.$size = size; - this.$reversed = reversed; - } - , get_start:function(){ - return this.$start; - } - , get_size:function(){ - return this.$size; - } - , get_reversed:function(){ - return this.$reversed; - } - , get_end:function(){ - var tmp$0; - if (this.get_reversed()) - tmp$0 = this.get_start() - this.get_size() + 1; - else - tmp$0 = this.get_start() + this.get_size() - 1; - { - return tmp$0; - } - } - , contains:function(number){ - { - if (this.get_reversed()) { - return number <= this.get_start() && number > this.get_start() - this.get_size(); - } - else { - return number >= this.get_start() && number < this.get_start() + this.get_size(); - } - } - } - , iterator:function(){ - { - return new foo.RangeIterator(this.get_start(), this.get_size(), this.get_reversed()); - } - } - }); - var tmp$1 = Kotlin.Class.create({initialize:function(start, count, reversed){ - this.$start = start; - this.$count = count; - this.$reversed = reversed; - this.$i = this.get_start(); - } - , get_start:function(){ - return this.$start; - } - , get_count:function(){ - return this.$count; - } - , set_count:function(tmp$0){ - this.$count = tmp$0; - } - , get_reversed:function(){ - return this.$reversed; - } - , get_i:function(){ - return this.$i; - } - , set_i:function(tmp$0){ - this.$i = tmp$0; - } - , next:function(){ - { - this.set_count(this.get_count() - 1); - if (this.get_reversed()) { - this.set_i(this.get_i() - 1); - return this.get_i() + 1; - } - else { - this.set_i(this.get_i() + 1); - return this.get_i() - 1; - } - } - } - , hasNext:function(){ - { - return this.get_count() > 0; - } - } - }); - return {RangeIterator:tmp$1, NumberRange:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return foo.testRange() && foo.testReversedRange(); - } -} -, testRange:function(){ - { - var tmp$1; - var tmp$0; - var oneToFive = new foo.NumberRange(1, 4, false); - if (oneToFive.contains(5)) - return false; - if (oneToFive.contains(0)) - return false; - if (oneToFive.contains(-100)) - return false; - if (oneToFive.contains(10)) - return false; - if (!oneToFive.contains(1)) - return false; - if (!oneToFive.contains(2)) - return false; - if (!oneToFive.contains(3)) - return false; - if (!oneToFive.contains(4)) - return false; - if (!(oneToFive.get_start() == 1)) - return false; - if (!(oneToFive.get_size() == 4)) - return false; - if (!(oneToFive.get_end() == 4)) - return false; - var sum = 0; - { - tmp$0 = oneToFive.iterator(); - while (tmp$0.hasNext()) { - var i = tmp$0.next(); - { - sum += i; - } - } - } - { - tmp$1 = oneToFive.iterator(); - while (tmp$1.hasNext()) { - var i$0 = tmp$1.next(); - { - Kotlin.print(i$0); - } - } - } - if (sum != 10) - return false; - return true; - } -} -, testReversedRange:function(){ - { - var tmp$1; - var tmp$0; - Kotlin.println('Testing reversed range.'); - var tenToFive = new foo.NumberRange(10, 5, true); - if (tenToFive.contains(5)) - return false; - if (tenToFive.contains(11)) - return false; - if (tenToFive.contains(-100)) - return false; - if (tenToFive.contains(1000)) - return false; - if (!tenToFive.contains(6)) - return false; - if (!tenToFive.contains(7)) - return false; - if (!tenToFive.contains(8)) - return false; - if (!tenToFive.contains(9)) - return false; - if (!tenToFive.contains(10)) - return false; - if (!(tenToFive.get_start() == 10)) - return false; - if (!(tenToFive.get_size() == 5)) - return false; - if (!(tenToFive.get_end() == 6)) - return false; - { - tmp$0 = tenToFive.iterator(); - while (tmp$0.hasNext()) { - var i = tmp$0.next(); - { - Kotlin.println(i); - } - } - } - var sum = 0; - { - tmp$1 = tenToFive.iterator(); - while (tmp$1.hasNext()) { - var i$0 = tmp$1.next(); - { - sum += i$0; - } - } - } - if (sum != 40) { - return false; - } - return true; - } -} -, main:function(args){ - { - Kotlin.println(foo.box()); - } -} -}, {RangeIterator:classes.RangeIterator, NumberRange:classes.NumberRange}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/misc/out/jquery.js b/k2js/translator/testFiles/expression/misc/out/jquery.js deleted file mode 100644 index 7a0538dc529..00000000000 --- a/k2js/translator/testFiles/expression/misc/out/jquery.js +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var aa = jQuery('a').attr('a'); - return 'OK'; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/misc/out/localProperty.js b/k2js/translator/testFiles/expression/misc/out/localProperty.js deleted file mode 100644 index c5aa34d8228..00000000000 --- a/k2js/translator/testFiles/expression/misc/out/localProperty.js +++ /dev/null @@ -1,24 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $y = 3; -} -, get_y:function(){ - return $y; -} -, f:function(a){ - { - var x = 42; - var y = 50; - return y; - } -} -, box:function(){ - { - return foo.f(foo.get_y()); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/misc/out/safecallComputesExpressionOnlyOnce.js b/k2js/translator/testFiles/expression/misc/out/safecallComputesExpressionOnlyOnce.js deleted file mode 100644 index 7d667c4bb05..00000000000 --- a/k2js/translator/testFiles/expression/misc/out/safecallComputesExpressionOnlyOnce.js +++ /dev/null @@ -1,35 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $i = 0; -} -, get_i:function(){ - return $i; -} -, set_i:function(tmp$0){ - $i = tmp$0; -} -, test:function(){ - var tmp$1; - var tmp$0; - { - return tmp$0 = foo.get_i() , (tmp$1 = tmp$0 , (foo.set_i(tmp$0 + 1) , tmp$1)); - } -} -, box:function(){ - { - if (foo.get_i() != 0) - return false; - foo.test() + 1; - if (foo.get_i() != 1) - return false; - foo.test() - 2; - if (foo.get_i() != 2) - return false; - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/string/out/intInTemplate.js b/k2js/translator/testFiles/expression/string/out/intInTemplate.js deleted file mode 100644 index d4a6ec6d4a6..00000000000 --- a/k2js/translator/testFiles/expression/string/out/intInTemplate.js +++ /dev/null @@ -1,14 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var number = 3; - return 'my age is ' + number; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/string/out/multipleExpressionsInTemplate.js b/k2js/translator/testFiles/expression/string/out/multipleExpressionsInTemplate.js deleted file mode 100644 index 26e4ccee4cb..00000000000 --- a/k2js/translator/testFiles/expression/string/out/multipleExpressionsInTemplate.js +++ /dev/null @@ -1,15 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var right = 2; - var left = 3; - return 'left = ' + left + '\n' + 'right = ' + right + '\n' + 'sum = ' + (left + right) + '\n'; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/string/out/objectToStringCallInTemplate.js b/k2js/translator/testFiles/expression/string/out/objectToStringCallInTemplate.js deleted file mode 100644 index 5b910f020ef..00000000000 --- a/k2js/translator/testFiles/expression/string/out/objectToStringCallInTemplate.js +++ /dev/null @@ -1,36 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(i){ - this.$i = i; - } - , get_i:function(){ - return this.$i; - } - , set_i:function(tmp$0){ - this.$i = tmp$0; - } - , toString:function(){ - { - return 'a' + this.get_i(); - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var p = new foo.A(2); - var n = new foo.A(1); - if (p + n != 'a2a1') { - return false; - } - if (new foo.A(10) != 'a10') { - return false; - } - return true; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/string/out/stringAssignment.js b/k2js/translator/testFiles/expression/string/out/stringAssignment.js deleted file mode 100644 index c17668a8230..00000000000 --- a/k2js/translator/testFiles/expression/string/out/stringAssignment.js +++ /dev/null @@ -1,16 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = 'bar'; - var b = 'foo'; - b = a; - return b == 'bar'; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/string/out/stringConstant.js b/k2js/translator/testFiles/expression/string/out/stringConstant.js deleted file mode 100644 index 0d120ddcdbb..00000000000 --- a/k2js/translator/testFiles/expression/string/out/stringConstant.js +++ /dev/null @@ -1,14 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = 'String'; - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/string/out/stringInTemplate.js b/k2js/translator/testFiles/expression/string/out/stringInTemplate.js deleted file mode 100644 index 3a33350c76f..00000000000 --- a/k2js/translator/testFiles/expression/string/out/stringInTemplate.js +++ /dev/null @@ -1,14 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var name_0 = 'Hello'; - return 'o' + name_0 + 'o'; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/expression/while/out/breakDoWhile.js b/k2js/translator/testFiles/expression/while/out/breakDoWhile.js deleted file mode 100644 index 18229a1623f..00000000000 --- a/k2js/translator/testFiles/expression/while/out/breakDoWhile.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var i = 0; - do { - if (i == 3) { - break; - } - ++i; - } - while (i < 100); - return i == 3; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/while/out/breakWhile.js b/k2js/translator/testFiles/expression/while/out/breakWhile.js deleted file mode 100644 index 37857b175bb..00000000000 --- a/k2js/translator/testFiles/expression/while/out/breakWhile.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var i = 0; - while (i < 100) { - if (i == 3) { - break; - } - ++i; - } - return i == 3; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/while/out/continueDoWhile.js b/k2js/translator/testFiles/expression/while/out/continueDoWhile.js deleted file mode 100644 index d696274a49a..00000000000 --- a/k2js/translator/testFiles/expression/while/out/continueDoWhile.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var i = 0; - var b = true; - do { - ++i; - if (i >= 1) { - continue; - } - b = false; - } - while (i < 100); - return b; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/while/out/continueWhile.js b/k2js/translator/testFiles/expression/while/out/continueWhile.js deleted file mode 100644 index 4c9a9c699bb..00000000000 --- a/k2js/translator/testFiles/expression/while/out/continueWhile.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var i = 0; - var b = true; - while (i < 100) { - ++i; - if (i >= 1) { - continue; - } - b = false; - } - return b; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/while/out/doWhile.js b/k2js/translator/testFiles/expression/while/out/doWhile.js deleted file mode 100644 index 61ef47b9aea..00000000000 --- a/k2js/translator/testFiles/expression/while/out/doWhile.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var a = 50; - var b = 0; - var c = 0; - do { - b = b + 1; - c = c + 2; - } - while (b < a); - if (c == 100) { - return true; - } - return false; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/while/out/doWhile2.js b/k2js/translator/testFiles/expression/while/out/doWhile2.js deleted file mode 100644 index a426d57c782..00000000000 --- a/k2js/translator/testFiles/expression/while/out/doWhile2.js +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var x = 2; - do { - x = 1; - } - while (3 < 2); - if (x == 1) { - return true; - } - return false; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/while/out/while.js b/k2js/translator/testFiles/expression/while/out/while.js deleted file mode 100644 index c111cd03236..00000000000 --- a/k2js/translator/testFiles/expression/while/out/while.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var a = 50; - var b = 0; - var c = 0; - while (b < a) { - b = b + 1; - c = c + 2; - } - if (c == 100) { - return true; - } - return false; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/expression/while/out/while2.js b/k2js/translator/testFiles/expression/while/out/while2.js deleted file mode 100644 index 15d1c8416ea..00000000000 --- a/k2js/translator/testFiles/expression/while/out/while2.js +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - while (2 < 1) { - return false; - } - return true; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/extensionFunction/out/extensionFunctionOnExpression.js b/k2js/translator/testFiles/extensionFunction/out/extensionFunctionOnExpression.js deleted file mode 100644 index 2c0f1cc737b..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/extensionFunctionOnExpression.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, same:function(receiver){ - { - return receiver; - } -} -, quadruple:function(receiver){ - { - return foo.same(receiver) * 4; - } -} -, box:function(){ - { - return foo.quadruple(3 + 4) == 28; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionFunction/out/extensionInsideFunctionLiteral.js b/k2js/translator/testFiles/extensionFunction/out/extensionInsideFunctionLiteral.js deleted file mode 100644 index 3a47cebd385..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/extensionInsideFunctionLiteral.js +++ /dev/null @@ -1,48 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$m = 0; - } - , get_m:function(){ - return this.$m; - } - , set_m:function(tmp$0){ - this.$m = tmp$0; - } - , eval_0:function(){ - { - var tmp$0_0; - var d = (tmp$0_0 = this , function(){ - { - var tmp$0; - var c = (tmp$0 = tmp$0_0 , function(){ - { - return this + 3; - } - } - ); - tmp$0_0.set_m(tmp$0_0.get_m() + c.call(3)); - } - } - ); - d(); - } - } - }); - return {M:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = new foo.M; - if (a.get_m() != 0) - return false; - a.eval_0(); - if (a.get_m() != 6) - return false; - return true; - } -} -}, {M:classes.M}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionFunction/out/extensionLiteralPassedToFunction.js b/k2js/translator/testFiles/extensionFunction/out/extensionLiteralPassedToFunction.js deleted file mode 100644 index 467922f84a1..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/extensionLiteralPassedToFunction.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, apply:function(i, f){ - { - return f.call(i, 1); - } -} -, box:function(){ - { - return foo.apply(1, function(i){ - { - return i + this; - } - } - ) == 2; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionFunction/out/extensionUsedInsideClass.js b/k2js/translator/testFiles/extensionFunction/out/extensionUsedInsideClass.js deleted file mode 100644 index f7f08128740..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/extensionUsedInsideClass.js +++ /dev/null @@ -1,35 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(a){ - this.$a = a; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - , eval_0:function(){ - { - return foo.f(this); - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, f:function(receiver){ - { - receiver.set_a(3); - return 10; - } -} -, box:function(){ - { - var a = new foo.A(4); - return a.eval_0() == 10 && a.get_a() == 3; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionFunction/out/extensionWithImplicitReceiver.js b/k2js/translator/testFiles/extensionFunction/out/extensionWithImplicitReceiver.js deleted file mode 100644 index 72374531371..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/extensionWithImplicitReceiver.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, same:function(receiver){ - { - return receiver; - } -} -, quadruple:function(receiver){ - { - return foo.same(receiver) * 4; - } -} -, box:function(){ - { - return foo.quadruple(3) == 12; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionFunction/out/generic.js b/k2js/translator/testFiles/extensionFunction/out/generic.js deleted file mode 100644 index 97d87242fa1..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/generic.js +++ /dev/null @@ -1,45 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, findAll:function(receiver, predicate){ - { - var tmp$0; - var result = new Kotlin.ArrayList; - { - tmp$0 = receiver.iterator(); - while (tmp$0.hasNext()) { - var t = tmp$0.next(); - { - if (predicate(t)) - result.add(t); - } - } - } - return result; - } -} -, box:function(){ - { - var tmp$0; - var list = new Kotlin.ArrayList; - list.add(2); - list.add(3); - list.add(5); - var m = foo.findAll(list, function(name_0){ - { - return name_0 < 4; - } - } - ); - if (m.size() == 2) - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionFunction/out/intExtension.js b/k2js/translator/testFiles/extensionFunction/out/intExtension.js deleted file mode 100644 index c69a2a70d73..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/intExtension.js +++ /dev/null @@ -1,18 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, quadruple:function(receiver){ - { - return receiver * 4; - } -} -, box:function(){ - { - return foo.quadruple(3) == 12; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionFunction/out/virtualExtension.js b/k2js/translator/testFiles/extensionFunction/out/virtualExtension.js deleted file mode 100644 index 085459763ef..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/virtualExtension.js +++ /dev/null @@ -1,34 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(a){ - this.$a = a; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - , modify:function(receiver){ - { - return receiver * 3; - } - } - , eval_0:function(){ - { - return this.modify(this.get_a()); - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = new foo.A(4); - return a.eval_0() == 12; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionFunction/out/virtualExtensionOverride.js b/k2js/translator/testFiles/extensionFunction/out/virtualExtensionOverride.js deleted file mode 100644 index 74c14aaf434..00000000000 --- a/k2js/translator/testFiles/extensionFunction/out/virtualExtensionOverride.js +++ /dev/null @@ -1,42 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(a){ - this.$a = a; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - , modify:function(receiver){ - { - return receiver * 3; - } - } - , eval_0:function(){ - { - return this.modify(this.get_a()); - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(a){ - this.super_init(a); - } - , modify:function(receiver){ - { - return receiver - 2; - } - } - }); - return {B:tmp$1, A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A(4)).eval_0() == 12 && (new foo.A(2)).eval_0() == 6 && (new foo.B(3)).eval_0() == 1; - } -} -}, {A:classes.A, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionProperty/out/absExtension.js b/k2js/translator/testFiles/extensionProperty/out/absExtension.js deleted file mode 100644 index eb23945f0ad..00000000000 --- a/k2js/translator/testFiles/extensionProperty/out/absExtension.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, get_abs:function(receiver){ - var tmp$0; - if (receiver > 0) - tmp$0 = receiver; - else - tmp$0 = -receiver; - { - return tmp$0; - } -} -, box:function(){ - { - if (foo.get_abs(4) != 4) - return false; - if (foo.get_abs(-5.2) != 5.2) - return false; - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionProperty/out/propertyWithGetterAndSetter.js b/k2js/translator/testFiles/extensionProperty/out/propertyWithGetterAndSetter.js deleted file mode 100644 index 38995e1f78c..00000000000 --- a/k2js/translator/testFiles/extensionProperty/out/propertyWithGetterAndSetter.js +++ /dev/null @@ -1,46 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$a = 0; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, get_b:function(receiver){ - { - return receiver.get_a() * 3; - } -} -, set_b:function(receiver, c){ - { - receiver.set_a(c - 1); - } -} -, box:function(){ - { - var c = new foo.Test; - if (c.get_a() != 0) - return false; - if (foo.get_b(c) != 0) - return false; - c.set_a(3); - if (foo.get_b(c) != 9) - return false; - foo.set_b(c, 10); - if (c.get_a() != 9) - return false; - if (foo.get_b(c) != 27) - return false; - return true; - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/extensionProperty/out/simplePropertyWithGetter.js b/k2js/translator/testFiles/extensionProperty/out/simplePropertyWithGetter.js deleted file mode 100644 index 45e40284c0e..00000000000 --- a/k2js/translator/testFiles/extensionProperty/out/simplePropertyWithGetter.js +++ /dev/null @@ -1,33 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, get_size:function(receiver){ - { - return receiver.length; - } -} -, get_quadruple:function(receiver){ - { - return receiver * 4; - } -} -, box:function(){ - { - if (foo.get_size('1') != 1) - return false; - if (foo.get_size('11') != 2) - return false; - if (foo.get_size('121' + '123') != 6) - return false; - if (foo.get_quadruple(1) != 4) - return false; - if (foo.get_quadruple(0) != 0) - return false; - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/inheritance/out/baseClassDefinedAfterDerived.js b/k2js/translator/testFiles/inheritance/out/baseClassDefinedAfterDerived.js deleted file mode 100644 index 77c6e4b59b4..00000000000 --- a/k2js/translator/testFiles/inheritance/out/baseClassDefinedAfterDerived.js +++ /dev/null @@ -1,24 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$a = 3; - } - , get_a:function(){ - return this.$a; - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - } - }); - return {A:tmp$1, B:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).get_a() == 3; - } -} -}, {A:classes.A, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/inheritance/out/complexInitializationOrder.js b/k2js/translator/testFiles/inheritance/out/complexInitializationOrder.js deleted file mode 100644 index 93e751ab101..00000000000 --- a/k2js/translator/testFiles/inheritance/out/complexInitializationOrder.js +++ /dev/null @@ -1,54 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$order = ''; - { - this.set_order(this.get_order() + 'A'); - } - } - , get_order:function(){ - return this.$order; - } - , set_order:function(tmp$0){ - this.$order = tmp$0; - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'E'); - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'B'); - } - } - }); - var tmp$3 = Kotlin.Class.create(tmp$2, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'D'); - } - } - }); - var tmp$4 = Kotlin.Class.create(tmp$2, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'C'); - } - } - }); - return {E:tmp$1, B:tmp$2, D:tmp$3, C:tmp$4, A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.C).get_order() == 'ABC' && (new foo.D).get_order() == 'ABD' && (new foo.E).get_order() == 'AE'; - } -} -}, {A:classes.A, B:classes.B, C:classes.C, D:classes.D, E:classes.E}); -foo.initialize(); diff --git a/k2js/translator/testFiles/inheritance/out/definitionOrder.js b/k2js/translator/testFiles/inheritance/out/definitionOrder.js deleted file mode 100644 index c36bbed8040..00000000000 --- a/k2js/translator/testFiles/inheritance/out/definitionOrder.js +++ /dev/null @@ -1,54 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$order = ''; - { - this.set_order(this.get_order() + 'A'); - } - } - , get_order:function(){ - return this.$order; - } - , set_order:function(tmp$0){ - this.$order = tmp$0; - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'B'); - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'D'); - } - } - }); - var tmp$3 = Kotlin.Class.create(tmp$1, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'C'); - } - } - }); - var tmp$4 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'E'); - } - } - }); - return {B:tmp$1, D:tmp$2, C:tmp$3, E:tmp$4, A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.C).get_order() == 'ABC' && (new foo.D).get_order() == 'ABD' && (new foo.E).get_order() == 'AE'; - } -} -}, {C:classes.C, D:classes.D, E:classes.E, B:classes.B, A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/inheritance/out/initializationOrder.js b/k2js/translator/testFiles/inheritance/out/initializationOrder.js deleted file mode 100644 index ce6de580d08..00000000000 --- a/k2js/translator/testFiles/inheritance/out/initializationOrder.js +++ /dev/null @@ -1,40 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$order = ''; - { - this.set_order(this.get_order() + 'A'); - } - } - , get_order:function(){ - return this.$order; - } - , set_order:function(tmp$0){ - this.$order = tmp$0; - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'B'); - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'C'); - } - } - }); - return {B:tmp$1, C:tmp$2, A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.C).get_order() == 'ABC' && (new foo.B).get_order() == 'AB' && (new foo.A).get_order() == 'A'; - } -} -}, {A:classes.A, B:classes.B, C:classes.C}); -foo.initialize(); diff --git a/k2js/translator/testFiles/inheritance/out/initializersOfBasicClassExecute.js b/k2js/translator/testFiles/inheritance/out/initializersOfBasicClassExecute.js deleted file mode 100644 index 899a039ffd5..00000000000 --- a/k2js/translator/testFiles/inheritance/out/initializersOfBasicClassExecute.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$a = 3; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - } - }); - return {B:tmp$1, A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.B).get_a(); - } -} -}, {A:classes.A, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/inheritance/out/methodOverride.js b/k2js/translator/testFiles/inheritance/out/methodOverride.js deleted file mode 100644 index 54747099ea3..00000000000 --- a/k2js/translator/testFiles/inheritance/out/methodOverride.js +++ /dev/null @@ -1,33 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , f:function(){ - { - return 'C f'; - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - } - , f:function(){ - { - return 'D f'; - } - } - }); - return {D:tmp$1, C:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var d = new foo.D; - if (d.f() != 'D f') - return false; - return true; - } -} -}, {C:classes.C, D:classes.D}); -foo.initialize(); diff --git a/k2js/translator/testFiles/inheritance/out/valuePassedToAncestorConstructor.js b/k2js/translator/testFiles/inheritance/out/valuePassedToAncestorConstructor.js deleted file mode 100644 index 7873730c237..00000000000 --- a/k2js/translator/testFiles/inheritance/out/valuePassedToAncestorConstructor.js +++ /dev/null @@ -1,24 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(a){ - this.$b = a; - } - , get_b:function(){ - return this.$b; - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(c){ - this.super_init(c + 2); - } - }); - return {D:tmp$1, C:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.D(0)).get_b() == 2; - } -} -}, {C:classes.C, D:classes.D}); -foo.initialize(); diff --git a/k2js/translator/testFiles/java/arrayList/out/access.js b/k2js/translator/testFiles/java/arrayList/out/access.js deleted file mode 100644 index 85c2a166920..00000000000 --- a/k2js/translator/testFiles/java/arrayList/out/access.js +++ /dev/null @@ -1,16 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = new Kotlin.ArrayList; - a.add(1); - a.add(2); - return a.size() == 2 && a.get(1) == 2 && a.get(0) == 1; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/java/arrayList/out/arrayAccess.js b/k2js/translator/testFiles/java/arrayList/out/arrayAccess.js deleted file mode 100644 index e5a5a5732f7..00000000000 --- a/k2js/translator/testFiles/java/arrayList/out/arrayAccess.js +++ /dev/null @@ -1,17 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = new Kotlin.ArrayList; - a.add(1); - a.add(2); - a.set(1, 100); - return a.size() == 2 && a.get(1) == 100 && a.get(0) == 1; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/java/arrayList/out/emptyList.js b/k2js/translator/testFiles/java/arrayList/out/emptyList.js deleted file mode 100644 index 30442c2b01a..00000000000 --- a/k2js/translator/testFiles/java/arrayList/out/emptyList.js +++ /dev/null @@ -1,14 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = new Kotlin.ArrayList; - return a.size() == 0; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/java/arrayList/out/indexOOB.js b/k2js/translator/testFiles/java/arrayList/out/indexOOB.js deleted file mode 100644 index ce2033fffc9..00000000000 --- a/k2js/translator/testFiles/java/arrayList/out/indexOOB.js +++ /dev/null @@ -1,18 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var arr = new Kotlin.ArrayList; - var i = 0; - while (i++ < 10) { - arr.add(i); - } - return arr.get(10) == 11; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/java/arrayList/out/isEmpty.js b/k2js/translator/testFiles/java/arrayList/out/isEmpty.js deleted file mode 100644 index b9aeef72c37..00000000000 --- a/k2js/translator/testFiles/java/arrayList/out/isEmpty.js +++ /dev/null @@ -1,15 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = new Kotlin.ArrayList; - a.add(3); - return !a.isEmpty() && (new Kotlin.ArrayList).isEmpty(); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/java/arrayList/out/iterate.js b/k2js/translator/testFiles/java/arrayList/out/iterate.js deleted file mode 100644 index 95a829d963c..00000000000 --- a/k2js/translator/testFiles/java/arrayList/out/iterate.js +++ /dev/null @@ -1,29 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var i = 0; - var arr = new Kotlin.ArrayList; - while (i++ < 10) { - arr.add(i); - } - var sum = 0; - { - tmp$0 = arr.iterator(); - while (tmp$0.hasNext()) { - var a = tmp$0.next(); - { - sum += a; - } - } - } - return sum == 55 && arr.size() == 10; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/java/arrayList/out/remove.js b/k2js/translator/testFiles/java/arrayList/out/remove.js deleted file mode 100644 index f2a8ff85833..00000000000 --- a/k2js/translator/testFiles/java/arrayList/out/remove.js +++ /dev/null @@ -1,30 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var i = 0; - var arr = new Kotlin.ArrayList; - while (i++ < 10) { - arr.add(i); - } - arr.remove(2); - var sum = 0; - { - tmp$0 = arr.iterator(); - while (tmp$0.hasNext()) { - var a = tmp$0.next(); - { - sum += a; - } - } - } - return sum == 52 && arr.get(1) == 2 && arr.get(2) == 4 && arr.get(3) == 5 && arr.get(4) == 6 && arr.get(8) == 10; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/multiFile/out/classesInheritedFromOtherFile.js b/k2js/translator/testFiles/multiFile/out/classesInheritedFromOtherFile.js deleted file mode 100644 index 124841c684e..00000000000 --- a/k2js/translator/testFiles/multiFile/out/classesInheritedFromOtherFile.js +++ /dev/null @@ -1,39 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , f:function(){ - { - return 3; - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - } - , f:function(){ - { - return 4; - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, {initialize:function(){ - this.super_init(); - } - , f:function(){ - { - return 5; - } - } - }); - return {B:tmp$1, C:tmp$2, A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).f() == 3 && (new foo.B).f() == 4 && (new foo.C).f() == 5; - } -} -}, {A:classes.A, C:classes.C, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/multiFile/out/functionsVisibleFromOtherFile.js b/k2js/translator/testFiles/multiFile/out/functionsVisibleFromOtherFile.js deleted file mode 100644 index 5ac79b91c17..00000000000 --- a/k2js/translator/testFiles/multiFile/out/functionsVisibleFromOtherFile.js +++ /dev/null @@ -1,18 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, f:function(){ - { - return 3; - } -} -, box:function(){ - { - return foo.f() == 3; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/multiNamespace/out/classesInheritedFromOtherNamespace.js b/k2js/translator/testFiles/multiNamespace/out/classesInheritedFromOtherNamespace.js deleted file mode 100644 index aa747f4705c..00000000000 --- a/k2js/translator/testFiles/multiNamespace/out/classesInheritedFromOtherNamespace.js +++ /dev/null @@ -1,43 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , f:function(){ - { - return 3; - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - } - , f:function(){ - { - return 4; - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, {initialize:function(){ - this.super_init(); - } - , f:function(){ - { - return 5; - } - } - }); - return {B:tmp$1, C:tmp$2, A:tmp$0}; -} -(); -var bar = Kotlin.Namespace.create({initialize:function(){ -} -}, {B:classes.B}); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).f() == 3 && (new bar.B).f() == 4 && (new foo.C).f() == 5; - } -} -}, {A:classes.A, C:classes.C}); -bar.initialize(); -foo.initialize(); diff --git a/k2js/translator/testFiles/multiNamespace/out/functionsVisibleFromOtherNamespace.js b/k2js/translator/testFiles/multiNamespace/out/functionsVisibleFromOtherNamespace.js deleted file mode 100644 index 8c8e2df3872..00000000000 --- a/k2js/translator/testFiles/multiNamespace/out/functionsVisibleFromOtherNamespace.js +++ /dev/null @@ -1,22 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var bar = Kotlin.Namespace.create({initialize:function(){ -} -, f:function(){ - { - return 3; - } -} -}, {}); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return bar.f() == 3; - } -} -}, {}); -bar.initialize(); -foo.initialize(); diff --git a/k2js/translator/testFiles/nameClashes/out/methodOverload.js b/k2js/translator/testFiles/nameClashes/out/methodOverload.js deleted file mode 100644 index f972f0f2339..00000000000 --- a/k2js/translator/testFiles/nameClashes/out/methodOverload.js +++ /dev/null @@ -1,44 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , eval_0:function(){ - { - return 3; - } - } - , eval$0:function(a){ - { - return 4; - } - } - , eval$1:function(a){ - { - return 5; - } - } - , eval$2:function(a, b){ - { - return 6; - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - if ((new foo.A).eval_0() != 3) - return false; - if ((new foo.A).eval$0(2) != 4) - return false; - if ((new foo.A).eval$1('3') != 5) - return false; - if ((new foo.A).eval$2('a', 3) != 6) - return false; - return true; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/object/out/objectDeclaration.js b/k2js/translator/testFiles/object/out/objectDeclaration.js deleted file mode 100644 index e16d8d0e494..00000000000 --- a/k2js/translator/testFiles/object/out/objectDeclaration.js +++ /dev/null @@ -1,41 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $test = Kotlin.object.create({initialize:function(){ - this.$c = 2; - this.$b = 1; - } - , get_c:function(){ - return this.$c; - } - , set_c:function(tmp$0){ - this.$c = tmp$0; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - }); -} -, get_test:function(){ - return $test; -} -, box:function(){ - { - if (foo.get_test().get_c() != 2) - return false; - if (foo.get_test().get_b() != 1) - return false; - foo.get_test().set_c(foo.get_test().get_c() + 10); - if (foo.get_test().get_c() != 12) { - return false; - } - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/object/out/objectInMethod.js b/k2js/translator/testFiles/object/out/objectInMethod.js deleted file mode 100644 index 5a46d78784d..00000000000 --- a/k2js/translator/testFiles/object/out/objectInMethod.js +++ /dev/null @@ -1,35 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , f:function(){ - { - var t = Kotlin.object.create({initialize:function(){ - this.$c = true; - } - , get_c:function(){ - return this.$c; - } - }); - var z = Kotlin.object.create({initialize:function(){ - this.$c = true; - } - , get_c:function(){ - return this.$c; - } - }); - return t.get_c() && z.get_c(); - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).f(); - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/object/out/objectWithMethods.js b/k2js/translator/testFiles/object/out/objectWithMethods.js deleted file mode 100644 index b3c2c9631ec..00000000000 --- a/k2js/translator/testFiles/object/out/objectWithMethods.js +++ /dev/null @@ -1,35 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a = Kotlin.object.create({initialize:function(){ - } - , c:function(){ - { - return 3; - } - } - , b:function(){ - { - return 2; - } - } - }); -} -, get_a:function(){ - return $a; -} -, box:function(){ - { - if (foo.get_a().c() != 3) { - return false; - } - if (foo.get_a().b() != 2) { - return false; - } - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/binaryDivOverload.js b/k2js/translator/testFiles/operatorOverloading/out/binaryDivOverload.js deleted file mode 100644 index 00416f9f4a1..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/binaryDivOverload.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , div:function(other){ - { - return 'hooray'; - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).div(new foo.A) == 'hooray'; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/compareTo.js b/k2js/translator/testFiles/operatorOverloading/out/compareTo.js deleted file mode 100644 index f24bc38db30..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/compareTo.js +++ /dev/null @@ -1,28 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(t){ - this.$i = t; - } - , get_i:function(){ - return this.$i; - } - , set_i:function(tmp$0){ - this.$i = tmp$0; - } - , compareTo:function(other){ - { - return this.get_i() - other.get_i(); - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A(3)).compareTo(new foo.A(2)) > 0 && (new foo.A(2)).compareTo(new foo.A(2)) >= 0 && (new foo.A(1)).compareTo(new foo.A(0)) >= 0 && (new foo.A(2)).compareTo(new foo.A(2)) <= 0 && (new foo.A(3)).compareTo(new foo.A(4)) <= 0 && (new foo.A(0)).compareTo(new foo.A(100)) < 0; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/notOverload.js b/k2js/translator/testFiles/operatorOverloading/out/notOverload.js deleted file mode 100644 index bbd924a0dde..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/notOverload.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , not:function(){ - { - return 'hooray'; - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).not() == 'hooray'; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/operatorOverloadOnPropertyCallGetterAndSetterOnlyOnce.js b/k2js/translator/testFiles/operatorOverloading/out/operatorOverloadOnPropertyCallGetterAndSetterOnlyOnce.js deleted file mode 100644 index 65c1894c232..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/operatorOverloadOnPropertyCallGetterAndSetterOnlyOnce.js +++ /dev/null @@ -1,62 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$gc = 0; - this.$sc = 0; - this.$b = new foo.MyInt(0); - } - , get_gc:function(){ - return this.$gc; - } - , set_gc:function(tmp$0){ - this.$gc = tmp$0; - } - , get_sc:function(){ - return this.$sc; - } - , set_sc:function(tmp$0){ - this.$sc = tmp$0; - } - , get_b:function(){ - { - this.set_gc(this.get_gc() + 1); - return this.$b; - } - } - , set_b:function(a){ - { - this.set_sc(this.get_sc() + 1); - } - } - }); - var tmp$1 = Kotlin.Class.create({initialize:function(i){ - this.$b = i; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , inc:function(){ - { - this.set_b(this.get_b() + 1); - return this; - } - } - }); - return {MyInt:tmp$1, A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - var t = new foo.A; - var d = (tmp$0 = t.get_b() , (tmp$1 = tmp$0 , (t.set_b(tmp$0.inc()) , tmp$1))); - return t.get_sc() == 1 && t.get_gc() == 1; - } -} -}, {MyInt:classes.MyInt, A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/overloadPlusAssignArrayList.js b/k2js/translator/testFiles/operatorOverloading/out/overloadPlusAssignArrayList.js deleted file mode 100644 index 7274e35e0f6..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/overloadPlusAssignArrayList.js +++ /dev/null @@ -1,45 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$contents = new Kotlin.ArrayList; - } - , get_contents:function(){ - return this.$contents; - } - , add:function(item){ - { - this.get_contents().add(item); - } - } - , plusAssign:function(rhs){ - { - this.get_contents().addAll(rhs.get_contents()); - } - } - , get:function(index){ - { - return this.get_contents().get(index); - } - } - }); - return {ArrayWrapper:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var v1 = new foo.ArrayWrapper; - var v2 = new foo.ArrayWrapper; - v1.add('foo'); - v2.add('bar'); - v1.plusAssign(v2); - if (v1.get_contents().size() == 2) - tmp$0 = 'OK'; - else - tmp$0 = 'fail'; - return tmp$0; - } -} -}, {ArrayWrapper:classes.ArrayWrapper}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/overloadedCallOnProperty.js b/k2js/translator/testFiles/operatorOverloading/out/overloadedCallOnProperty.js deleted file mode 100644 index ebdd7877c84..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/overloadedCallOnProperty.js +++ /dev/null @@ -1,40 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$b = 0; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , inc:function(){ - { - var res = new foo.MyInt; - res.set_b(this.get_b()); - res.set_b(res.get_b() + 1); - return res; - } - } - }); - return {MyInt:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a = new foo.MyInt; -} -, get_a:function(){ - return $a; -} -, set_a:function(tmp$0){ - $a = tmp$0; -} -, box:function(){ - { - foo.set_a(foo.get_a().inc()); - foo.set_a(foo.get_a().inc()); - return foo.get_a().get_b() == 2; - } -} -}, {MyInt:classes.MyInt}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/plusAndMinusAsAnExpression.js b/k2js/translator/testFiles/operatorOverloading/out/plusAndMinusAsAnExpression.js deleted file mode 100644 index 44ffaff5163..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/plusAndMinusAsAnExpression.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , plus:function(){ - { - return 'hooray'; - } - } - , minus:function(){ - { - return 'not really'; - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.A; - return c.plus() + c.minus() == 'hooraynot really'; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/plusAssignNoReassign.js b/k2js/translator/testFiles/operatorOverloading/out/plusAssignNoReassign.js deleted file mode 100644 index 0a79624f16c..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/plusAssignNoReassign.js +++ /dev/null @@ -1,31 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$message = ''; - } - , get_message:function(){ - return this.$message; - } - , set_message:function(tmp$0){ - this.$message = tmp$0; - } - , plusAssign:function(other){ - { - this.set_message(this.get_message() + '!'); - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.A; - c.plusAssign(new foo.A); - c.plusAssign(new foo.A); - return c.get_message() == '!!'; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/plusAssignReassign.js b/k2js/translator/testFiles/operatorOverloading/out/plusAssignReassign.js deleted file mode 100644 index e144960088d..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/plusAssignReassign.js +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var A = Kotlin.Class.create({initialize:function(i){ - this.$a = i; - } - , get_a:function(){ - return this.$a; - } - , plusAssign:function(other){ - { - return new foo.A_0(this.get_a() + other.get_a()); - } - } - }); - return {A_0:A}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var c = new foo.A_0(2); - var d = c; - c = c.plusAssign(new foo.A_0(3)); - return c.get_a() == 5 && d.get_a() == 2 && d != c; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/operatorOverloading/out/plusOverload.js b/k2js/translator/testFiles/operatorOverloading/out/plusOverload.js deleted file mode 100644 index c065e779805..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/plusOverload.js +++ /dev/null @@ -1,25 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(a){ - this.$value = a; - } - , get_value:function(){ - return this.$value; - } - , plus:function(other){ - { - return new foo.myInt(this.get_value() + other.get_value()); - } - } - }); - return {myInt:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.myInt(3)).plus(new foo.myInt(5)).get_value() == 8; - } -} -}, {myInt:classes.myInt}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/postfixIncOverload.js b/k2js/translator/testFiles/operatorOverloading/out/postfixIncOverload.js deleted file mode 100644 index 0240d8d94da..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/postfixIncOverload.js +++ /dev/null @@ -1,32 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$b = 0; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , inc:function(){ - { - var res = new foo.MyInt; - res.set_b(res.get_b() + 1); - return res; - } - } - }); - return {MyInt:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.MyInt; - c = c.inc(); - return c.get_b() == 1; - } -} -}, {MyInt:classes.MyInt}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/postfixOnProperty.js b/k2js/translator/testFiles/operatorOverloading/out/postfixOnProperty.js deleted file mode 100644 index fb5239c752a..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/postfixOnProperty.js +++ /dev/null @@ -1,39 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$b = 0; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , inc:function(){ - { - this.set_b(this.get_b() + 1); - return this; - } - } - }); - return {MyInt:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a = new foo.MyInt; -} -, get_a:function(){ - return $a; -} -, set_a:function(tmp$0){ - $a = tmp$0; -} -, box:function(){ - { - var tmp$1; - var tmp$0; - var d = (tmp$0 = foo.get_a() , (tmp$1 = tmp$0 , (foo.set_a(tmp$0.inc()) , tmp$1))); - return foo.get_a().get_b() == 1 && d.get_b() == 1; - } -} -}, {MyInt:classes.MyInt}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/prefixDecOverload.js b/k2js/translator/testFiles/operatorOverloading/out/prefixDecOverload.js deleted file mode 100644 index 5da0b86f62b..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/prefixDecOverload.js +++ /dev/null @@ -1,32 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$b = 0; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , dec:function(){ - { - var res = new foo.MyInt; - res.set_b(res.get_b() + 1); - return res; - } - } - }); - return {MyInt:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.MyInt; - c = c.dec(); - return c.get_b() == 1; - } -} -}, {MyInt:classes.MyInt}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/prefixIncReturnsCorrectValue.js b/k2js/translator/testFiles/operatorOverloading/out/prefixIncReturnsCorrectValue.js deleted file mode 100644 index 0e93cde9f2f..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/prefixIncReturnsCorrectValue.js +++ /dev/null @@ -1,31 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$b = 0; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , dec:function(){ - { - this.set_b(this.get_b() + 1); - return this; - } - } - }); - return {MyInt:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.MyInt; - var d = c = c.dec(); - return c.get_b() == 1; - } -} -}, {MyInt:classes.MyInt}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/unaryOnIntProperty.js b/k2js/translator/testFiles/operatorOverloading/out/unaryOnIntProperty.js deleted file mode 100644 index b18b23064f2..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/unaryOnIntProperty.js +++ /dev/null @@ -1,33 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(i){ - this.$b = i; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , inc:function(){ - { - var tmp$1; - var tmp$0; - this.set_b((tmp$0 = this.get_b() , (tmp$1 = tmp$0 , (this.set_b(tmp$0 + 1) , tmp$1)))); - return this; - } - } - }); - return {MyInt:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var t = new foo.MyInt(0); - t = t.inc(); - return t.get_b() == 0; - } -} -}, {MyInt:classes.MyInt}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/unaryOnIntProperty2.js b/k2js/translator/testFiles/operatorOverloading/out/unaryOnIntProperty2.js deleted file mode 100644 index e29c7abcd53..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/unaryOnIntProperty2.js +++ /dev/null @@ -1,31 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(i){ - this.$b = i; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , inc:function(){ - { - this.set_b(this.get_b() + 1); - return this; - } - } - }); - return {MyInt:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var t = new foo.MyInt(0); - t = t.inc(); - return t.get_b() == 1; - } -} -}, {MyInt:classes.MyInt}); -foo.initialize(); diff --git a/k2js/translator/testFiles/operatorOverloading/out/usingModInCaseModAssignNotAvailable.js b/k2js/translator/testFiles/operatorOverloading/out/usingModInCaseModAssignNotAvailable.js deleted file mode 100644 index 5a15936649f..00000000000 --- a/k2js/translator/testFiles/operatorOverloading/out/usingModInCaseModAssignNotAvailable.js +++ /dev/null @@ -1,31 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$p = 'yeah'; - } - , get_p:function(){ - return this.$p; - } - , set_p:function(tmp$0){ - this.$p = tmp$0; - } - , mod:function(other){ - { - return new foo.A; - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.A; - var d = c; - c = c.mod(new foo.A); - return c != d && c.get_p() == 'yeah'; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/matchNullableType.js b/k2js/translator/testFiles/patternMatching/out/matchNullableType.js deleted file mode 100644 index 9ee8d54edfb..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/matchNullableType.js +++ /dev/null @@ -1,28 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - var a = null; - for (tmp$0 = 0; tmp$0 < 2; ++tmp$0) { - if (tmp$0 == 0) - if (a == null || Kotlin.isType(a, foo.A)) { - return true; - break; - } - if (tmp$0 == 1) - return false; - } - tmp$1; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/multipleCases.js b/k2js/translator/testFiles/patternMatching/out/multipleCases.js deleted file mode 100644 index 8f430ce7f24..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/multipleCases.js +++ /dev/null @@ -1,42 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$3; - var tmp$2; - var tmp$1; - var tmp$0; - var c = 3; - var d = 5; - var z = 0; - for (tmp$0 = 0; tmp$0 < 2; ++tmp$0) { - if (tmp$0 == 0) - if (c == 5 || c == 3) { - tmp$1 = z++; - break; - } - if (tmp$0 == 1) { - tmp$1 = z = -1000; - } - } - tmp$1; - for (tmp$2 = 0; tmp$2 < 2; ++tmp$2) { - if (tmp$2 == 0) - if (d == 5 || d == 3) { - tmp$3 = z++; - break; - } - if (tmp$2 == 1) { - tmp$3 = z = -1000; - } - } - tmp$3; - return z; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/whenAsExpression.js b/k2js/translator/testFiles/patternMatching/out/whenAsExpression.js deleted file mode 100644 index eb5e00cc30c..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenAsExpression.js +++ /dev/null @@ -1,29 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - for (tmp$0 = 0; tmp$0 < 3; ++tmp$0) { - if (tmp$0 == 0) - if (1 == 2) { - tmp$1 = 3; - break; - } - if (tmp$0 == 1) - if (1 == 1) { - tmp$1 = 1; - break; - } - if (tmp$0 == 2) - tmp$1 = 5; - } - return tmp$1 == 1; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/whenAsExpressionWithThrow.js b/k2js/translator/testFiles/patternMatching/out/whenAsExpressionWithThrow.js deleted file mode 100644 index d286fc3bc0d..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenAsExpressionWithThrow.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - return {}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var tmp$1; - var tmp$0; - for (tmp$0 = 0; tmp$0 < 3; ++tmp$0) { - if (tmp$0 == 0) - if (1 == 3) { - { - tmp$1 = 3; - } - break; - } - if (tmp$0 == 1) - if (1 == 1) { - { - throw new Kotlin.Exception; - } - break; - } - if (tmp$0 == 2) { - return false; - } - } - tmp$1; - return false; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/patternMatching/out/whenConditionMethodCall.js b/k2js/translator/testFiles/patternMatching/out/whenConditionMethodCall.js deleted file mode 100644 index 84fcd78a049..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenConditionMethodCall.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - classes = function(){ - var A = Class.create({initialize:function(){ - } - , p:function(){ - return true; - } - }); - return {A:A}; - } - (); - foo = Namespace.create({initialize:function(){ - } - , box:function(){ - var a = 0; - for (var tmp$0 = 0; tmp$0 < 4; ++tmp$0) { - if (tmp$0 == 0) - if ((new foo.A).p() === true) { - a--; - break; - } - if (tmp$0 == 1) - if (new foo.A === null || isType(new foo.A, foo.A)) { - a++; - break; - } - if (tmp$0 == 2) - if (isType(new foo.A, foo.A)) { - a++; - break; - } - if (tmp$0 == 3) - a++; - } - return a === -1; - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/patternMatching/out/whenConditionPropertyAccess.js b/k2js/translator/testFiles/patternMatching/out/whenConditionPropertyAccess.js deleted file mode 100644 index 4858fe61cf2..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenConditionPropertyAccess.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - classes = function(){ - var A = Class.create({initialize:function(){ - this.$pp = true; - } - , get_pp:function(){ - return this.$pp; - } - , p:function(){ - return true; - } - }); - return {A:A}; - } - (); - foo = Namespace.create({initialize:function(){ - } - , box:function(){ - var a = 0; - for (var tmp$0 = 0; tmp$0 < 5; ++tmp$0) { - if (tmp$0 == 0) - if ((new foo.A).get_pp() === true) { - a -= 2; - break; - } - if (tmp$0 == 1) - if ((new foo.A).p() === true) { - a--; - break; - } - if (tmp$0 == 2) - if (new foo.A === null || isType(new foo.A, foo.A)) { - a++; - break; - } - if (tmp$0 == 3) - if (isType(new foo.A, foo.A)) { - a++; - break; - } - if (tmp$0 == 4) - a++; - } - return a === -2; - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/patternMatching/out/whenExecutesOnlyOnce.js b/k2js/translator/testFiles/patternMatching/out/whenExecutesOnlyOnce.js deleted file mode 100644 index 423d3d264e7..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenExecutesOnlyOnce.js +++ /dev/null @@ -1,34 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - var a = 0; - for (tmp$0 = 0; tmp$0 < 3; ++tmp$0) { - if (tmp$0 == 0) - if (Kotlin.isType(new foo.A, foo.A)) { - tmp$1 = a++; - break; - } - if (tmp$0 == 1) - if (Kotlin.isType(new foo.A, foo.A)) { - tmp$1 = a++; - break; - } - if (tmp$0 == 2) - tmp$1 = a++; - } - tmp$1; - return a == 1; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/whenNotType.js b/k2js/translator/testFiles/patternMatching/out/whenNotType.js deleted file mode 100644 index 9e262be4d5e..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenNotType.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - for (tmp$0 = 0; tmp$0 < 2; ++tmp$0) { - if (tmp$0 == 0) - if (!Kotlin.isType(new foo.A, foo.A)) { - return false; - break; - } - if (tmp$0 == 1) - return true; - } - tmp$1; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/whenNotValue.js b/k2js/translator/testFiles/patternMatching/out/whenNotValue.js deleted file mode 100644 index 456630e5ae0..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenNotValue.js +++ /dev/null @@ -1,36 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - var a = 4; - for (tmp$0 = 0; tmp$0 < 3; ++tmp$0) { - if (tmp$0 == 0) - if (!(a == 3)) { - { - tmp$1 = a = 10; - } - break; - } - if (tmp$0 == 1) - if (!(a == 4)) { - { - tmp$1 = a = 20; - } - break; - } - if (tmp$0 == 2) { - tmp$1 = a = 30; - } - } - tmp$1; - return a == 10; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/whenType.js b/k2js/translator/testFiles/patternMatching/out/whenType.js deleted file mode 100644 index 7eb531d6102..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenType.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - for (tmp$0 = 0; tmp$0 < 2; ++tmp$0) { - if (tmp$0 == 0) - if (Kotlin.isType(new foo.A, foo.A)) { - return true; - break; - } - if (tmp$0 == 1) - return false; - } - tmp$1; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/whenValue.js b/k2js/translator/testFiles/patternMatching/out/whenValue.js deleted file mode 100644 index 05092651f1e..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenValue.js +++ /dev/null @@ -1,36 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - var a = 4; - for (tmp$0 = 0; tmp$0 < 3; ++tmp$0) { - if (tmp$0 == 0) - if (a == 3) { - { - tmp$1 = a = 10; - } - break; - } - if (tmp$0 == 1) - if (a == 4) { - { - tmp$1 = a = 20; - } - break; - } - if (tmp$0 == 2) { - tmp$1 = a = 30; - } - } - tmp$1; - return a == 20; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/whenValueOrType.js b/k2js/translator/testFiles/patternMatching/out/whenValueOrType.js deleted file mode 100644 index bbb327f4aa9..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenValueOrType.js +++ /dev/null @@ -1,61 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - var tmp$1 = Kotlin.Class.create({initialize:function(){ - } - }); - return {A:tmp$1, B:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$3; - var tmp$2; - var tmp$1; - var tmp$0; - var c = 0; - var a = new foo.A; - var b = null; - for (tmp$0 = 0; tmp$0 < 4; ++tmp$0) { - if (tmp$0 == 0) - if (a == null) { - tmp$1 = c = 10; - break; - } - if (tmp$0 == 1) - if (Kotlin.isType(a, foo.B)) { - tmp$1 = c = 10000; - break; - } - if (tmp$0 == 2) - if (Kotlin.isType(a, foo.A)) { - tmp$1 = c = 20; - break; - } - if (tmp$0 == 3) - tmp$1 = c = 1000; - } - tmp$1; - for (tmp$2 = 0; tmp$2 < 3; ++tmp$2) { - if (tmp$2 == 0) - if (b == null) { - tmp$3 = c += 5; - break; - } - if (tmp$2 == 1) - if (Kotlin.isType(b, foo.B)) { - tmp$3 = c += 100; - break; - } - if (tmp$2 == 2) - tmp$3 = c = 1000; - } - tmp$3; - return c == 25; - } -} -}, {A:classes.A, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/patternMatching/out/whenWithIf.js b/k2js/translator/testFiles/patternMatching/out/whenWithIf.js deleted file mode 100644 index ee6705ac2f2..00000000000 --- a/k2js/translator/testFiles/patternMatching/out/whenWithIf.js +++ /dev/null @@ -1,65 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$5; - var tmp$4; - var tmp$3; - var tmp$2; - var tmp$1; - var tmp$0; - for (tmp$0 = 0; tmp$0 < 3; ++tmp$0) { - if (tmp$0 == 0) - if (3 == 3) { - tmp$1 = 1; - break; - } - if (tmp$0 == 1) - if (3 == 2) { - tmp$1 = 100; - break; - } - if (tmp$0 == 2) - tmp$1 = 100; - } - for (tmp$2 = 0; tmp$2 < 2; ++tmp$2) { - if (tmp$2 == 0) - if (2 == 1) { - tmp$3 = 100; - break; - } - if (tmp$2 == 1) - tmp$3 = 1; - } - for (tmp$4 = 0; tmp$4 < 3; ++tmp$4) { - if (tmp$4 == 0) - if (0 == 1) { - if (true) - tmp$5 = 100; - else - tmp$5 = 100; - break; - } - if (tmp$4 == 1) - if (0 == 0) { - if (false) { - tmp$5 = 100; - } - else { - tmp$5 = 1; - } - break; - } - if (tmp$4 == 2) - tmp$5 = 100; - } - var c = tmp$1 + tmp$3 + tmp$5; - return c == 3; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/accessToInstanceProperty.js b/k2js/translator/testFiles/propertyAccess/out/accessToInstanceProperty.js deleted file mode 100644 index 8d9b2bc3f7b..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/accessToInstanceProperty.js +++ /dev/null @@ -1,25 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$a = 100; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var test = new foo.Test; - test.set_a(1); - return 1 == test.get_a(); - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/classUsesNamespaceProperties.js b/k2js/translator/testFiles/propertyAccess/out/classUsesNamespaceProperties.js deleted file mode 100644 index c3da7fdc841..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/classUsesNamespaceProperties.js +++ /dev/null @@ -1,29 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - { - foo.set_a(foo.get_a() + 1); - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a = 0; -} -, get_a:function(){ - return $a; -} -, set_a:function(tmp$0){ - $a = tmp$0; -} -, box:function(){ - { - var c = new foo.A; - c = new foo.A; - c = new foo.A; - return foo.get_a() == 3; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/customGetter.js b/k2js/translator/testFiles/propertyAccess/out/customGetter.js deleted file mode 100644 index f263f55a827..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/customGetter.js +++ /dev/null @@ -1,22 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , get_a:function(){ - { - return 5; - } - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var test = new foo.Test; - return test.get_a() == 5; - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/customSetter.js b/k2js/translator/testFiles/propertyAccess/out/customSetter.js deleted file mode 100644 index e5a5269326c..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/customSetter.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$a = 5; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(b){ - { - this.$a = 3; - } - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var test = new foo.Test; - test.set_a(5); - return test.get_a() == 3; - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/extensionLiteralSafeCall.js b/k2js/translator/testFiles/propertyAccess/out/extensionLiteralSafeCall.js deleted file mode 100644 index e3ecd4951ad..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/extensionLiteralSafeCall.js +++ /dev/null @@ -1,34 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, f:function(a, b){ - var tmp$0; - { - return tmp$0 = a , tmp$0 != null?b.call(tmp$0, 2):null; - } -} -, box:function(){ - { - var c1 = foo.f(null, function(it){ - { - return it + this; - } - } - ) != null; - if (c1) - return false; - if (foo.f(3, function(it){ - { - return it + this; - } - } - ) != 5) - return false; - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/namespaceCustomAccessors.js b/k2js/translator/testFiles/propertyAccess/out/namespaceCustomAccessors.js deleted file mode 100644 index 525a9937690..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/namespaceCustomAccessors.js +++ /dev/null @@ -1,22 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, get_a:function(){ - { - return 5; - } -} -, set_a:function(b){ - { - } -} -, box:function(){ - { - return foo.get_a() == 5; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/namespacePropertyInitializer.js b/k2js/translator/testFiles/propertyAccess/out/namespacePropertyInitializer.js deleted file mode 100644 index 5757786ea89..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/namespacePropertyInitializer.js +++ /dev/null @@ -1,17 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $b = 3; -} -, get_b:function(){ - return $b; -} -, box:function(){ - { - return foo.get_b() == 3; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/namespacePropertySet.js b/k2js/translator/testFiles/propertyAccess/out/namespacePropertySet.js deleted file mode 100644 index 40a57762c52..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/namespacePropertySet.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $b = 3; -} -, get_b:function(){ - return $b; -} -, set_b:function(tmp$0){ - $b = tmp$0; -} -, box:function(){ - { - foo.set_b(2); - return foo.get_b() == 2; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/safeAccess.js b/k2js/translator/testFiles/propertyAccess/out/safeAccess.js deleted file mode 100644 index 43d695ee0a9..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/safeAccess.js +++ /dev/null @@ -1,38 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$c = 3; - } - , get_c:function(){ - return this.$c; - } - , set_c:function(tmp$0){ - this.$c = tmp$0; - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$5; - var tmp$4; - var tmp$3; - var tmp$2; - var tmp$1; - var tmp$0; - var a1 = new foo.A; - var a2 = null; - tmp$0 = a1 , tmp$0 != null?tmp$0.set_c(4):null; - tmp$1 = a2 , tmp$1 != null?tmp$1.set_c(5):null; - if ((tmp$2 = a1 , tmp$2 != null?tmp$2.get_c():null) != 4) { - return false; - } - a2 = a1; - tmp$3 = a2 , tmp$3 != null?tmp$3.set_c(5):null; - return (tmp$4 = a2 , tmp$4 != null?tmp$4.get_c():null) == 5 && (tmp$5 = a1 , tmp$5 != null?tmp$5.get_c():null) == 5; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/safeCall.js b/k2js/translator/testFiles/propertyAccess/out/safeCall.js deleted file mode 100644 index da735328d70..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/safeCall.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , doSomething:function(){ - { - } - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var a = null; - tmp$0 = a , tmp$0 != null?tmp$0.doSomething():null; - return true; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/safeCallReturnsNullIfFails.js b/k2js/translator/testFiles/propertyAccess/out/safeCallReturnsNullIfFails.js deleted file mode 100644 index 648f74bec77..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/safeCallReturnsNullIfFails.js +++ /dev/null @@ -1,22 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$x = 4; - } - , get_x:function(){ - return this.$x; - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var a = null; - return (tmp$0 = a , tmp$0 != null?tmp$0.get_x():null) == null; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/safeExtensionFunctionCall.js b/k2js/translator/testFiles/propertyAccess/out/safeExtensionFunctionCall.js deleted file mode 100644 index 569d3798417..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/safeExtensionFunctionCall.js +++ /dev/null @@ -1,59 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$c = 3; - } - , get_c:function(){ - return this.$c; - } - , set_c:function(tmp$0){ - this.$c = tmp$0; - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, i:function(receiver){ - { - receiver.set_c(receiver.get_c() + 1); - return receiver.get_c(); - } -} -, box:function(){ - { - var tmp$7; - var tmp$6; - var tmp$5; - var tmp$4; - var tmp$3; - var tmp$2; - var tmp$1; - var tmp$0; - var a1 = new foo.A; - var a2 = null; - if ((tmp$0 = a1 , tmp$0 != null?foo.i(tmp$0):null) != 4) { - return '1'; - } - if ((tmp$1 = a1 , tmp$1 != null?tmp$1.get_c():null) != 4) { - return '2'; - } - if ((tmp$2 = a2 , tmp$2 != null?tmp$2.get_c():null) != null) { - return '3'; - } - tmp$3 = a2 , tmp$3 != null?foo.i(tmp$3):null; - if ((tmp$4 = a1 , tmp$4 != null?tmp$4.get_c():null) != 4) { - return '4'; - } - a2 = a1; - if ((tmp$5 = a2 , tmp$5 != null?foo.i(tmp$5):null) != 5) { - return '5'; - } - if ((tmp$6 = a2 , tmp$6 != null?foo.i(tmp$6):null) != 6 || (tmp$7 = a1 , tmp$7 != null?tmp$7.get_c():null) != 6) { - return '6'; - } - return 'OK'; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/setter.js b/k2js/translator/testFiles/propertyAccess/out/setter.js deleted file mode 100644 index 0cb88d5af83..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/setter.js +++ /dev/null @@ -1,26 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$a = 1; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, f:function(){ - { - var a = new foo.Test; - var b = new foo.Test; - b.set_a(100); - return b.get_a() - a.get_a(); - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/propertyAccess/out/twoClassesWithProperties.js b/k2js/translator/testFiles/propertyAccess/out/twoClassesWithProperties.js deleted file mode 100644 index 68855d8b249..00000000000 --- a/k2js/translator/testFiles/propertyAccess/out/twoClassesWithProperties.js +++ /dev/null @@ -1,27 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$b = 2; - } - , get_b:function(){ - return this.$b; - } - }); - var tmp$1 = Kotlin.Class.create({initialize:function(){ - this.$a = 1; - } - , get_a:function(){ - return this.$a; - } - }); - return {A:tmp$1, B:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).get_a() == 1 && (new foo.B).get_b() == 2; - } -} -}, {A:classes.A, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/range/out/explicitRange.js b/k2js/translator/testFiles/range/out/explicitRange.js deleted file mode 100644 index f8b1ce2d2f3..00000000000 --- a/k2js/translator/testFiles/range/out/explicitRange.js +++ /dev/null @@ -1,64 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - var oneToFive = new Kotlin.NumberRange(1, 4); - if (oneToFive.contains(5)) - return false; - if (oneToFive.contains(0)) - return false; - if (oneToFive.contains(-100)) - return false; - if (oneToFive.contains(10)) - return false; - if (!oneToFive.contains(1)) - return false; - if (!oneToFive.contains(2)) - return false; - if (!oneToFive.contains(3)) - return false; - if (!oneToFive.contains(4)) - return false; - if (!(oneToFive.get_start() == 1)) - return false; - if (!(oneToFive.get_size() == 4)) - return false; - if (!(oneToFive.get_end() == 4)) - return false; - var sum = 0; - { - tmp$0 = oneToFive.iterator(); - while (tmp$0.hasNext()) { - var i = tmp$0.next(); - { - sum += i; - } - } - } - { - tmp$1 = oneToFive.iterator(); - while (tmp$1.hasNext()) { - var i$0 = tmp$1.next(); - { - Kotlin.print(i$0); - } - } - } - if (sum != 10) - return false; - return true; - } -} -, main:function(){ - { - foo.box(); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/range/out/intInRange.js b/k2js/translator/testFiles/range/out/intInRange.js deleted file mode 100644 index cd95b4c3ae4..00000000000 --- a/k2js/translator/testFiles/range/out/intInRange.js +++ /dev/null @@ -1,28 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - if ((new Kotlin.NumberRange(-2, 0 - -2 + 1, false)).contains(1)) - return false; - if ((new Kotlin.NumberRange(-10, -4 - -10 + 1, false)).contains(1)) - return false; - if (!(new Kotlin.NumberRange(0, 2 - 0 + 1, false)).contains(1)) - return false; - if (!(new Kotlin.NumberRange(1, 2 - 1 + 1, false)).contains(1)) - return false; - if (!(new Kotlin.NumberRange(-2, 5 - -2 + 1, false)).contains(1)) - return false; - return true; - } -} -, main:function(){ - { - foo.box(); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/range/out/rangeSugarSyntax.js b/k2js/translator/testFiles/range/out/rangeSugarSyntax.js deleted file mode 100644 index 82a33ddf974..00000000000 --- a/k2js/translator/testFiles/range/out/rangeSugarSyntax.js +++ /dev/null @@ -1,64 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$1; - var tmp$0; - var oneToFive = new Kotlin.NumberRange(1, 5 - 1 + 1, false); - if (!oneToFive.contains(5)) - return false; - if (oneToFive.contains(0)) - return false; - if (oneToFive.contains(-100)) - return false; - if (oneToFive.contains(10)) - return false; - if (!oneToFive.contains(1)) - return false; - if (!oneToFive.contains(2)) - return false; - if (!oneToFive.contains(3)) - return false; - if (!oneToFive.contains(4)) - return false; - if (!(oneToFive.get_start() == 1)) - return false; - if (!(oneToFive.get_size() == 5)) - return false; - if (!(oneToFive.get_end() == 5)) - return false; - var sum = 0; - { - tmp$0 = oneToFive.iterator(); - while (tmp$0.hasNext()) { - var i = tmp$0.next(); - { - sum += i; - } - } - } - { - tmp$1 = oneToFive.iterator(); - while (tmp$1.hasNext()) { - var i$0 = tmp$1.next(); - { - Kotlin.print(i$0); - } - } - } - if (sum != 15) - return false; - return true; - } -} -, main:function(){ - { - foo.box(); - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/rtti/out/isSameClass.js b/k2js/translator/testFiles/rtti/out/isSameClass.js deleted file mode 100644 index 49e783c2e09..00000000000 --- a/k2js/translator/testFiles/rtti/out/isSameClass.js +++ /dev/null @@ -1,16 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return Kotlin.isType(new foo.A, foo.A); - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/rtti/out/notIsOtherClass.js b/k2js/translator/testFiles/rtti/out/notIsOtherClass.js deleted file mode 100644 index efef11b862a..00000000000 --- a/k2js/translator/testFiles/rtti/out/notIsOtherClass.js +++ /dev/null @@ -1,20 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.super_init(); - } - }); - return {B:tmp$1, A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return !Kotlin.isType(new foo.A, foo.B); - } -} -}, {A:classes.A, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/assign.js b/k2js/translator/testFiles/simple/out/assign.js deleted file mode 100644 index 416787d1404..00000000000 --- a/k2js/translator/testFiles/simple/out/assign.js +++ /dev/null @@ -1,20 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, f:function(){ - { - var x = 1; - x = x + 1; - return x; - } -} -, box:function(){ - { - return foo.f() == 2; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/breakDoWhile.js b/k2js/translator/testFiles/simple/out/breakDoWhile.js deleted file mode 100644 index 56b982aaab4..00000000000 --- a/k2js/translator/testFiles/simple/out/breakDoWhile.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var i = 0; - do { - if (i == 3) { - break; - } - ++i; - } - while (i < 100); - return i == 3; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/breakWhile.js b/k2js/translator/testFiles/simple/out/breakWhile.js deleted file mode 100644 index 213bc236cf6..00000000000 --- a/k2js/translator/testFiles/simple/out/breakWhile.js +++ /dev/null @@ -1,20 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var i = 0; - while (i < 100) { - if (i == 3) { - break; - } - ++i; - } - return i == 3; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/classInstantiation.js b/k2js/translator/testFiles/simple/out/classInstantiation.js deleted file mode 100644 index f9ebcc419bb..00000000000 --- a/k2js/translator/testFiles/simple/out/classInstantiation.js +++ /dev/null @@ -1,17 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var test = new foo.Test; - return true; - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/classWithoutNamespace.js b/k2js/translator/testFiles/simple/out/classWithoutNamespace.js deleted file mode 100644 index 242b1592988..00000000000 --- a/k2js/translator/testFiles/simple/out/classWithoutNamespace.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var A = Kotlin.Class.create({initialize:function(a){ - this.$a = a; - { - this.$a = 3; - } - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {A_0:A}; - } - (); - var Anonymous = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - return (new Anonymous.A_0(1)).get_a() == 3; - } - } - }, classes); - Anonymous.initialize(); -} diff --git a/k2js/translator/testFiles/simple/out/comparison.js b/k2js/translator/testFiles/simple/out/comparison.js deleted file mode 100644 index fd337227ea2..00000000000 --- a/k2js/translator/testFiles/simple/out/comparison.js +++ /dev/null @@ -1,16 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = 2; - var b = 3; - var c = 4; - return a < c; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/complexExpressionAsConstructorParameter.js b/k2js/translator/testFiles/simple/out/complexExpressionAsConstructorParameter.js deleted file mode 100644 index 909a229c79a..00000000000 --- a/k2js/translator/testFiles/simple/out/complexExpressionAsConstructorParameter.js +++ /dev/null @@ -1,25 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(a, b){ - this.$c = a; - this.$d = b; - } - , get_c:function(){ - return this.$c; - } - , get_d:function(){ - return this.$d; - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var test = new foo.Test(1 + 6 * 3, 10 % 2); - return test.get_c() == 19 && test.get_d() == 0; - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/constructorWithParameter.js b/k2js/translator/testFiles/simple/out/constructorWithParameter.js deleted file mode 100644 index d0c99147507..00000000000 --- a/k2js/translator/testFiles/simple/out/constructorWithParameter.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(a){ - this.$b = a; - } - , get_b:function(){ - return this.$b; - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var test = new foo.Test(1); - return test.get_b() == 1; - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/constructorWithPropertiesAsParameters.js b/k2js/translator/testFiles/simple/out/constructorWithPropertiesAsParameters.js deleted file mode 100644 index e51d0aca80a..00000000000 --- a/k2js/translator/testFiles/simple/out/constructorWithPropertiesAsParameters.js +++ /dev/null @@ -1,33 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(b, a){ - this.$b = b; - this.$a = a; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.A(1, '1'); - c.set_b(2); - c.set_a('2'); - return c.get_b() == 2 && c.get_a() == '2'; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/continueDoWhile.js b/k2js/translator/testFiles/simple/out/continueDoWhile.js deleted file mode 100644 index abdae966bc8..00000000000 --- a/k2js/translator/testFiles/simple/out/continueDoWhile.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var i = 0; - var b = true; - do { - ++i; - if (i >= 1) { - continue; - } - b = false; - } - while (i < 100); - return b; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/continueWhile.js b/k2js/translator/testFiles/simple/out/continueWhile.js deleted file mode 100644 index ca15d004494..00000000000 --- a/k2js/translator/testFiles/simple/out/continueWhile.js +++ /dev/null @@ -1,22 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var i = 0; - var b = true; - while (i < 100) { - ++i; - if (i >= 1) { - continue; - } - b = false; - } - return b; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/doWhile.js b/k2js/translator/testFiles/simple/out/doWhile.js deleted file mode 100644 index da5e41fac0a..00000000000 --- a/k2js/translator/testFiles/simple/out/doWhile.js +++ /dev/null @@ -1,24 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = 50; - var b = 0; - var c = 0; - do { - b = b + 1; - c = c + 2; - } - while (b < a); - if (c == 100) { - return true; - } - return false; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/doWhile2.js b/k2js/translator/testFiles/simple/out/doWhile2.js deleted file mode 100644 index 578bae85dc5..00000000000 --- a/k2js/translator/testFiles/simple/out/doWhile2.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var x = 2; - do { - x = 1; - } - while (3 < 2); - if (x == 1) { - return true; - } - return false; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/elseif.js b/k2js/translator/testFiles/simple/out/elseif.js deleted file mode 100644 index 73f3b1767b8..00000000000 --- a/k2js/translator/testFiles/simple/out/elseif.js +++ /dev/null @@ -1,32 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, bor:function(){ - { - var a = 2; - var b = 3; - var c = 4; - if (a < 2) { - return a; - } - else if (a > 2) { - return b; - } - else if (a == c) { - return c; - } - else { - return 5; - } - } -} -, box:function(){ - { - return foo.bor() == 5; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/if.js b/k2js/translator/testFiles/simple/out/if.js deleted file mode 100644 index b8dff315748..00000000000 --- a/k2js/translator/testFiles/simple/out/if.js +++ /dev/null @@ -1,32 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, bol:function(){ - { - var a = 2; - var b = 3; - var c = 4; - if (a < 2) { - return a; - } - if (a > 2) { - return b; - } - if (a == c) { - return c; - } - else { - return 5; - } - } -} -, box:function(){ - { - return foo.bol() == 5; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/ifElseAsExpression.js b/k2js/translator/testFiles/simple/out/ifElseAsExpression.js deleted file mode 100644 index 63d360dbe96..00000000000 --- a/k2js/translator/testFiles/simple/out/ifElseAsExpression.js +++ /dev/null @@ -1,19 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var tmp$0; - var a = 2; - if (a == 2) - tmp$0 = true; - else - tmp$0 = false; - return tmp$0; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/incrementProperty.js b/k2js/translator/testFiles/simple/out/incrementProperty.js deleted file mode 100644 index 4d85dc808ed..00000000000 --- a/k2js/translator/testFiles/simple/out/incrementProperty.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var Slot = Kotlin.Class.create({initialize:function(){ - this.$vitality = 10000; - } - , get_vitality:function(){ - return this.$vitality; - } - , set_vitality:function(tmp$0){ - this.$vitality = tmp$0; - } - , increaseVitality:function(delta){ - { - this.set_vitality(this.get_vitality() + delta); - if (this.get_vitality() > 65535) - this.set_vitality(65535); - } - } - }); - return {Slot_0:Slot}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , box:function(){ - { - var s = new foo.Slot_0; - s.increaseVitality(1000); - if (s.get_vitality() == 11000) - return 'OK'; - else - return 'fail'; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/simple/out/methodDeclarationAndCall.js b/k2js/translator/testFiles/simple/out/methodDeclarationAndCall.js deleted file mode 100644 index 353a88b0c12..00000000000 --- a/k2js/translator/testFiles/simple/out/methodDeclarationAndCall.js +++ /dev/null @@ -1,22 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - , method:function(){ - { - return true; - } - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var test = new foo.Test; - return test.method(); - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/minusAssignOnProperty.js b/k2js/translator/testFiles/simple/out/minusAssignOnProperty.js deleted file mode 100644 index 97e3dffbce7..00000000000 --- a/k2js/translator/testFiles/simple/out/minusAssignOnProperty.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a = 3; -} -, get_a:function(){ - return $a; -} -, set_a:function(tmp$0){ - $a = tmp$0; -} -, box:function(){ - { - foo.set_a(foo.get_a() - 10); - return foo.get_a() == -7; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/notBoolean.js b/k2js/translator/testFiles/simple/out/notBoolean.js deleted file mode 100644 index a934a99a47c..00000000000 --- a/k2js/translator/testFiles/simple/out/notBoolean.js +++ /dev/null @@ -1,13 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return !false; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/plusAssign.js b/k2js/translator/testFiles/simple/out/plusAssign.js deleted file mode 100644 index 83578625982..00000000000 --- a/k2js/translator/testFiles/simple/out/plusAssign.js +++ /dev/null @@ -1,15 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = 3; - a += 3; - return a == 6; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/positiveAndNegativeNumbers.js b/k2js/translator/testFiles/simple/out/positiveAndNegativeNumbers.js deleted file mode 100644 index 16bf1868b08..00000000000 --- a/k2js/translator/testFiles/simple/out/positiveAndNegativeNumbers.js +++ /dev/null @@ -1,15 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var b = -3; - var c = +3; - return c - b == 6; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/postfixIntOperations.js b/k2js/translator/testFiles/simple/out/postfixIntOperations.js deleted file mode 100644 index 2f52c957222..00000000000 --- a/k2js/translator/testFiles/simple/out/postfixIntOperations.js +++ /dev/null @@ -1,17 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = 3; - var b = a++; - a--; - a--; - return a++ == 2 && b == 3; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/prefixIntOperations.js b/k2js/translator/testFiles/simple/out/prefixIntOperations.js deleted file mode 100644 index 8f87479021c..00000000000 --- a/k2js/translator/testFiles/simple/out/prefixIntOperations.js +++ /dev/null @@ -1,17 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = 3; - var b = ++a; - --a; - --a; - return --a == 1 && b == 4; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/propertiesAsParametersInitialized.js b/k2js/translator/testFiles/simple/out/propertiesAsParametersInitialized.js deleted file mode 100644 index 3f128259e5e..00000000000 --- a/k2js/translator/testFiles/simple/out/propertiesAsParametersInitialized.js +++ /dev/null @@ -1,31 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(b, a){ - this.$b = b; - this.$a = a; - } - , get_b:function(){ - return this.$b; - } - , set_b:function(tmp$0){ - this.$b = tmp$0; - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.A(2, '2'); - return c.get_b() == 2 && c.get_a() == '2'; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/propertyAccess.js b/k2js/translator/testFiles/simple/out/propertyAccess.js deleted file mode 100644 index dc7a1bc3821..00000000000 --- a/k2js/translator/testFiles/simple/out/propertyAccess.js +++ /dev/null @@ -1,20 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - this.$p = true; - } - , get_p:function(){ - return this.$p; - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.Test).get_p(); - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/simpleInitializer.js b/k2js/translator/testFiles/simple/out/simpleInitializer.js deleted file mode 100644 index 2091bb6a518..00000000000 --- a/k2js/translator/testFiles/simple/out/simpleInitializer.js +++ /dev/null @@ -1,25 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - { - this.$a = 3; - } - } - , get_a:function(){ - return this.$a; - } - , set_a:function(tmp$0){ - this.$a = tmp$0; - } - }); - return {Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.Test).get_a() == 3; - } -} -}, {Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/while.js b/k2js/translator/testFiles/simple/out/while.js deleted file mode 100644 index 14cdde6050e..00000000000 --- a/k2js/translator/testFiles/simple/out/while.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = 50; - var b = 0; - var c = 0; - while (b < a) { - b = b + 1; - c = c + 2; - } - if (c == 100) { - return true; - } - return false; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/simple/out/while2.js b/k2js/translator/testFiles/simple/out/while2.js deleted file mode 100644 index 7a5a2ec03a5..00000000000 --- a/k2js/translator/testFiles/simple/out/while2.js +++ /dev/null @@ -1,16 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - while (2 < 1) { - return false; - } - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/standardClasses/out/array.js b/k2js/translator/testFiles/standardClasses/out/array.js deleted file mode 100644 index e68d18c7ed5..00000000000 --- a/k2js/translator/testFiles/standardClasses/out/array.js +++ /dev/null @@ -1,15 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = Kotlin.nullArray(2); - a[1] = 2; - return a[1] == 2; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/standardClasses/out/arrayAccess.js b/k2js/translator/testFiles/standardClasses/out/arrayAccess.js deleted file mode 100644 index 7abaf28ce59..00000000000 --- a/k2js/translator/testFiles/standardClasses/out/arrayAccess.js +++ /dev/null @@ -1,16 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = Kotlin.nullArray(4); - a[1] = 2; - a[2] = 3; - return a[1] == 2 && a[2] == 3; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/standardClasses/out/arrayFunctionConstructor.js b/k2js/translator/testFiles/standardClasses/out/arrayFunctionConstructor.js deleted file mode 100644 index 614d109a2a2..00000000000 --- a/k2js/translator/testFiles/standardClasses/out/arrayFunctionConstructor.js +++ /dev/null @@ -1,26 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $f = function(i){ - { - return i + 1; - } - } - ; - $a = Kotlin.arrayFromFun(3, foo.get_f()); -} -, get_f:function(){ - return $f; -} -, get_a:function(){ - return $a; -} -, box:function(){ - { - return foo.get_a()[0] == 1 && foo.get_a()[2] == 3 && foo.get_a()[1] == 2; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/standardClasses/out/arrayIsFilledWithNulls.js b/k2js/translator/testFiles/standardClasses/out/arrayIsFilledWithNulls.js deleted file mode 100644 index 9610d162169..00000000000 --- a/k2js/translator/testFiles/standardClasses/out/arrayIsFilledWithNulls.js +++ /dev/null @@ -1,17 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a = Kotlin.nullArray(3); -} -, get_a:function(){ - return $a; -} -, box:function(){ - { - return foo.get_a()[0] == null && foo.get_a()[1] == null && foo.get_a()[2] == null; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/standardClasses/out/arraySize.js b/k2js/translator/testFiles/standardClasses/out/arraySize.js deleted file mode 100644 index 7bc3ad15e1f..00000000000 --- a/k2js/translator/testFiles/standardClasses/out/arraySize.js +++ /dev/null @@ -1,24 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {A:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a1 = Kotlin.nullArray(3); - $a2 = Kotlin.nullArray(2); -} -, get_a1:function(){ - return $a1; -} -, get_a2:function(){ - return $a2; -} -, box:function(){ - { - return foo.get_a1().length == 3 && foo.get_a2().length == 2; - } -} -}, {A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/standardClasses/out/arrayThrowsExceptionOnOOBaccess.js b/k2js/translator/testFiles/standardClasses/out/arrayThrowsExceptionOnOOBaccess.js deleted file mode 100644 index b4163175e13..00000000000 --- a/k2js/translator/testFiles/standardClasses/out/arrayThrowsExceptionOnOOBaccess.js +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var A_0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {A:A_0}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - foo.$a1 = Kotlin.nullArray(3); - foo.$a2 = Kotlin.nullArray(2); - } - , get_a1:function(){ - return foo.$a1; - } - , get_a2:function(){ - return foo.$a2; - } - , box:function(){ - { - return foo.get_a1()[4] == null; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/standardClasses/out/arraysIterator.js b/k2js/translator/testFiles/standardClasses/out/arraysIterator.js deleted file mode 100644 index 888dff625fa..00000000000 --- a/k2js/translator/testFiles/standardClasses/out/arraysIterator.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ - $a1 = Kotlin.arrayFromFun(3, function(i){ - { - return i; - } - } - ); -} -, get_a1:function(){ - return $a1; -} -, box:function(){ - { - var i = Kotlin.arrayIterator(foo.get_a1()); - return i.get_hasNext() == true && i.next() == 0 && i.get_hasNext() == true && i.next() == 1 && i.get_hasNext() == true && i.next() == 2 && i.get_hasNext() == false; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/stdlib/out/Filter.js b/k2js/translator/testFiles/stdlib/out/Filter.js deleted file mode 100644 index ca21a4ddd59..00000000000 --- a/k2js/translator/testFiles/stdlib/out/Filter.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - var classes = function(){ - var FilterIterator_0 = Kotlin.Class.create(Kotlin.ArrayIterator, {initialize:function(original, filter_0){ - this.$original = original; - this.$filter = filter_0; - this.$state = 0; - this.$nextElement = null; - } - , get_original:function(){ - return this.$original; - } - , get_filter:function(){ - return this.$filter; - } - , get_state:function(){ - return this.$state; - } - , set_state:function(tmp$0){ - this.$state = tmp$0; - } - , get_nextElement:function(){ - return this.$nextElement; - } - , set_nextElement:function(tmp$0){ - this.$nextElement = tmp$0; - } - , get_hasNext:function(){ - { - var tmp$1; - var tmp$0; - if (this.get_state() == 1) { - return true; - } - tmp$0; - if (this.get_state() == 2) { - return false; - } - tmp$1; - while (this.get_original().get_hasNext()) { - var tmp$2; - var candidate = this.get_original().next(); - if (this.get_filter()(candidate)) { - this.set_nextElement(candidate); - this.set_state(1); - return true; - } - tmp$2; - } - this.set_state(2); - return false; - } - } - , next:function(){ - { - var res = this.get_nextElement(); - this.set_nextElement(null); - this.set_state(0); - return res; - } - } - }); - var NoSuchElementException_0 = Kotlin.Class.create(Kotlin.Exception, {initialize:function(){ - this.super_init(); - } - }); - return {NoSuchElementException:NoSuchElementException_0, FilterIterator:FilterIterator_0}; - } - (); - var foo = Kotlin.Namespace.create({initialize:function(){ - } - , filter:function(receiver, f){ - { - return new foo.FilterIterator(receiver, f); - } - } - , filterTo:function(receiver, container, filter){ - { - var tmp$0; - { - tmp$0 = receiver.iterator(); - while (tmp$0.hasNext()) { - var element = tmp$0.next(); - { - var tmp$1; - if (filter(element)) - tmp$1 = container.add(element); - tmp$1; - } - } - } - return container; - } - } - }, classes); - foo.initialize(); -} diff --git a/k2js/translator/testFiles/trait/out/classDerivesFromClassAndTrait.js b/k2js/translator/testFiles/trait/out/classDerivesFromClassAndTrait.js deleted file mode 100644 index ffaf47a86f1..00000000000 --- a/k2js/translator/testFiles/trait/out/classDerivesFromClassAndTrait.js +++ /dev/null @@ -1,35 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({addFoo:function(s){ - { - return s + 'FOO'; - } - } - }); - var tmp$1 = Kotlin.Class.create({initialize:function(){ - this.$value = 'BAR'; - } - , get_value:function(){ - return this.$value; - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - } - , eval_0:function(){ - { - return this.addFoo(this.get_value()); - } - } - }); - return {A:tmp$1, B:tmp$2, Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.B).eval_0() == 'BARFOO'; - } -} -}, {A:classes.A, Test:classes.Test, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/trait/out/classDerivesFromTraitAndClass.js b/k2js/translator/testFiles/trait/out/classDerivesFromTraitAndClass.js deleted file mode 100644 index ffaf47a86f1..00000000000 --- a/k2js/translator/testFiles/trait/out/classDerivesFromTraitAndClass.js +++ /dev/null @@ -1,35 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({addFoo:function(s){ - { - return s + 'FOO'; - } - } - }); - var tmp$1 = Kotlin.Class.create({initialize:function(){ - this.$value = 'BAR'; - } - , get_value:function(){ - return this.$value; - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - } - , eval_0:function(){ - { - return this.addFoo(this.get_value()); - } - } - }); - return {A:tmp$1, B:tmp$2, Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.B).eval_0() == 'BARFOO'; - } -} -}, {A:classes.A, Test:classes.Test, B:classes.B}); -foo.initialize(); diff --git a/k2js/translator/testFiles/trait/out/definitionOrder.js b/k2js/translator/testFiles/trait/out/definitionOrder.js deleted file mode 100644 index 4a4195af228..00000000000 --- a/k2js/translator/testFiles/trait/out/definitionOrder.js +++ /dev/null @@ -1,60 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({bar:function(){ - { - return 'F'; - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.$order = ''; - { - this.set_order(this.get_order() + 'A'); - } - } - , get_order:function(){ - return this.$order; - } - , set_order:function(tmp$0){ - this.$order = tmp$0; - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'B'); - } - } - }); - var tmp$3 = Kotlin.Class.create(tmp$2, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'D'); - } - } - }); - var tmp$4 = Kotlin.Class.create(tmp$2, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'C'); - } - } - }); - var tmp$5 = Kotlin.Class.create(tmp$1, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'E'); - } - } - }); - return {E:tmp$5, A:tmp$1, B:tmp$2, D:tmp$3, C:tmp$4, F:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.C).get_order() == 'ABC' && (new foo.D).get_order() == 'ABD' && (new foo.E).get_order() == 'AE' && (new foo.C).bar() == 'F' && (new foo.A).bar() == 'F'; - } -} -}, {C:classes.C, D:classes.D, E:classes.E, B:classes.B, A:classes.A, F:classes.F}); -foo.initialize(); diff --git a/k2js/translator/testFiles/trait/out/example.js b/k2js/translator/testFiles/trait/out/example.js deleted file mode 100644 index 702a021cb6b..00000000000 --- a/k2js/translator/testFiles/trait/out/example.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({get:function(index){ - { - return null; - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - } - }); - return {SmartArrayList:tmp$1, AL:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var c = new foo.SmartArrayList; - return null == c.get(0); - } -} -}, {AL:classes.AL, SmartArrayList:classes.SmartArrayList}); -foo.initialize(); diff --git a/k2js/translator/testFiles/trait/out/funDelegation.js b/k2js/translator/testFiles/trait/out/funDelegation.js deleted file mode 100644 index e9934a9c8cb..00000000000 --- a/k2js/translator/testFiles/trait/out/funDelegation.js +++ /dev/null @@ -1,41 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({}); - var tmp$1 = Kotlin.Class.create({initialize:function(){ - } - , n_0:function(n){ - { - return n + 1; - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - } - }); - var tmp$3 = Kotlin.Class.create(tmp$1, tmp$0, {initialize:function(){ - this.super_init(); - } - }); - return {Base:tmp$1, Derived2:tmp$2, Derived1:tmp$3, Abstract:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, test:function(s){ - { - return s.n_0(238) == 239; - } -} -, box:function(){ - { - if (!foo.test(new foo.Base)) - return 'Fail #1'; - if (!foo.test(new foo.Derived1)) - return 'Fail #2'; - if (!foo.test(new foo.Derived2)) - return 'Fail #3'; - return 'OK'; - } -} -}, {Base:classes.Base, Abstract:classes.Abstract, Derived1:classes.Derived1, Derived2:classes.Derived2}); -foo.initialize(); diff --git a/k2js/translator/testFiles/trait/out/traitAddsFunctionsToClass.js b/k2js/translator/testFiles/trait/out/traitAddsFunctionsToClass.js deleted file mode 100644 index e870e397b35..00000000000 --- a/k2js/translator/testFiles/trait/out/traitAddsFunctionsToClass.js +++ /dev/null @@ -1,36 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({addFoo:function(s){ - { - return s + 'FOO'; - } - } - , addBar:function(s){ - { - return s + 'BAR'; - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(){ - this.$string = 'TEST'; - } - , get_string:function(){ - return this.$string; - } - , value:function(){ - { - return this.addBar(this.addFoo(this.get_string())); - } - } - }); - return {A:tmp$1, Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).value() == 'TESTFOOBAR'; - } -} -}, {Test:classes.Test, A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/trait/out/traitCompiles.js b/k2js/translator/testFiles/trait/out/traitCompiles.js deleted file mode 100644 index 47746920a24..00000000000 --- a/k2js/translator/testFiles/trait/out/traitCompiles.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -foo = {}; -(function(foo){ - foo.Test = {addFoo:function(s){ - return s + 'FOO'; - } - }; - foo.box = function(){ - return true; - } - ; -} -(foo)); diff --git a/k2js/translator/testFiles/trait/out/traitExtendsTrait.js b/k2js/translator/testFiles/trait/out/traitExtendsTrait.js deleted file mode 100644 index c496e4c9d35..00000000000 --- a/k2js/translator/testFiles/trait/out/traitExtendsTrait.js +++ /dev/null @@ -1,33 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({addFoo:function(s){ - { - return s + 'FOO'; - } - } - }); - var tmp$1 = Kotlin.Trait.create(tmp$0, {hooray:function(){ - { - return 'hooray'; - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, {initialize:function(){ - } - , eval_0:function(){ - { - return this.addFoo(this.hooray()); - } - } - }); - return {ExtendedTest:tmp$1, A:tmp$2, Test:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.A).eval_0() == 'hoorayFOO'; - } -} -}, {Test:classes.Test, ExtendedTest:classes.ExtendedTest, A:classes.A}); -foo.initialize(); diff --git a/k2js/translator/testFiles/trait/out/traitExtendsTwoTraits.js b/k2js/translator/testFiles/trait/out/traitExtendsTwoTraits.js deleted file mode 100644 index 2f89a3707a9..00000000000 --- a/k2js/translator/testFiles/trait/out/traitExtendsTwoTraits.js +++ /dev/null @@ -1,34 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({hooray:function(){ - { - return 'hooray'; - } - } - }); - var tmp$1 = Kotlin.Trait.create({addFoo:function(s){ - { - return s + 'FOO'; - } - } - }); - var tmp$2 = Kotlin.Trait.create(tmp$1, tmp$0, {}); - var tmp$3 = Kotlin.Class.create(tmp$2, {initialize:function(){ - } - , eval_0:function(){ - { - return this.addFoo(this.hooray()); - } - } - }); - return {A:tmp$1, AD:tmp$2, Test:tmp$3, B:tmp$0}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - return (new foo.Test).eval_0() == 'hoorayFOO'; - } -} -}, {A:classes.A, B:classes.B, AD:classes.AD, Test:classes.Test}); -foo.initialize(); diff --git a/k2js/translator/testFiles/tuple/out/multipleMembers.js b/k2js/translator/testFiles/tuple/out/multipleMembers.js deleted file mode 100644 index 529c4a88207..00000000000 --- a/k2js/translator/testFiles/tuple/out/multipleMembers.js +++ /dev/null @@ -1,32 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - if ([1, 2, 3][0] != 1) - return false; - if (['a', 'b'][1] != 'b') - return false; - var x = ['1', 2, '3', 4, '5', 6]; - if (x[0] != '1') - return false; - if (x[1] != 2) - return false; - if (x[1] != 2) - return false; - if (x[5] != 6) - return false; - if (x[4] != '5') - return false; - if (x[2] != '3') - return false; - if ([1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1][20] != 1) - return false; - return true; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/tuple/out/twoElements.js b/k2js/translator/testFiles/tuple/out/twoElements.js deleted file mode 100644 index 1b26229d993..00000000000 --- a/k2js/translator/testFiles/tuple/out/twoElements.js +++ /dev/null @@ -1,14 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - { - var a = [1, 2]; - return a[0] == 1 && a[1] == 2; - } -} -}, {}); -foo.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/forLoop.js b/k2js/translator/testFiles/webDemoExamples1/out/forLoop.js deleted file mode 100644 index 39a2a383097..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/forLoop.js +++ /dev/null @@ -1,33 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - var tmp$1; - var tmp$0; - { - tmp$0 = Kotlin.arrayIterator(args); - while (tmp$0.hasNext()) { - var arg = tmp$0.next(); - { - Kotlin.println(arg); - } - } - } - Kotlin.println(); - { - tmp$1 = Kotlin.arrayIndices(args).iterator(); - while (tmp$1.hasNext()) { - var i = tmp$1.next(); - { - Kotlin.println(args[i]); - } - } - } - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/ifAsExpression.js b/k2js/translator/testFiles/webDemoExamples1/out/ifAsExpression.js deleted file mode 100644 index 49eb815c788..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/ifAsExpression.js +++ /dev/null @@ -1,23 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - Kotlin.println(Anonymous.max(Kotlin.parseInt(args[0]), Kotlin.parseInt(args[1]))); - } -} -, max:function(a, b){ - var tmp$0; - if (a > b) - tmp$0 = a; - else - tmp$0 = b; - { - return tmp$0; - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/isCheck.js b/k2js/translator/testFiles/webDemoExamples1/out/isCheck.js deleted file mode 100644 index 44a9c6bbb3e..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/isCheck.js +++ /dev/null @@ -1,21 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - Kotlin.println(Anonymous.getStringLength('aaa')); - Kotlin.println(Anonymous.getStringLength(1)); - } -} -, getStringLength:function(obj){ - { - if (typeof obj == 'string') - return obj.length; - return null; - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/multiLanguageHello.js b/k2js/translator/testFiles/webDemoExamples1/out/multiLanguageHello.js deleted file mode 100644 index e25cab11cc3..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/multiLanguageHello.js +++ /dev/null @@ -1,40 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - var tmp$2; - var tmp$1; - var tmp$0; - if (args.length == 0) - tmp$0 = 'EN'; - else - tmp$0 = args[0]; - var language = tmp$0; - for (tmp$1 = 0; tmp$1 < 4; ++tmp$1) { - if (tmp$1 == 0) - if (language == 'EN') { - tmp$2 = 'Hello!'; - break; - } - if (tmp$1 == 1) - if (language == 'FR') { - tmp$2 = 'Salut!'; - break; - } - if (tmp$1 == 2) - if (language == 'IT') { - tmp$2 = 'Ciao!'; - break; - } - if (tmp$1 == 3) - tmp$2 = "Sorry, I can't greet you in " + language + ' yet'; - } - Kotlin.println(tmp$2); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/nullChecks.js b/k2js/translator/testFiles/webDemoExamples1/out/nullChecks.js deleted file mode 100644 index 744e68cf888..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/nullChecks.js +++ /dev/null @@ -1,33 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, myParseInt:function(str){ - { - try { - return Kotlin.parseInt(str); - } - catch (e) { - Kotlin.println("One of argument isn't Int"); - } - return null; - } -} -, main:function(args){ - { - if (args.length < 2) { - Kotlin.print('No number supplied'); - } - else { - var x = Anonymous.myParseInt(args[0]); - var y = Anonymous.myParseInt(args[1]); - if (x != null && y != null) { - Kotlin.print(x * y); - } - } - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/objectOrientedHello.js b/k2js/translator/testFiles/webDemoExamples1/out/objectOrientedHello.js deleted file mode 100644 index a2c79e7134a..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/objectOrientedHello.js +++ /dev/null @@ -1,25 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(name_0){ - this.$name = name_0; - } - , get_name:function(){ - return this.$name; - } - , greet:function(){ - { - Kotlin.println('Hello, ' + this.get_name() + '!'); - } - } - }); - return {Greeter:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - (new Anonymous.Greeter(args[0])).greet(); - } -} -}, {Greeter:classes.Greeter}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/patternMatching.js b/k2js/translator/testFiles/webDemoExamples1/out/patternMatching.js deleted file mode 100644 index 804b0e427c1..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/patternMatching.js +++ /dev/null @@ -1,45 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(){ - } - }); - return {MyClass:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - Anonymous.cases('Hello'); - Anonymous.cases(1); - Anonymous.cases(new Anonymous.MyClass); - Anonymous.cases('hello'); - } -} -, cases:function(obj){ - { - var tmp$1; - var tmp$0; - for (tmp$0 = 0; tmp$0 < 4; ++tmp$0) { - if (tmp$0 == 0) - if (obj == 1) { - tmp$1 = Kotlin.println('One'); - break; - } - if (tmp$0 == 1) - if (obj == 'Hello') { - tmp$1 = Kotlin.println('Greeting'); - break; - } - if (tmp$0 == 2) - if (!(typeof obj == 'string')) { - tmp$1 = Kotlin.println('Not a string'); - break; - } - if (tmp$0 == 3) - tmp$1 = Kotlin.println('Unknown'); - } - tmp$1; - } -} -}, {MyClass:classes.MyClass}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/printArg.js b/k2js/translator/testFiles/webDemoExamples1/out/printArg.js deleted file mode 100644 index 1d4bb0c45ef..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/printArg.js +++ /dev/null @@ -1,13 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - Kotlin.print(args[0]); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/ranges.js b/k2js/translator/testFiles/webDemoExamples1/out/ranges.js deleted file mode 100644 index 63df3d145d7..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/ranges.js +++ /dev/null @@ -1,39 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - var tmp$0; - var x = Kotlin.parseInt(args[0]); - var y = 10; - if ((new Kotlin.NumberRange(1, y - 1 - 1 + 1, false)).contains(x)) - Kotlin.println('OK'); - { - tmp$0 = (new Kotlin.NumberRange(1, 5 - 1 + 1, false)).iterator(); - while (tmp$0.hasNext()) { - var a = tmp$0.next(); - { - Kotlin.print(' ' + a); - } - } - } - Kotlin.println(); - var array = new Kotlin.ArrayList; - array.add('aaa'); - array.add('bbb'); - array.add('ccc'); - if (!(new Kotlin.NumberRange(0, array.size() - 0 + 1, false)).contains(x)) - Kotlin.println('Out: array has only ' + array.size() + ' elements. x = ' + x); - if (array.contains('aaa')) - Kotlin.println('Yes: array contains aaa'); - if (array.contains('ddd')) - Kotlin.println('Yes: array contains ddd'); - else - Kotlin.println("No: array doesn't contains ddd"); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples1/out/whileLoop.js b/k2js/translator/testFiles/webDemoExamples1/out/whileLoop.js deleted file mode 100644 index 8b6b3a7f076..00000000000 --- a/k2js/translator/testFiles/webDemoExamples1/out/whileLoop.js +++ /dev/null @@ -1,15 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - var i = 0; - while (i < args.length) - Kotlin.println(args[i++]); - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples2/out/bottles.js b/k2js/translator/testFiles/webDemoExamples2/out/bottles.js deleted file mode 100644 index b64617b2e03..00000000000 --- a/k2js/translator/testFiles/webDemoExamples2/out/bottles.js +++ /dev/null @@ -1,67 +0,0 @@ -var classes = function(){ - return {}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - if (Anonymous.isEmpty(args)) { - Anonymous.printBottles(99); - } - else { - var bottles = Kotlin.parseInt(args[0]); - if (bottles != null) { - Anonymous.printBottles(bottles); - } - else { - Kotlin.println("You have passed '" + args[0] + "' as a number of bottles, " + 'but it is not a valid integral number'); - } - } - } -} -, printBottles:function(bottleCount){ - { - if (bottleCount <= 0) { - Kotlin.println('No bottles - no song'); - return; - } - Kotlin.println('The ' + '"' + Anonymous.bottlesOfBeer_0(bottleCount) + '"' + ' song' + '\n'); - var bottles = bottleCount; - while (bottles > 0) { - var bottlesOfBeer = Anonymous.bottlesOfBeer_0(bottles); - Kotlin.print(bottlesOfBeer + ' on the wall, ' + bottlesOfBeer + '.' + '\n' + 'Take one down, pass it around, '); - bottles--; - Kotlin.println(Anonymous.bottlesOfBeer_0(bottles) + ' on the wall.' + '\n'); - } - Kotlin.println('No more bottles of beer on the wall, no more bottles of beer.\n' + ('Go to the store and buy some more, ' + Anonymous.bottlesOfBeer_0(bottleCount) + ' on the wall.')); - } -} -, bottlesOfBeer_0:function(count){ - var tmp$1; - var tmp$0; - for (tmp$0 = 0; tmp$0 < 3; ++tmp$0) { - if (tmp$0 == 0) - if (count == 0) { - tmp$1 = 'no more bottles'; - break; - } - if (tmp$0 == 1) - if (count == 1) { - tmp$1 = '1 bottle'; - break; - } - if (tmp$0 == 2) - tmp$1 = count + ' bottles'; - } - { - return tmp$1 + ' of beer'; - } -} -, isEmpty:function(receiver){ - { - return receiver.length == 0; - } -} -}, {}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples2/out/builder.js b/k2js/translator/testFiles/webDemoExamples2/out/builder.js deleted file mode 100644 index 8ff565ef968..00000000000 --- a/k2js/translator/testFiles/webDemoExamples2/out/builder.js +++ /dev/null @@ -1,301 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Trait.create({render:function(builder, indent){ - } - , toString:function(){ - { - var builder = new Kotlin.StringBuilder; - this.render(builder, ''); - return builder.toString(); - } - } - }); - var tmp$1 = Kotlin.Class.create(tmp$0, {initialize:function(name_0){ - this.$name = name_0; - this.$children = new Kotlin.ArrayList; - this.$attributes = new Kotlin.HashMap; - } - , get_name:function(){ - return this.$name; - } - , get_children:function(){ - return this.$children; - } - , get_attributes:function(){ - return this.$attributes; - } - , initTag:function(tag, init){ - { - init.call(tag); - this.get_children().add(tag); - return tag; - } - } - , render:function(builder, indent){ - { - var tmp$0; - builder.append(indent + '<' + this.get_name() + this.renderAttributes() + '>' + '\n'); - { - tmp$0 = this.get_children().iterator(); - while (tmp$0.hasNext()) { - var c = tmp$0.next(); - { - c.render(builder, indent + ' '); - } - } - } - builder.append(indent + '<\/' + this.get_name() + '>' + '\n'); - } - } - , renderAttributes:function(){ - { - var tmp$0; - var builder = new Kotlin.StringBuilder; - { - tmp$0 = this.get_attributes().keySet().iterator(); - while (tmp$0.hasNext()) { - var a = tmp$0.next(); - { - builder.append(' ' + a + '=' + '"' + this.get_attributes().get(a) + '"'); - } - } - } - return builder.toString(); - } - } - }); - var tmp$2 = Kotlin.Class.create(tmp$1, {initialize:function(name_0){ - this.super_init(name_0); - } - , plus:function(receiver){ - { - this.get_children().add(new Anonymous.TextElement(receiver)); - } - } - }); - var tmp$3 = Kotlin.Class.create(tmp$2, {initialize:function(name_0){ - this.super_init(name_0); - } - , b:function(init){ - { - return this.initTag(new Anonymous.B, init); - } - } - , p:function(init){ - { - return this.initTag(new Anonymous.P, init); - } - } - , h1:function(init){ - { - return this.initTag(new Anonymous.H1, init); - } - } - , ul:function(init){ - { - return this.initTag(new Anonymous.UL, init); - } - } - , a_0:function(href, init){ - { - var a = this.initTag(new Anonymous.A, init); - a.set_href(href); - } - } - }); - var tmp$4 = Kotlin.Class.create(tmp$3, {initialize:function(){ - this.super_init('a'); - } - , get_href:function(){ - { - return this.get_attributes().get('href'); - } - } - , set_href:function(value){ - { - Anonymous.set(this.get_attributes(), 'href', value); - } - } - }); - var tmp$5 = Kotlin.Class.create(tmp$3, {initialize:function(){ - this.super_init('h1'); - } - }); - var tmp$6 = Kotlin.Class.create(tmp$3, {initialize:function(){ - this.super_init('p'); - } - }); - var tmp$7 = Kotlin.Class.create(tmp$3, {initialize:function(){ - this.super_init('li'); - } - }); - var tmp$8 = Kotlin.Class.create(tmp$3, {initialize:function(){ - this.super_init('b'); - } - }); - var tmp$9 = Kotlin.Class.create(tmp$3, {initialize:function(){ - this.super_init('ul'); - } - , li:function(init){ - { - return this.initTag(new Anonymous.LI, init); - } - } - }); - var tmp$10 = Kotlin.Class.create(tmp$3, {initialize:function(){ - this.super_init('body'); - } - }); - var tmp$11 = Kotlin.Class.create(tmp$2, {initialize:function(){ - this.super_init('title'); - } - }); - var tmp$12 = Kotlin.Class.create(tmp$2, {initialize:function(){ - this.super_init('head'); - } - , title:function(init){ - { - return this.initTag(new Anonymous.Title, init); - } - } - }); - var tmp$13 = Kotlin.Class.create(tmp$2, {initialize:function(){ - this.super_init('html'); - } - , head:function(init){ - { - return this.initTag(new Anonymous.Head, init); - } - } - , body:function(init){ - { - return this.initTag(new Anonymous.Body, init); - } - } - }); - var tmp$14 = Kotlin.Class.create(tmp$0, {initialize:function(text){ - this.$text = text; - } - , get_text:function(){ - return this.$text; - } - , render:function(builder, indent){ - { - builder.append(indent + this.get_text() + '\n'); - } - } - }); - return {Title:tmp$11, Body:tmp$10, HTML:tmp$13, Head:tmp$12, TextElement:tmp$14, UL:tmp$9, H1:tmp$5, P:tmp$6, LI:tmp$7, B:tmp$8, Tag:tmp$1, TagWithText:tmp$2, BodyTag:tmp$3, A:tmp$4, Element_0:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, main:function(args){ - { - var result = Anonymous.html_0(function(){ - { - this.head(function(){ - { - this.title(function(){ - { - this.plus('XML encoding with Kotlin'); - } - } - ); - } - } - ); - this.body(function(){ - { - this.h1(function(){ - { - this.plus('XML encoding with Kotlin'); - } - } - ); - this.p(function(){ - { - this.plus('this format can be used as an alternative markup to XML'); - } - } - ); - this.a_0('http://jetbrains.com/kotlin', function(){ - { - this.plus('Kotlin'); - } - } - ); - this.p(function(){ - { - this.plus('This is some'); - this.b(function(){ - { - this.plus('mixed'); - } - } - ); - this.plus('text. For more see the'); - this.a_0('http://jetbrains.com/kotlin', function(){ - { - this.plus('Kotlin'); - } - } - ); - this.plus('project'); - } - } - ); - this.p(function(){ - { - this.plus('some text'); - } - } - ); - this.p(function(){ - { - this.plus('Command line arguments were:'); - this.ul(function(){ - { - var tmp$0; - { - tmp$0 = Kotlin.arrayIterator(args); - while (tmp$0.hasNext()) { - var arg = tmp$0.next(); - { - this.li(function(){ - { - this.plus(arg); - } - } - ); - } - } - } - } - } - ); - } - } - ); - } - } - ); - } - } - ); - Kotlin.println(result); - } -} -, html_0:function(init){ - { - var html = new Anonymous.HTML; - init.call(html); - return html; - } -} -, set:function(receiver, key, value){ - { - return receiver.put(key, value); - } -} -}, {Element_0:classes.Element_0, TextElement:classes.TextElement, Tag:classes.Tag, TagWithText:classes.TagWithText, HTML:classes.HTML, Head:classes.Head, Title:classes.Title, BodyTag:classes.BodyTag, Body:classes.Body, UL:classes.UL, B:classes.B, LI:classes.LI, P:classes.P, H1:classes.H1, A:classes.A}); -Anonymous.initialize(); diff --git a/k2js/translator/testFiles/webDemoExamples2/out/life.js b/k2js/translator/testFiles/webDemoExamples2/out/life.js deleted file mode 100644 index 15bb23c3152..00000000000 --- a/k2js/translator/testFiles/webDemoExamples2/out/life.js +++ /dev/null @@ -1,239 +0,0 @@ -var classes = function(){ - var tmp$0 = Kotlin.Class.create({initialize:function(width, height, init){ - this.$width = width; - this.$height = height; - this.$live = Kotlin.arrayFromFun(this.get_height(), (tmp$0_0 = this , function(i){ - { - var tmp$0; - return Kotlin.arrayFromFun(tmp$0_0.get_width(), (tmp$0 = tmp$0_0 , function(j){ - { - return init(i, j); - } - } - )); - } - } - )); - } - , get_width:function(){ - return this.$width; - } - , get_height:function(){ - return this.$height; - } - , get_live:function(){ - return this.$live; - } - , liveCount:function(i, j){ - var tmp$0; - if ((new Kotlin.NumberRange(0, this.get_height() - 1 - 0 + 1, false)).contains(i) && (new Kotlin.NumberRange(0, this.get_width() - 1 - 0 + 1, false)).contains(j) && this.get_live()[i][j]) - tmp$0 = 1; - else - tmp$0 = 0; - { - return tmp$0; - } - } - , liveNeighbors:function(i, j){ - { - return this.liveCount(i - 1, j - 1) + this.liveCount(i - 1, j) + this.liveCount(i - 1, j + 1) + this.liveCount(i, j - 1) + this.liveCount(i, j + 1) + this.liveCount(i + 1, j - 1) + this.liveCount(i + 1, j) + this.liveCount(i + 1, j + 1); - } - } - , get:function(i, j){ - { - return this.get_live()[i][j]; - } - } - }); - return {Field:tmp$0}; -} -(); -var Anonymous = Kotlin.Namespace.create({initialize:function(){ -} -, next:function(field){ - { - return new Anonymous.Field(field.get_width(), field.get_height(), function(i, j){ - { - var n = field.liveNeighbors(i, j); - if (field.get(i, j)) - return (new Kotlin.NumberRange(2, 3 - 2 + 1, false)).contains(n); - else - return n == 3; - } - } - ); - } -} -, main:function(args){ - { - Anonymous.printField('***', 3); - Anonymous.printField('\n __*__\n _***_\n __*__\n ', 10); - Anonymous.printField('\n __*__\n _*_*_\n __*__\n ', 3); - Anonymous.printField('\n __**__\n __**__\n __**__\n ', 3); - Anonymous.printField('\n __**__\n __**__\n __**__\n __**__\n ', 6); - Anonymous.printField('\n ---------------\n ---***---***---\n ---------------\n -*----*-*----*-\n -*----*-*----*-\n -*----*-*----*-\n ---***---***---\n ---------------\n ---***---***---\n -*----*-*----*-\n -*----*-*----*-\n -*----*-*----*-\n ---------------\n ---***---***---\n ---------------\n ', 10); - } -} -, printField:function(s, steps){ - { - var tmp$0; - var field = Anonymous.makeField(s); - { - tmp$0 = (new Kotlin.NumberRange(1, steps - 1 + 1, false)).iterator(); - while (tmp$0.hasNext()) { - var step = tmp$0.next(); - { - var tmp$1; - Kotlin.println('Step: ' + step); - { - tmp$1 = (new Kotlin.NumberRange(0, field.get_height() - 1 - 0 + 1, false)).iterator(); - while (tmp$1.hasNext()) { - var i = tmp$1.next(); - { - var tmp$2; - { - tmp$2 = (new Kotlin.NumberRange(0, field.get_width() - 1 - 0 + 1, false)).iterator(); - while (tmp$2.hasNext()) { - var j = tmp$2.next(); - { - var tmp$3; - if (field.get(i, j)) - tmp$3 = '*'; - else - tmp$3 = ' '; - Kotlin.print(tmp$3); - } - } - } - Kotlin.println(''); - } - } - } - field = Anonymous.next(field); - } - } - } - } -} -, toList:function(receiver){ - { - return Anonymous.to(receiver, new Kotlin.ArrayList); - } -} -, get_size:function(receiver){ - var tmp$0; - if (receiver != null) - tmp$0 = receiver.length; - else - tmp$0 = 0; - { - return tmp$0; - } -} -, to:function(receiver, result){ - { - var tmp$0; - { - tmp$0 = Kotlin.arrayIterator(receiver); - while (tmp$0.hasNext()) { - var elem = tmp$0.next(); - { - result.add(elem); - } - } - } - return result; - } -} -, makeField:function(s){ - { - var tmp$2; - var tmp$0; - var lines = Kotlin.splitString(s, '\n'); - var w = Kotlin.sure(Kotlin.collectionsMax(Anonymous.toList(lines), Kotlin.comparator(function(o1, o2){ - { - var l1 = Anonymous.get_size(o1); - var l2 = Anonymous.get_size(o2); - return l1 - l2; - } - } - ))); - var data = Kotlin.arrayFromFun(lines.length, function(it_0){ - { - return Kotlin.arrayFromFun(Anonymous.get_size(w), function(it){ - { - return false; - } - } - ); - } - } - ); - { - tmp$0 = Kotlin.arrayIndices(data).iterator(); - while (tmp$0.hasNext()) { - var i_0 = tmp$0.next(); - { - var tmp$1; - data[i_0] = Kotlin.arrayFromFun(Anonymous.get_size(w), function(it){ - { - return false; - } - } - ); - { - tmp$1 = Kotlin.arrayIndices(data[i_0]).iterator(); - while (tmp$1.hasNext()) { - var j_0 = tmp$1.next(); - { - data[i_0][j_0] = false; - } - } - } - } - } - } - { - tmp$2 = Kotlin.arrayIndices(lines).iterator(); - while (tmp$2.hasNext()) { - var line = tmp$2.next(); - { - var tmp$3; - { - tmp$3 = Anonymous.get_indices(lines[line]).iterator(); - while (tmp$3.hasNext()) { - var x = tmp$3.next(); - { - var c = lines[line].charAt(x); - data[line][x] = c == '*'; - } - } - } - } - } - } - return new Anonymous.Field(Anonymous.get_size(w), lines.length, function(i, j){ - { - return data[i][j]; - } - } - ); - } -} -, get_indices:function(receiver){ - { - return new Kotlin.NumberRange(0, Anonymous.get_size(Kotlin.sure(receiver))); - } -} -, set:function(receiver, k, v){ - { - receiver.put(k, v); - } -} -, get_isEmpty:function(receiver){ - { - return receiver.length == 0; - } -} -}, {Field:classes.Field}); -Anonymous.initialize(); diff --git a/translator/lib/asm-util-3.3.1.jar b/translator/lib/asm-util-3.3.1.jar deleted file mode 100644 index 0230bbcfb71..00000000000 Binary files a/translator/lib/asm-util-3.3.1.jar and /dev/null differ diff --git a/translator/lib/guava-10.0.1.jar b/translator/lib/guava-10.0.1.jar deleted file mode 100644 index d107c0f3b0c..00000000000 Binary files a/translator/lib/guava-10.0.1.jar and /dev/null differ diff --git a/translator/lib/js.jar b/translator/lib/js.jar deleted file mode 100644 index 878b0d9422b..00000000000 Binary files a/translator/lib/js.jar and /dev/null differ diff --git a/translator/src/org/jetbrains/k2js/translate/context/TranslationContext.java b/translator/src/org/jetbrains/k2js/translate/context/TranslationContext.java deleted file mode 100644 index e28a0332e0b..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/context/TranslationContext.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.context; - -import com.google.dart.compiler.backend.js.ast.*; -import com.intellij.psi.PsiElement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.k2js.translate.intrinsic.Intrinsics; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getDescriptorForElement; - -/** - * @author Pavel Talanov - *

- * All the info about the state of the translation process. - */ -public final class TranslationContext { - - @NotNull - private final DynamicContext dynamicContext; - @NotNull - private final StaticContext staticContext; - - @NotNull - public static TranslationContext rootContext(@NotNull StaticContext staticContext) { - JsProgram program = staticContext.getProgram(); - JsBlock globalBlock = program.getGlobalBlock(); - return new TranslationContext(staticContext, - DynamicContext.rootContext(staticContext.getRootScope(), globalBlock)); - } - - private TranslationContext(@NotNull StaticContext staticContext, @NotNull DynamicContext dynamicContext) { - this.dynamicContext = dynamicContext; - this.staticContext = staticContext; - } - - @NotNull - public TranslationContext contextWithScope(@NotNull NamingScope newScope) { - return new TranslationContext(staticContext, DynamicContext.contextWithScope(newScope)); - } - - // Note: Should be used ONLY if scope has no corresponding descriptor - @NotNull - public TranslationContext innerJsScope(@NotNull JsScope enclosingScope) { - return new TranslationContext(staticContext, dynamicContext.innerScope(enclosingScope)); - } - - @NotNull - public TranslationContext innerBlock(@NotNull JsBlock block) { - return new TranslationContext(staticContext, dynamicContext.innerBlock(block)); - } - - @NotNull - public TranslationContext newDeclaration(@NotNull DeclarationDescriptor descriptor) { - return contextWithScope(getScopeForDescriptor(descriptor)); - } - - @NotNull - public TranslationContext newDeclaration(@NotNull PsiElement element) { - return newDeclaration(getDescriptorForElement(bindingContext(), element)); - } - - @NotNull - public BindingContext bindingContext() { - return staticContext.getBindingContext(); - } - - @NotNull - public NamingScope getScopeForDescriptor(@NotNull DeclarationDescriptor descriptor) { - return staticContext.getScopeForDescriptor(descriptor); - } - - @NotNull - public NamingScope getScopeForElement(@NotNull PsiElement element) { - DeclarationDescriptor descriptorForElement = getDescriptorForElement(bindingContext(), element); - return getScopeForDescriptor(descriptorForElement); - } - - @NotNull - public JsName getNameForElement(@NotNull PsiElement element) { - DeclarationDescriptor descriptor = getDescriptorForElement(bindingContext(), element); - return getNameForDescriptor(descriptor); - } - - @NotNull - public JsName getNameForDescriptor(@NotNull DeclarationDescriptor descriptor) { - return staticContext.getNameForDescriptor(descriptor); - } - - @Nullable - public JsNameRef getQualifierForDescriptor(@NotNull DeclarationDescriptor descriptor) { - return staticContext.getQualifierForDescriptor(descriptor.getOriginal()); - } - - @NotNull - public TemporaryVariable declareTemporary(@NotNull JsExpression initExpression) { - return dynamicContext.declareTemporary(initExpression); - } - - @NotNull - public Aliaser aliaser() { - return staticContext.getAliaser(); - } - - @NotNull - public Namer namer() { - return staticContext.getNamer(); - } - - @NotNull - public Intrinsics intrinsics() { - return staticContext.getIntrinsics(); - } - - @NotNull - public JsProgram program() { - return staticContext.getProgram(); - } - - @NotNull - private StandardClasses standardClasses() { - return staticContext.getStandardClasses(); - } - - @NotNull - public NamingScope getScope() { - return dynamicContext.getScope(); - } - - @NotNull - public JsScope jsScope() { - return dynamicContext.jsScope(); - } - - public void addStatementToCurrentBlock(@NotNull JsStatement statement) { - dynamicContext.jsBlock().addStatement(statement); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.java b/translator/src/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.java deleted file mode 100644 index e4daf2a6300..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/declaration/ClassDeclarationTranslator.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.declaration; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.psi.JetClass; -import org.jetbrains.k2js.translate.context.Namer; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.utils.BindingUtils; -import org.jetbrains.k2js.translate.utils.ClassSorter; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getAllClassesDefinedInNamespace; - -/** - * @author Pavel Talanov - *

- * Generates a big block where are all the classes(objects representing them) are created. - */ -public final class ClassDeclarationTranslator extends AbstractTranslator { - - @NotNull - private final List descriptors; - @NotNull - private final Map localToGlobalClassName; - @NotNull - private final JsScope dummyFunctionScope; - @Nullable - private JsName declarationsObject = null; - @Nullable - private JsStatement declarationsStatement = null; - - public ClassDeclarationTranslator(@NotNull List descriptors, - @NotNull TranslationContext context) { - super(context); - this.descriptors = descriptors; - this.localToGlobalClassName = new HashMap(); - this.dummyFunctionScope = new JsScope(context().jsScope(), "class declaration function"); - } - - public void generateDeclarations() { - declarationsObject = context().jsScope().declareName(Namer.nameForClassesVariable()); - assert declarationsObject != null; - declarationsStatement = - AstUtil.newVar(declarationsObject, generateDummyFunctionInvocation()); - } - - @NotNull - public JsName getDeclarationsObjectName() { - assert declarationsObject != null : "Should run generateDeclarations first"; - return declarationsObject; - } - - @NotNull - public JsStatement getDeclarationsStatement() { - assert declarationsStatement != null : "Should run generateDeclarations first"; - return declarationsStatement; - } - - @NotNull - private JsInvocation generateDummyFunctionInvocation() { - JsFunction dummyFunction = JsFunction.getAnonymousFunctionWithScope(dummyFunctionScope); - List classDeclarations = generateClassDeclarationStatements(); - classDeclarations.add(new JsReturn(generateReturnedObjectLiteral())); - dummyFunction.setBody(AstUtil.newBlock(classDeclarations)); - return AstUtil.newInvocation(dummyFunction); - } - - @NotNull - private JsObjectLiteral generateReturnedObjectLiteral() { - JsObjectLiteral returnedValueLiteral = new JsObjectLiteral(); - for (JsName localName : localToGlobalClassName.keySet()) { - returnedValueLiteral.getPropertyInitializers().add(classEntry(localName)); - } - return returnedValueLiteral; - } - - @NotNull - private JsPropertyInitializer classEntry(@NotNull JsName localName) { - return new JsPropertyInitializer(localToGlobalClassName.get(localName).makeRef(), localName.makeRef()); - } - - @NotNull - private List generateClassDeclarationStatements() { - List classDeclarations = new ArrayList(); - for (JetClass jetClass : getClassDeclarations()) { - classDeclarations.add(generateDeclaration(jetClass)); - } - removeAliases(); - return classDeclarations; - } - - private void removeAliases() { - for (JetClass jetClass : getClassDeclarations()) { - ClassDescriptor descriptor = BindingUtils.getClassDescriptor(bindingContext(), jetClass); - aliaser().removeAliasForDescriptor(descriptor); - } - } - - @NotNull - private List getClassDeclarations() { - List classes = new ArrayList(); - for (ClassDescriptor classDescriptor : descriptors) { - classes.add(BindingUtils.getClassForDescriptor(bindingContext(), classDescriptor)); - } - return ClassSorter.sortUsingInheritanceOrder(classes, bindingContext()); - } - - @NotNull - private JsStatement generateDeclaration(@NotNull JetClass declaration) { - JsName localClassName = generateLocalAlias(declaration); - JsInvocation classDeclarationExpression = - Translation.translateClassDeclaration(declaration, context()); - return AstUtil.newVar(localClassName, classDeclarationExpression); - } - - @NotNull - private JsName generateLocalAlias(@NotNull JetClass declaration) { - JsName globalClassName = context().getNameForElement(declaration); - JsName localAlias = dummyFunctionScope.declareTemporary(); - localToGlobalClassName.put(localAlias, globalClassName); - ClassDescriptor descriptor = BindingUtils.getClassDescriptor(bindingContext(), declaration); - aliaser().setAliasForDescriptor(descriptor, localAlias); - return localAlias; - } - - @NotNull - public JsObjectLiteral classDeclarationsForNamespace(@NotNull NamespaceDescriptor namespaceDescriptor) { - JsObjectLiteral result = new JsObjectLiteral(); - for (ClassDescriptor classDescriptor : getAllClassesDefinedInNamespace(namespaceDescriptor)) { - result.getPropertyInitializers().add(getClassNameToClassObject(classDescriptor)); - } - return result; - } - - @NotNull - private JsPropertyInitializer getClassNameToClassObject(@NotNull ClassDescriptor classDescriptor) { - JsName className = context().getNameForDescriptor(classDescriptor); - JsNameRef alreadyDefinedClassReferernce = AstUtil.qualified(className, getDeclarationsObjectName().makeRef()); - return new JsPropertyInitializer(className.makeRef(), alreadyDefinedClassReferernce); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/declaration/ClassTranslator.java b/translator/src/org/jetbrains/k2js/translate/declaration/ClassTranslator.java deleted file mode 100644 index 590121d94ff..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/declaration/ClassTranslator.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.declaration; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.ClassKind; -import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; -import org.jetbrains.jet.lang.psi.JetClassOrObject; -import org.jetbrains.jet.lang.psi.JetParameter; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; - -import java.util.ArrayList; -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getClassDescriptor; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getPropertyDescriptorForConstructorParameter; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.findAncestorClass; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getSuperclassDescriptors; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getPrimaryConstructorParameters; - -/** - * @author Pavel Talanov - *

- * Generates a definition of a single class. - */ -public final class ClassTranslator extends AbstractTranslator { - - @NotNull - public static JsPropertyInitializer translateAsProperty(@NotNull JetClassOrObject classDeclaration, - @NotNull TranslationContext context) { - JsInvocation classCreationExpression = generateClassCreationExpression(classDeclaration, context); - JsName className = context.getNameForElement(classDeclaration); - return new JsPropertyInitializer(className.makeRef(), classCreationExpression); - } - - @NotNull - public static JsInvocation generateClassCreationExpression(@NotNull JetClassOrObject classDeclaration, - @NotNull TranslationContext context) { - return (new ClassTranslator(classDeclaration, context)).translateClass(); - } - - @NotNull - private final DeclarationBodyVisitor declarationBodyVisitor = new DeclarationBodyVisitor(); - - @NotNull - private final JetClassOrObject classDeclaration; - - @NotNull - private final ClassDescriptor descriptor; - - private ClassTranslator(@NotNull JetClassOrObject classDeclaration, @NotNull TranslationContext context) { - super(context.newDeclaration(classDeclaration)); - this.descriptor = getClassDescriptor(context.bindingContext(), classDeclaration); - this.classDeclaration = classDeclaration; - } - - @NotNull - private JsInvocation translateClass() { - JsInvocation jsClassDeclaration = classCreateMethodInvocation(); - addSuperclassReferences(jsClassDeclaration); - addClassOwnDeclarations(jsClassDeclaration); - return jsClassDeclaration; - } - - @NotNull - private JsInvocation classCreateMethodInvocation() { - if (isObject()) { - return AstUtil.newInvocation(context().namer().objectCreationMethodReference()); - } else if (isTrait()) { - return AstUtil.newInvocation(context().namer().traitCreationMethodReference()); - } else { - return AstUtil.newInvocation(context().namer().classCreationMethodReference()); - } - } - - private boolean isObject() { - return descriptor.getKind().equals(ClassKind.OBJECT); - } - - private boolean isTrait() { - return descriptor.getKind().equals(ClassKind.TRAIT); - } - - private void addClassOwnDeclarations(@NotNull JsInvocation jsClassDeclaration) { - JsObjectLiteral jsClassDescription = translateClassDeclarations(); - jsClassDeclaration.getArguments().add(jsClassDescription); - } - - private void addSuperclassReferences(@NotNull JsInvocation jsClassDeclaration) { - for (JsExpression superClassReference : getSuperclassNameReferences()) { - jsClassDeclaration.getArguments().add(superClassReference); - } - } - - @NotNull - private List getSuperclassNameReferences() { - List superclassReferences = new ArrayList(); - List superclassDescriptors = getSuperclassDescriptors(descriptor); - addAncestorClass(superclassReferences, superclassDescriptors); - addTraits(superclassReferences, superclassDescriptors); - return superclassReferences; - } - - private void addTraits(@NotNull List superclassReferences, - @NotNull List superclassDescriptors) { - for (ClassDescriptor superClassDescriptor : - superclassDescriptors) { - assert (superClassDescriptor.getKind() == ClassKind.TRAIT) : "Only traits are expected here"; - superclassReferences.add(getClassReference(superClassDescriptor)); - } - } - - private void addAncestorClass(@NotNull List superclassReferences, - @NotNull List superclassDescriptors) { - //here we remove ancestor class from the list - ClassDescriptor ancestorClass = findAndRemoveAncestorClass(superclassDescriptors); - if (ancestorClass != null) { - superclassReferences.add(getClassReference(ancestorClass)); - } - } - - @NotNull - private JsExpression getClassReference(@NotNull ClassDescriptor superClassDescriptor) { - //NOTE: aliasing here is needed for the declaration generation step - if (aliaser().hasAliasForDeclaration(superClassDescriptor)) { - return aliaser().getAliasForDeclaration(superClassDescriptor).makeRef(); - } - return context().getNameForDescriptor(superClassDescriptor).makeRef(); - } - - @Nullable - private ClassDescriptor findAndRemoveAncestorClass(@NotNull List superclassDescriptors) { - ClassDescriptor ancestorClass = findAncestorClass(superclassDescriptors); - superclassDescriptors.remove(ancestorClass); - return ancestorClass; - } - - @NotNull - private JsObjectLiteral translateClassDeclarations() { - List propertyList = new ArrayList(); - if (!isTrait()) { - propertyList.add(Translation.generateClassInitializerMethod(classDeclaration, context())); - } - propertyList.addAll(translatePropertiesAsConstructorParameters()); - propertyList.addAll(declarationBodyVisitor.traverseClass(classDeclaration, context())); - return new JsObjectLiteral(propertyList); - } - - @NotNull - private List translatePropertiesAsConstructorParameters() { - List result = new ArrayList(); - for (JetParameter parameter : getPrimaryConstructorParameters(classDeclaration)) { - PropertyDescriptor descriptor = - getPropertyDescriptorForConstructorParameter(bindingContext(), parameter); - if (descriptor != null) { - result.addAll(PropertyTranslator.translateAccessors(descriptor, context())); - } - } - return result; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/declaration/DeclarationBodyVisitor.java b/translator/src/org/jetbrains/k2js/translate/declaration/DeclarationBodyVisitor.java deleted file mode 100644 index 2cdb5629247..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/declaration/DeclarationBodyVisitor.java +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.declaration; - -import com.google.dart.compiler.backend.js.ast.JsPropertyInitializer; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.general.TranslatorVisitor; -import org.jetbrains.k2js.translate.utils.BindingUtils; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getDeclarationsForNamespace; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getPropertyDescriptorForObjectDeclaration; - -/** - * @author Pavel Talanov - */ -public final class DeclarationBodyVisitor extends TranslatorVisitor> { - - - @NotNull - public List traverseClass(@NotNull JetClassOrObject jetClass, - @NotNull TranslationContext context) { - List properties = new ArrayList(); - for (JetDeclaration declaration : jetClass.getDeclarations()) { - properties.addAll(declaration.accept(this, context)); - } - return properties; - } - - @NotNull - public List traverseNamespace(@NotNull NamespaceDescriptor namespace, - @NotNull TranslationContext context) { - List properties = new ArrayList(); - for (JetDeclaration declaration : getDeclarationsForNamespace(context.bindingContext(), namespace)) { - properties.addAll(declaration.accept(this, context)); - } - return properties; - } - - @Override - @NotNull - public List visitClass(@NotNull JetClass expression, @NotNull TranslationContext context) { - return Collections.emptyList(); - } - - @Override - @NotNull - public List visitNamedFunction(@NotNull JetNamedFunction expression, - @NotNull TranslationContext context) { - return Collections.singletonList(Translation.functionTranslator(expression, context).translateAsMethod()); - } - - @Override - @NotNull - public List visitProperty(@NotNull JetProperty expression, - @NotNull TranslationContext context) { - PropertyDescriptor propertyDescriptor = - BindingUtils.getPropertyDescriptor(context.bindingContext(), expression); - return PropertyTranslator.translateAccessors(propertyDescriptor, context); - } - - @Override - @NotNull - public List visitObjectDeclaration(@NotNull JetObjectDeclaration expression, - @NotNull TranslationContext context) { - return Collections.singletonList(ClassTranslator.translateAsProperty(expression, context)); - } - - @Override - @NotNull - public List visitObjectDeclarationName(@NotNull JetObjectDeclarationName expression, - @NotNull TranslationContext context) { - PropertyDescriptor propertyDescriptor = - getPropertyDescriptorForObjectDeclaration(context.bindingContext(), expression); - return PropertyTranslator.translateAccessors(propertyDescriptor, context); - } - - @Override - @NotNull - public List visitAnonymousInitializer(@NotNull JetClassInitializer expression, - @NotNull TranslationContext context) { - // parsed it in initializer visitor => no additional actions are needed - return Collections.emptyList(); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceDeclarationTranslator.java b/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceDeclarationTranslator.java deleted file mode 100644 index 4309096dd25..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceDeclarationTranslator.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.declaration; - -import com.google.common.collect.Lists; -import com.google.dart.compiler.backend.js.ast.JsStatement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; - -import java.util.List; -import java.util.Set; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getAllNonNativeNamespaceDescriptors; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getAllClassesDefinedInNamespace; - -/** - * @author Pavel Talanov - */ -public final class NamespaceDeclarationTranslator extends AbstractTranslator { - - public static List translateFiles(@NotNull List files, @NotNull TranslationContext context) { - Set namespaceDescriptorSet = getAllNonNativeNamespaceDescriptors(context.bindingContext(), files); - return (new NamespaceDeclarationTranslator(Lists.newArrayList(namespaceDescriptorSet), context)).translate(); - } - - @NotNull - private final ClassDeclarationTranslator classDeclarationTranslator; - @NotNull - private final List namespaceDescriptors; - - private NamespaceDeclarationTranslator(@NotNull List namespaceDescriptors, - @NotNull TranslationContext context) { - super(context); - this.namespaceDescriptors = namespaceDescriptors; - this.classDeclarationTranslator = new ClassDeclarationTranslator(getAllClasses(), context); - } - - @NotNull - private List getAllClasses() { - List result = Lists.newArrayList(); - for (NamespaceDescriptor namespaceDescriptor : namespaceDescriptors) { - result.addAll(getAllClassesDefinedInNamespace(namespaceDescriptor)); - } - return result; - } - - @NotNull - private List translate() { - List result = classesDeclarations(); - result.addAll(namespacesDeclarations()); - return result; - } - - @NotNull - private List classesDeclarations() { - List result = Lists.newArrayList(); - classDeclarationTranslator.generateDeclarations(); - result.add(classDeclarationTranslator.getDeclarationsStatement()); - return result; - } - - @NotNull - private List namespacesDeclarations() { - List result = Lists.newArrayList(); - List namespaceTranslators = getTranslatorsForNonEmptyNamespaces(); - result.addAll(declarationStatements(namespaceTranslators)); - result.addAll(initializeStatements(namespaceTranslators)); - return result; - } - - @NotNull - private List getTranslatorsForNonEmptyNamespaces() { - List namespaceTranslators = Lists.newArrayList(); - for (NamespaceDescriptor descriptor : namespaceDescriptors) { - NamespaceTranslator namespaceTranslator = - new NamespaceTranslator(descriptor, classDeclarationTranslator, context()); - if (!namespaceTranslator.isNamespaceEmpty()) { - namespaceTranslators.add(namespaceTranslator); - } - } - return namespaceTranslators; - } - - @NotNull - private List declarationStatements(@NotNull List namespaceTranslators) { - List result = Lists.newArrayList(); - for (NamespaceTranslator translator : namespaceTranslators) { - result.add(translator.getDeclarationStatement()); - } - return result; - } - - @NotNull - private List initializeStatements(@NotNull List namespaceTranslators) { - List result = Lists.newArrayList(); - for (NamespaceTranslator translator : namespaceTranslators) { - result.add(translator.getInitializeStatement()); - } - return result; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.java b/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.java deleted file mode 100644 index 6562fe3c40e..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/declaration/NamespaceTranslator.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.declaration; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.k2js.translate.context.Namer; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.utils.BindingUtils; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Pavel.Talanov - *

- * Genereate code for a single descriptor. - */ -public final class NamespaceTranslator extends AbstractTranslator { - - @NotNull - private final NamespaceDescriptor descriptor; - @NotNull - private final JsName namespaceName; - @NotNull - private final ClassDeclarationTranslator classDeclarationTranslator; - - /*package*/ NamespaceTranslator(@NotNull NamespaceDescriptor descriptor, - @NotNull ClassDeclarationTranslator classDeclarationTranslator, - @NotNull TranslationContext context) { - super(context.newDeclaration(descriptor)); - this.descriptor = descriptor; - this.namespaceName = context.getNameForDescriptor(descriptor); - this.classDeclarationTranslator = classDeclarationTranslator; - } - - //TODO: at the moment this check is very ineffective, possible solution is to cash the result of getDFN - // other solution is to determine it's not affecting performance :D - public boolean isNamespaceEmpty() { - return BindingUtils.getDeclarationsForNamespace(bindingContext(), descriptor).isEmpty(); - } - - - @NotNull - public JsStatement getInitializeStatement() { - JsNameRef initializeMethodReference = Namer.initializeMethodReference(); - AstUtil.setQualifier(initializeMethodReference, namespaceName.makeRef()); - return AstUtil.newInvocation(initializeMethodReference).makeStmt(); - } - - @NotNull - private JsInvocation namespaceCreateMethodInvocation() { - return AstUtil.newInvocation(context().namer().namespaceCreationMethodReference()); - } - - @NotNull - public JsStatement getDeclarationStatement() { - JsInvocation namespaceDeclaration = namespaceCreateMethodInvocation(); - addMemberDeclarations(namespaceDeclaration); - addClassesDeclarations(namespaceDeclaration); - return AstUtil.newVar(namespaceName, namespaceDeclaration); - } - - private void addClassesDeclarations(@NotNull JsInvocation namespaceDeclaration) { - namespaceDeclaration.getArguments().add(classDeclarationTranslator.classDeclarationsForNamespace(descriptor)); - } - - private void addMemberDeclarations(@NotNull JsInvocation jsNamespace) { - JsObjectLiteral jsClassDescription = translateNamespaceMemberDeclarations(); - jsNamespace.getArguments().add(jsClassDescription); - } - - @NotNull - private JsObjectLiteral translateNamespaceMemberDeclarations() { - List propertyList = new ArrayList(); - propertyList.add(Translation.generateNamespaceInitializerMethod(descriptor, context())); - propertyList.addAll(new DeclarationBodyVisitor().traverseNamespace(descriptor, context())); - return new JsObjectLiteral(propertyList); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/declaration/PropertyTranslator.java b/translator/src/org/jetbrains/k2js/translate/declaration/PropertyTranslator.java deleted file mode 100644 index 7fb2a4ac820..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/declaration/PropertyTranslator.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.declaration; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertyGetterDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertySetterDescriptor; -import org.jetbrains.jet.lang.psi.JetProperty; -import org.jetbrains.jet.lang.psi.JetPropertyAccessor; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.utils.BindingUtils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.TranslationUtils.*; - -/** - * @author Pavel Talanov - *

- * Translates single property /w accessors. - */ -public final class PropertyTranslator extends AbstractTranslator { - - @NotNull - private final PropertyDescriptor property; - @NotNull - private final List accessors = new ArrayList(); - @Nullable - private final JetProperty declaration; - - static public List translateAccessors(@NotNull PropertyDescriptor descriptor, - @NotNull TranslationContext context) { - PropertyTranslator propertyTranslator = new PropertyTranslator(descriptor, context); - return propertyTranslator.translate(); - } - - private PropertyTranslator(@NotNull PropertyDescriptor property, @NotNull TranslationContext context) { - super(context); - this.property = property; - this.declaration = BindingUtils.getPropertyForDescriptor(bindingContext(), property); - } - - @NotNull - private List translate() { - addGetter(); - if (property.isVar()) { - addSetter(); - } - return accessors; - } - - private void addGetter() { - if (hasCustomGetter()) { - accessors.add(translateCustomAccessor(getCustomGetterDeclaration())); - } else { - accessors.add(generateDefaultGetter()); - } - } - - private void addSetter() { - if (hasCustomSetter()) { - accessors.add(translateCustomAccessor(getCustomSetterDeclaration())); - } else { - accessors.add(generateDefaultSetter()); - } - } - - private boolean hasCustomGetter() { - return ((declaration != null) && (declaration.getGetter() != null)); - } - - private boolean hasCustomSetter() { - return ((declaration != null) && (declaration.getSetter() != null)); - } - - @NotNull - private JetPropertyAccessor getCustomGetterDeclaration() { - assert declaration != null; - JetPropertyAccessor getterDeclaration = declaration.getGetter(); - assert getterDeclaration != null; - return getterDeclaration; - } - - @NotNull - private JetPropertyAccessor getCustomSetterDeclaration() { - assert declaration != null; - JetPropertyAccessor setter = declaration.getSetter(); - assert setter != null; - return setter; - } - - @NotNull - private JsPropertyInitializer generateDefaultGetter() { - PropertyGetterDescriptor getterDescriptor = property.getGetter(); - assert getterDescriptor != null : "Getter descriptor should not be null"; - return AstUtil.newNamedMethod(context().getNameForDescriptor(getterDescriptor), - generateDefaultGetterFunction(getterDescriptor)); - } - - @NotNull - private JsFunction generateDefaultGetterFunction(@NotNull PropertyGetterDescriptor descriptor) { - JsReturn returnExpression = new JsReturn(backingFieldReference(context(), property)); - JsFunction getterFunction = functionWithScope(context().getScopeForDescriptor(descriptor)); - getterFunction.setBody(AstUtil.convertToBlock(returnExpression)); - return getterFunction; - } - - @NotNull - private JsPropertyInitializer generateDefaultSetter() { - PropertySetterDescriptor setterDescriptor = property.getSetter(); - assert setterDescriptor != null : "Setter descriptor should not be null"; - return AstUtil.newNamedMethod(context().getNameForDescriptor(setterDescriptor), - generateDefaultSetterFunction(setterDescriptor)); - } - - @NotNull - private JsFunction generateDefaultSetterFunction(@NotNull PropertySetterDescriptor propertySetterDescriptor) { - JsFunction result = functionWithScope(context().getScopeForDescriptor(propertySetterDescriptor)); - JsParameter defaultParameter = - new JsParameter(propertyAccessContext(propertySetterDescriptor).jsScope().declareTemporary()); - JsStatement assignment = assignmentToBackingField(context(), property, defaultParameter.getName().makeRef()); - result.setParameters(Arrays.asList(defaultParameter)); - result.setBody(AstUtil.convertToBlock(assignment)); - return result; - } - - @NotNull - private TranslationContext propertyAccessContext(@NotNull PropertySetterDescriptor propertySetterDescriptor) { - return context().newDeclaration(propertySetterDescriptor); - } - - @NotNull - private JsPropertyInitializer translateCustomAccessor(@NotNull JetPropertyAccessor expression) { - return Translation.functionTranslator(expression, context()).translateAsMethod(); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/ExpressionVisitor.java b/translator/src/org/jetbrains/k2js/translate/expression/ExpressionVisitor.java deleted file mode 100644 index ba564959d8a..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/ExpressionVisitor.java +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; -import org.jetbrains.jet.lang.resolve.constants.NullValue; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.declaration.ClassTranslator; -import org.jetbrains.k2js.translate.expression.foreach.ForTranslator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.general.TranslatorVisitor; -import org.jetbrains.k2js.translate.operation.BinaryOperationTranslator; -import org.jetbrains.k2js.translate.operation.IncrementTranslator; -import org.jetbrains.k2js.translate.operation.UnaryOperationTranslator; -import org.jetbrains.k2js.translate.reference.*; -import org.jetbrains.k2js.translate.utils.BindingUtils; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.*; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getObjectDeclarationName; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.translateInitializerForProperty; - -/** - * @author Pavel Talanov - */ -public final class ExpressionVisitor extends TranslatorVisitor { - - @NotNull - private JsExpression translateAsExpression(@NotNull JetExpression expression, - @NotNull TranslationContext context) { - return AstUtil.convertToExpression(expression.accept(this, context)); - } - - @Override - @NotNull - public JsNode visitConstantExpression(@NotNull JetConstantExpression expression, - @NotNull TranslationContext context) { - CompileTimeConstant compileTimeValue = - context.bindingContext().get(BindingContext.COMPILE_TIME_VALUE, expression); - assert compileTimeValue != null; - if (compileTimeValue instanceof NullValue) { - return context.program().getNullLiteral(); - } - Object value = compileTimeValue.getValue(); - if (value instanceof Integer) { - return context.program().getNumberLiteral((Integer) value); - } - if (value instanceof Boolean) { - return context.program().getBooleanLiteral((Boolean) value); - } - - //TODO: test - if (value instanceof Float) { - return context.program().getNumberLiteral((Float) value); - } - if (value instanceof Double) { - return context.program().getNumberLiteral((Double) value); - } - if (value instanceof String) { - return context.program().getStringLiteral((String) value); - } - if (value instanceof Character) { - return context.program().getStringLiteral(value.toString()); - } - //TODO: all values - throw new AssertionError("Unsupported constant expression" + expression.toString()); - } - - @Override - @NotNull - public JsNode visitBlockExpression(@NotNull JetBlockExpression jetBlock, @NotNull TranslationContext context) { - List statements = jetBlock.getStatements(); - JsBlock jsBlock = new JsBlock(); - TranslationContext blockContext = context.innerBlock(jsBlock); - for (JetElement statement : statements) { - assert statement instanceof JetExpression : "Elements in JetBlockExpression " + - "should be of type JetExpression"; - JsNode jsNode = statement.accept(this, blockContext); - jsBlock.addStatement(AstUtil.convertToStatement(jsNode)); - } - return jsBlock; - } - - @Override - @NotNull - public JsNode visitReturnExpression(@NotNull JetReturnExpression jetReturnExpression, - @NotNull TranslationContext context) { - JetExpression returnedExpression = jetReturnExpression.getReturnedExpression(); - if (returnedExpression != null) { - JsExpression jsExpression = translateAsExpression(returnedExpression, context); - return new JsReturn(jsExpression); - } - return new JsReturn(); - } - - @Override - @NotNull - public JsNode visitParenthesizedExpression(@NotNull JetParenthesizedExpression expression, - @NotNull TranslationContext context) { - JetExpression expressionInside = expression.getExpression(); - if (expressionInside != null) { - return expressionInside.accept(this, context); - } - return context.program().getEmptyStmt(); - } - - @Override - @NotNull - public JsNode visitBinaryExpression(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - return BinaryOperationTranslator.translate(expression, context); - } - - @Override - @NotNull - // assume it is a local variable declaration - public JsNode visitProperty(@NotNull JetProperty expression, @NotNull TranslationContext context) { - DeclarationDescriptor descriptor = getDescriptorForElement(context.bindingContext(), expression); - JsName jsPropertyName = context.getNameForDescriptor(descriptor); - JsExpression jsInitExpression = translateInitializerForProperty(expression, context); - return AstUtil.newVar(jsPropertyName, jsInitExpression); - } - - @Override - @NotNull - public JsNode visitCallExpression(@NotNull JetCallExpression expression, - @NotNull TranslationContext context) { - return CallExpressionTranslator.translate(expression, null, CallType.NORMAL, context); - } - - @Override - @NotNull - public JsNode visitIfExpression(@NotNull JetIfExpression expression, @NotNull TranslationContext context) { - JsIf ifStatement = translateAsIfStatement(expression, context); - if (BindingUtils.isStatement(context.bindingContext(), expression)) { - return ifStatement; - } - TemporaryVariable result = context.declareTemporary(context.program().getNullLiteral()); - AstUtil.SaveLastExpressionMutator saveResultToTemporaryMutator = - new AstUtil.SaveLastExpressionMutator(result.reference()); - JsNode mutatedIfStatement = AstUtil.mutateLastExpression(ifStatement, - saveResultToTemporaryMutator); - JsStatement resultingStatement = AstUtil.convertToStatement(mutatedIfStatement); - context.addStatementToCurrentBlock(resultingStatement); - return result.reference(); - } - - @Override - @NotNull - public JsNode visitSimpleNameExpression(@NotNull JetSimpleNameExpression expression, - @NotNull TranslationContext context) { - return ReferenceTranslator.translateSimpleName(expression, context); - } - - - @NotNull - private JsIf translateAsIfStatement(@NotNull JetIfExpression expression, - @NotNull TranslationContext context) { - JsIf result = new JsIf(); - result.setIfExpr(translateConditionExpression(expression.getCondition(), context)); - result.setThenStmt(translateNullableExpressionAsNotNullStatement(expression.getThen(), context)); - result.setElseStmt(translateElseAsStatement(expression, context)); - return result; - } - - @Nullable - private JsStatement translateElseAsStatement(@NotNull JetIfExpression expression, - @NotNull TranslationContext context) { - JetExpression jetElse = expression.getElse(); - if (jetElse == null) { - return null; - } - return AstUtil.convertToStatement(jetElse.accept(this, context)); - } - - @NotNull - private JsStatement translateNullableExpressionAsNotNullStatement(@Nullable JetExpression nullableExpression, - @NotNull TranslationContext context) { - if (nullableExpression == null) { - return context.program().getEmptyStmt(); - } - return AstUtil.convertToStatement(nullableExpression.accept(this, context)); - } - - @NotNull - private JsExpression translateConditionExpression(@Nullable JetExpression expression, - @NotNull TranslationContext context) { - JsExpression jsCondition = translateNullableExpression(expression, context); - assert (jsCondition != null) : "Condition should not be empty"; - return AstUtil.convertToExpression(jsCondition); - } - - @Nullable - private JsExpression translateNullableExpression(@Nullable JetExpression expression, - @NotNull TranslationContext context) { - if (expression == null) { - return null; - } - return translateAsExpression(expression, context); - } - - @Override - @NotNull - public JsNode visitWhileExpression(@NotNull JetWhileExpression expression, @NotNull TranslationContext context) { - JsWhile result = new JsWhile(); - result.setCondition(translateConditionExpression(expression.getCondition(), context)); - result.setBody(translateNullableExpressionAsNotNullStatement(expression.getBody(), context)); - return result; - } - - @Override - @NotNull - public JsNode visitDoWhileExpression(@NotNull JetDoWhileExpression expression, @NotNull TranslationContext context) { - JsDoWhile result = new JsDoWhile(); - result.setCondition(translateConditionExpression(expression.getCondition(), context)); - result.setBody(translateNullableExpressionAsNotNullStatement(expression.getBody(), context)); - return result; - } - - @Override - @NotNull - public JsNode visitStringTemplateExpression(@NotNull JetStringTemplateExpression expression, - @NotNull TranslationContext context) { - JsStringLiteral stringLiteral = resolveAsStringConstant(expression, context); - if (stringLiteral != null) { - return stringLiteral; - } - return resolveAsTemplate(expression, context); - } - - @NotNull - private JsNode resolveAsTemplate(@NotNull JetStringTemplateExpression expression, - @NotNull TranslationContext context) { - return StringTemplateTranslator.translate(expression, context); - } - - @Nullable - private JsStringLiteral resolveAsStringConstant(@NotNull JetExpression expression, - @NotNull TranslationContext context) { - Object value = getCompileTimeValue(context.bindingContext(), expression); - if (value == null) { - return null; - } - assert value instanceof String : "Compile time constant template should be a String constant."; - String constantString = (String) value; - return context.program().getStringLiteral(constantString); - } - - @Override - @NotNull - public JsNode visitDotQualifiedExpression(@NotNull JetDotQualifiedExpression expression, - @NotNull TranslationContext context) { - return QualifiedExpressionTranslator.translateQualifiedExpression(expression, context); - } - - @Override - @NotNull - public JsNode visitPrefixExpression(@NotNull JetPrefixExpression expression, - @NotNull TranslationContext context) { - return UnaryOperationTranslator.translate(expression, context); - - } - - @Override - @NotNull - public JsNode visitPostfixExpression(@NotNull JetPostfixExpression expression, - @NotNull TranslationContext context) { - return IncrementTranslator.translate(expression, context); - } - - @Override - @NotNull - public JsNode visitIsExpression(@NotNull JetIsExpression expression, - @NotNull TranslationContext context) { - return Translation.patternTranslator(context).translateIsExpression(expression); - } - - @Override - @NotNull - public JsNode visitSafeQualifiedExpression(@NotNull JetSafeQualifiedExpression expression, - @NotNull TranslationContext context) { - return QualifiedExpressionTranslator.translateQualifiedExpression(expression, context); - } - - @Override - @NotNull - public JsNode visitWhenExpression(@NotNull JetWhenExpression expression, - @NotNull TranslationContext context) { - return Translation.translateWhenExpression(expression, context); - } - - - @Override - @NotNull - public JsNode visitBinaryWithTypeRHSExpression(@NotNull JetBinaryExpressionWithTypeRHS expression, - @NotNull TranslationContext context) { - // we actually do not care for types in js - return Translation.translateExpression(expression.getLeft(), context); - } - - @Override - @NotNull - public JsNode visitBreakExpression(@NotNull JetBreakExpression expression, - @NotNull TranslationContext context) { - return new JsBreak(); - } - - @Override - @NotNull - public JsNode visitContinueExpression(@NotNull JetContinueExpression expression, - @NotNull TranslationContext context) { - return new JsContinue(); - } - - @Override - @NotNull - public JsNode visitFunctionLiteralExpression(@NotNull JetFunctionLiteralExpression expression, - @NotNull TranslationContext context) { - return Translation.functionTranslator(expression, context).translateAsLiteral(); - } - - @Override - @NotNull - public JsNode visitThisExpression(@NotNull JetThisExpression expression, - @NotNull TranslationContext context) { - DeclarationDescriptor descriptor = - getDescriptorForReferenceExpression(context.bindingContext(), expression.getInstanceReference()); - return TranslationUtils.getThisObject(context, descriptor); - } - - @Override - @NotNull - public JsNode visitArrayAccessExpression(@NotNull JetArrayAccessExpression expression, - @NotNull TranslationContext context) { - return AccessTranslator.translateAsGet(expression, context); - } - - @Override - @NotNull - public JsNode visitForExpression(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - return ForTranslator.translate(expression, context); - } - - @Override - @NotNull - public JsNode visitTryExpression(@NotNull JetTryExpression expression, - @NotNull TranslationContext context) { - return TryTranslator.translate(expression, context); - } - - @Override - @NotNull - public JsNode visitTupleExpression(@NotNull JetTupleExpression expression, - @NotNull TranslationContext context) { - JsArrayLiteral result = new JsArrayLiteral(); - for (JetExpression entry : expression.getEntries()) { - result.getExpressions().add(Translation.translateAsExpression(entry, context)); - } - return result; - } - - @Override - @NotNull - public JsNode visitThrowExpression(@NotNull JetThrowExpression expression, - @NotNull TranslationContext context) { - JetExpression thrownExpression = expression.getThrownExpression(); - assert thrownExpression != null : "Thrown expression must not be null"; - return new JsThrow(translateAsExpression(thrownExpression, context)); - } - - @Override - @NotNull - public JsNode visitObjectLiteralExpression(@NotNull JetObjectLiteralExpression expression, - @NotNull TranslationContext context) { - return ClassTranslator.generateClassCreationExpression(expression.getObjectDeclaration(), context); - } - - @Override - @NotNull - public JsNode visitObjectDeclaration(@NotNull JetObjectDeclaration expression, - @NotNull TranslationContext context) { - JetObjectDeclarationName objectDeclarationName = getObjectDeclarationName(expression); - DeclarationDescriptor descriptor = getDescriptorForElement(context.bindingContext(), objectDeclarationName); - JsName propertyName = context.getNameForDescriptor(descriptor); - JsExpression value = ClassTranslator.generateClassCreationExpression(expression, context); - return AstUtil.newVar(propertyName, value); - } - - @Override - @NotNull - public JsNode visitNamedFunction(@NotNull JetNamedFunction function, - @NotNull TranslationContext context) { - return FunctionTranslator.newInstance(function, context).translateAsLocalFunction(); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/FunctionTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/FunctionTranslator.java deleted file mode 100644 index 44be9f3f8a3..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/FunctionTranslator.java +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression; - - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.jet.lang.types.JetStandardClasses; -import org.jetbrains.jet.lang.types.JetType; -import org.jetbrains.k2js.translate.context.Namer; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.utils.DescriptorUtils; - -import java.util.ArrayList; -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getFunctionDescriptor; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.*; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.*; - - -/** - * @author Pavel Talanov - */ -public final class FunctionTranslator extends AbstractTranslator { - - @NotNull - public static FunctionTranslator newInstance(@NotNull JetDeclarationWithBody function, - @NotNull TranslationContext context) { - return new FunctionTranslator(function, context); - } - - @NotNull - private final JetDeclarationWithBody functionDeclaration; - @NotNull - private final JsFunction functionObject; - @NotNull - private final TranslationContext functionBodyContext; - @NotNull - private final FunctionDescriptor descriptor; - // function body needs to be explicitly created here to include it in the context - @NotNull - private final JsBlock functionBody; - - private FunctionTranslator(@NotNull JetDeclarationWithBody functionDeclaration, - @NotNull TranslationContext context) { - super(context); - this.functionBody = new JsBlock(); - this.descriptor = getFunctionDescriptor(context.bindingContext(), functionDeclaration); - this.functionDeclaration = functionDeclaration; - this.functionObject = createFunctionObject(); - this.functionBodyContext = functionBodyContext().innerBlock(functionBody); - } - - - @NotNull - public JsFunction translateAsLocalFunction() { - JsName functionName = context().getNameForElement(functionDeclaration); - JsFunction function = generateFunctionObject(); - function.setName(functionName); - return function; - } - - @NotNull - public JsPropertyInitializer translateAsMethod() { - JsName functionName = context().getNameForElement(functionDeclaration); - JsFunction function = generateFunctionObject(); - return new JsPropertyInitializer(functionName.makeRef(), function); - } - - @NotNull - public JsExpression translateAsLiteral() { - assert getExpectedThisDescriptor(descriptor) == null; - ClassDescriptor containingClass = getContainingClass(descriptor); - if (containingClass == null) { - return generateFunctionObject(); - } - return generateFunctionObjectWithAliasedThisReference(containingClass); - } - - @NotNull - private JsExpression generateFunctionObjectWithAliasedThisReference(@NotNull ClassDescriptor containingClass) { - TemporaryVariable aliasForThis = newAliasForThis(context(), containingClass); - JsFunction function = generateFunctionObject(); - removeAliasForThis(context(), containingClass); - return AstUtil.newSequence(aliasForThis.assignmentExpression(), function); - } - - @NotNull - private JsFunction generateFunctionObject() { - functionObject.setParameters(translateParameters()); - translateBody(); - functionObject.setBody(functionBody); - restoreContext(); - return functionObject; - } - - private void restoreContext() { - if (isExtensionFunction()) { - DeclarationDescriptor expectedReceiverDescriptor = getExpectedReceiverDescriptor(descriptor); - assert expectedReceiverDescriptor != null : "Extension functions should always have receiver descriptors."; - functionBodyContext.aliaser().removeAliasForThis(expectedReceiverDescriptor); - } - } - - @NotNull - private JsFunction createFunctionObject() { - if (isDeclaration()) { - return functionWithScope(context().getScopeForDescriptor(descriptor)); - } - if (isLiteral()) { - //TODO: changing this piece of code to more natural "same as for declaration" results in life test failing - //TODO: must investigate - return new JsFunction(context().jsScope()); - } - throw new AssertionError("Unsupported type of functionDeclaration."); - } - - private void translateBody() { - JetExpression jetBodyExpression = functionDeclaration.getBodyExpression(); - if (jetBodyExpression == null) { - assert descriptor.getModality().equals(Modality.ABSTRACT); - return; - } - JsNode realBody = Translation.translateExpression(jetBodyExpression, functionBodyContext); - functionBody.addStatement(wrapWithReturnIfNeeded(realBody, mustAddReturnToGeneratedFunctionBody())); - } - - private boolean mustAddReturnToGeneratedFunctionBody() { - JetType functionReturnType = descriptor.getReturnType(); - assert functionReturnType != null : "Function return typed type must be resolved."; - return (!functionDeclaration.hasBlockBody()) && (!JetStandardClasses.isUnit(functionReturnType)); - } - - @NotNull - private JsBlock wrapWithReturnIfNeeded(@NotNull JsNode body, boolean needsReturn) { - if (!needsReturn) { - return AstUtil.convertToBlock(body); - } - return AstUtil.convertToBlock(lastExpressionReturned(body)); - } - - private JsNode lastExpressionReturned(@NotNull JsNode body) { - return AstUtil.mutateLastExpression(body, new AstUtil.Mutator() { - @Override - @NotNull - public JsNode mutate(@NotNull JsNode node) { - if (!(node instanceof JsExpression)) { - return node; - } - return new JsReturn((JsExpression) node); - } - }); - } - - @NotNull - private TranslationContext functionBodyContext() { - if (isLiteral()) { - return context().innerJsScope(functionObject.getScope()); - } else { - return context().newDeclaration(functionDeclaration); - } - } - - @NotNull - private List translateParameters() { - List jsParameters = new ArrayList(); - mayBeAddThisParameterForExtensionFunction(jsParameters); - for (ValueParameterDescriptor valueParameter : descriptor.getValueParameters()) { - JsName parameterName = declareParameter(valueParameter); - jsParameters.add(new JsParameter(parameterName)); - } - return jsParameters; - } - - @NotNull - private JsName declareParameter(@NotNull ValueParameterDescriptor valueParameter) { - return context().getNameForDescriptor(valueParameter); - } - - private void mayBeAddThisParameterForExtensionFunction(@NotNull List jsParameters) { - if (isExtensionFunction()) { - JsName receiver = functionBodyContext.jsScope().declareName(Namer.getReceiverParameterName()); - DeclarationDescriptor expectedReceiverDescriptor = getExpectedReceiverDescriptor(descriptor); - assert expectedReceiverDescriptor != null; - aliaser().setAliasForThis(expectedReceiverDescriptor, receiver); - jsParameters.add(new JsParameter(receiver)); - } - } - - private boolean isExtensionFunction() { - return DescriptorUtils.isExtensionFunction(descriptor) && !isLiteral(); - } - - private boolean isLiteral() { - return functionDeclaration instanceof JetFunctionLiteralExpression; - } - - private boolean isDeclaration() { - return (functionDeclaration instanceof JetNamedFunction) || - (functionDeclaration instanceof JetPropertyAccessor); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/PatternTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/PatternTranslator.java deleted file mode 100644 index 8792faead7e..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/PatternTranslator.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsInvocation; -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.utils.BindingUtils; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -/** - * @author Pavel Talanov - */ -public final class PatternTranslator extends AbstractTranslator { - - @NotNull - public static PatternTranslator newInstance(@NotNull TranslationContext context) { - return new PatternTranslator(context); - } - - private PatternTranslator(@NotNull TranslationContext context) { - super(context); - } - - @NotNull - public JsExpression translateIsExpression(@NotNull JetIsExpression expression) { - JsExpression left = Translation.translateAsExpression(expression.getLeftHandSide(), context()); - JetPattern pattern = getPattern(expression); - JsExpression resultingExpression = translatePattern(pattern, left); - if (expression.isNegated()) { - return AstUtil.negated(resultingExpression); - } - return resultingExpression; - } - - @NotNull - private JetPattern getPattern(@NotNull JetIsExpression expression) { - JetPattern pattern = expression.getPattern(); - assert pattern != null : "Pattern should not be null"; - return pattern; - } - - @NotNull - public JsExpression translatePattern(@NotNull JetPattern pattern, @NotNull JsExpression expressionToMatch) { - if (pattern instanceof JetTypePattern) { - return translateTypePattern(expressionToMatch, (JetTypePattern) pattern); - } - if (pattern instanceof JetExpressionPattern) { - return translateExpressionPattern(expressionToMatch, (JetExpressionPattern) pattern); - } - throw new AssertionError("Unsupported pattern type " + pattern.getClass()); - } - - @NotNull - private JsExpression translateTypePattern(@NotNull JsExpression expressionToMatch, - @NotNull JetTypePattern pattern) { - //TODO: look into using intrinsics or other mechanisms to implement this logic - JsName className = getClassReference(pattern).getName(); - if (className.getIdent().equals("String")) { - return AstUtil.typeof(expressionToMatch, program().getStringLiteral("string")); - } - if (className.getIdent().equals("Int")) { - return AstUtil.typeof(expressionToMatch, program().getStringLiteral("number")); - } - - JsInvocation isCheck = AstUtil.newInvocation(context().namer().isOperationReference(), - expressionToMatch, getClassReference(pattern)); - if (isNullable(pattern)) { - return addNullCheck(expressionToMatch, isCheck); - } - return isCheck; - } - - @NotNull - private JsExpression addNullCheck(@NotNull JsExpression expressionToMatch, @NotNull JsInvocation isCheck) { - return AstUtil.or(TranslationUtils.isNullCheck(context(), expressionToMatch), isCheck); - } - - private boolean isNullable(JetTypePattern pattern) { - return BindingUtils.getTypeByReference(bindingContext(), - getTypeReference(pattern)).isNullable(); - } - - @NotNull - private JsNameRef getClassReference(@NotNull JetTypePattern pattern) { - JetTypeReference typeReference = getTypeReference(pattern); - return getClassNameReferenceForTypeReference(typeReference); - } - - @NotNull - private JetTypeReference getTypeReference(@NotNull JetTypePattern pattern) { - JetTypeReference typeReference = pattern.getTypeReference(); - assert typeReference != null : "Type pattern should contain a type reference"; - return typeReference; - } - - @NotNull - private JsNameRef getClassNameReferenceForTypeReference(@NotNull JetTypeReference typeReference) { - ClassDescriptor referencedClass = BindingUtils.getClassDescriptorForTypeReference - (bindingContext(), typeReference); - return TranslationUtils.getQualifiedReference(context(), referencedClass); - } - - @NotNull - private JsExpression translateExpressionPattern(JsExpression expressionToMatch, JetExpressionPattern pattern) { - JetExpression patternExpression = pattern.getExpression(); - assert patternExpression != null : "Expression patter should have an expression."; - JsExpression expressionToMatchAgainst = - Translation.translateAsExpression(patternExpression, context()); - return AstUtil.equals(expressionToMatch, expressionToMatchAgainst); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/StringTemplateTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/StringTemplateTranslator.java deleted file mode 100644 index 2391dac7fe1..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/StringTemplateTranslator.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsStringLiteral; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; - -import static com.google.dart.compiler.util.AstUtil.sum; - -/** - * @author Pavel Talanov - */ -//TODO: add toString call for non-primitive object -public final class StringTemplateTranslator extends AbstractTranslator { - - @NotNull - public static JsExpression translate(@NotNull JetStringTemplateExpression expression, - @NotNull TranslationContext context) { - return (new StringTemplateTranslator(expression, context).translate()); - } - - @NotNull - private final JetStringTemplateExpression expression; - - private StringTemplateTranslator(@NotNull JetStringTemplateExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - } - - @NotNull - private JsExpression translate() { - assert expression.getEntries().length != 0 : "String template must have one or more entries."; - EntryVisitor entryVisitor = new EntryVisitor(); - for (JetStringTemplateEntry entry : expression.getEntries()) { - entry.accept(entryVisitor); - } - return entryVisitor.getResultingExpression(); - } - - private final class EntryVisitor extends JetVisitorVoid { - - @Nullable - private JsExpression resultingExpression = null; - - void append(@NotNull JsExpression expression) { - if (resultingExpression == null) { - resultingExpression = expression; - } else { - resultingExpression = sum(resultingExpression, expression); - } - } - - @Override - public void visitStringTemplateEntryWithExpression(@NotNull JetStringTemplateEntryWithExpression entry) { - JetExpression entryExpression = entry.getExpression(); - assert entryExpression != null : - "JetStringTemplateEntryWithExpression must have not null entry expression."; - append(Translation.translateAsExpression(entryExpression, context())); - } - - //TODO: duplication - @Override - public void visitLiteralStringTemplateEntry(@NotNull JetLiteralStringTemplateEntry entry) { - JsStringLiteral stringConstant = program().getStringLiteral(entry.getText()); - append(stringConstant); - } - - @Override - public void visitEscapeStringTemplateEntry(@NotNull JetEscapeStringTemplateEntry entry) { - JsStringLiteral escapedValue = program().getStringLiteral(entry.getUnescapedValue()); - append(escapedValue); - } - - @NotNull - public JsExpression getResultingExpression() { - assert resultingExpression != null; - return resultingExpression; - } - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/TryTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/TryTranslator.java deleted file mode 100644 index a163939a748..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/TryTranslator.java +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression; - -import com.google.dart.compiler.backend.js.ast.JsBlock; -import com.google.dart.compiler.backend.js.ast.JsCatch; -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsTry; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; - -import java.util.ArrayList; -import java.util.List; - -import static com.google.dart.compiler.util.AstUtil.convertToBlock; - -/** - * @author Pavel Talanov - */ -//TODO: not tested at all -//TODO: not implemented catch logic -public final class TryTranslator extends AbstractTranslator { - - @NotNull - public static JsTry translate(@NotNull JetTryExpression expression, - @NotNull TranslationContext context) { - return (new TryTranslator(expression, context)).translate(); - } - - @NotNull - private final JetTryExpression expression; - - private TryTranslator(@NotNull JetTryExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - } - - private JsTry translate() { - JsTry result = new JsTry(); - result.setTryBlock(translateTryBlock()); - result.setFinallyBlock(translateFinallyBlock()); - result.getCatches().addAll(translateCatches()); - return result; - } - - @Nullable - private JsBlock translateFinallyBlock() { - JetFinallySection finallyBlock = expression.getFinallyBlock(); - if (finallyBlock == null) return null; - - return convertToBlock(Translation.translateAsStatement(finallyBlock.getFinalExpression(), context())); - } - - @NotNull - private JsBlock translateTryBlock() { - return convertToBlock(Translation.translateAsStatement(expression.getTryBlock(), context())); - } - - - @NotNull - private List translateCatches() { - List result = new ArrayList(); - for (JetCatchClause catchClause : expression.getCatchClauses()) { - result.add(translateCatchClause(catchClause)); - } - return result; - } - - @NotNull - private JsCatch translateCatchClause(@NotNull JetCatchClause catchClause) { - JetParameter catchParameter = catchClause.getCatchParameter(); - assert catchParameter != null : "Valid catch must have a parameter."; - - JsName parameterName = context().getNameForElement(catchParameter); - JsCatch result = new JsCatch(context().jsScope(), parameterName.getIdent()); - result.setBody(translateCatchBody(catchClause)); - return result; - } - - @NotNull - private JsBlock translateCatchBody(@NotNull JetCatchClause catchClause) { - JetExpression catchBody = catchClause.getCatchBody(); - if (catchBody == null) { - return convertToBlock(program().getEmptyStmt()); - } - return convertToBlock(Translation.translateAsStatement(catchBody, context())); - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/WhenTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/WhenTranslator.java deleted file mode 100644 index 5af8ed98cbb..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/WhenTranslator.java +++ /dev/null @@ -1,211 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; - -import java.util.ArrayList; -import java.util.List; - -/** - * @author Pavel Talanov - */ -public class WhenTranslator extends AbstractTranslator { - - @NotNull - static public JsNode translateWhenExpression(@NotNull JetWhenExpression expression, @NotNull TranslationContext context) { - WhenTranslator translator = new WhenTranslator(expression, context); - return translator.translate(); - } - - @NotNull - private final JetWhenExpression whenExpression; - @NotNull - private final JsExpression expressionToMatch; - @NotNull - private final TemporaryVariable dummyCounter; - @NotNull - private final TemporaryVariable result; - - private int currentEntryNumber = 0; - - private WhenTranslator(@NotNull JetWhenExpression expression, @NotNull TranslationContext context) { - super(context); - this.whenExpression = expression; - this.expressionToMatch = translateExpressionToMatch(whenExpression); - this.dummyCounter = context.declareTemporary(program().getNumberLiteral(0)); - this.result = context.declareTemporary(program().getNullLiteral()); - } - - @NotNull - JsNode translate() { - JsFor resultingFor = generateDummyFor(); - List entries = translateEntries(); - resultingFor.setBody(AstUtil.newBlock(entries)); - context().addStatementToCurrentBlock(resultingFor); - return result.reference(); - } - - @NotNull - private List translateEntries() { - List entries = new ArrayList(); - for (JetWhenEntry entry : whenExpression.getEntries()) { - entries.add(surroundWithDummyIf(translateEntry(entry))); - } - return entries; - } - - @NotNull - private JsStatement surroundWithDummyIf(@NotNull JsStatement entryStatement) { - JsExpression stepNumberEqualsCurrentEntryNumber = new JsBinaryOperation(JsBinaryOperator.EQ, - dummyCounter.reference(), program().getNumberLiteral(currentEntryNumber)); - currentEntryNumber++; - return new JsIf(stepNumberEqualsCurrentEntryNumber, entryStatement, null); - } - - @NotNull - private JsFor generateDummyFor() { - JsFor result = new JsFor(); - result.setInitExpr(dummyCounter.assignmentExpression()); - result.setIncrExpr(generateIncrementStatement()); - result.setCondition(generateConditionStatement()); - return result; - } - - @NotNull - private JsBinaryOperation generateConditionStatement() { - JsNumberLiteral entriesNumber = program().getNumberLiteral(whenExpression.getEntries().size()); - return new JsBinaryOperation(JsBinaryOperator.LT, dummyCounter.reference(), entriesNumber); - } - - @NotNull - private JsPrefixOperation generateIncrementStatement() { - return new JsPrefixOperation(JsUnaryOperator.INC, dummyCounter.reference()); - } - - @NotNull - private JsStatement translateEntry(@NotNull JetWhenEntry entry) { - JsStatement statementToExecute = withReturnValueCaptured(translateEntryExpression(entry)); - if (entry.isElse()) { - return statementToExecute; - } - JsExpression condition = translateConditions(entry); - return new JsIf(condition, addDummyBreak(statementToExecute), null); - } - - @NotNull - JsStatement withReturnValueCaptured(@NotNull JsNode node) { - - return AstUtil.convertToStatement(AstUtil.mutateLastExpression(node, - new AstUtil.SaveLastExpressionMutator(result.reference()))); - } - - @NotNull - private JsNode translateEntryExpression(@NotNull JetWhenEntry entry) { - JetExpression expressionToExecute = entry.getExpression(); - assert expressionToExecute != null : "WhenEntry should have whenExpression to execute."; - return Translation.translateExpression(expressionToExecute, context()); - } - - @NotNull - private JsExpression translateConditions(@NotNull JetWhenEntry entry) { - List conditions = new ArrayList(); - for (JetWhenCondition condition : entry.getConditions()) { - conditions.add(translateCondition(condition)); - } - return anyOfThemIsTrue(conditions); - } - - @NotNull - private JsExpression anyOfThemIsTrue(List conditions) { - assert !conditions.isEmpty() : "When entry (not else) should have at least one condition"; - JsExpression current = null; - for (JsExpression condition : conditions) { - current = addCaseCondition(current, condition); - } - assert current != null; - return current; - } - - @NotNull - private JsExpression addCaseCondition(@Nullable JsExpression current, @NotNull JsExpression condition) { - if (current == null) { - return condition; - } else { - return AstUtil.or(current, condition); - } - } - - @NotNull - private JsExpression translateCondition(@NotNull JetWhenCondition condition) { - if ((condition instanceof JetWhenConditionIsPattern) || (condition instanceof JetWhenConditionWithExpression)) { - return translatePatternCondition(condition); - } - throw new AssertionError("Unsupported when condition " + condition.getClass()); - } - - @NotNull - private JsBlock addDummyBreak(@NotNull JsStatement statement) { - return AstUtil.newBlock(statement, new JsBreak()); - } - - @NotNull - private JsExpression translatePatternCondition(@NotNull JetWhenCondition condition) { - JsExpression patternMatchExpression = Translation.patternTranslator(context()). - translatePattern(getPattern(condition), expressionToMatch); - if (isNegated(condition)) { - return AstUtil.negated(patternMatchExpression); - } - return patternMatchExpression; - } - - private boolean isNegated(@NotNull JetWhenCondition condition) { - if (condition instanceof JetWhenConditionIsPattern) { - return ((JetWhenConditionIsPattern) condition).isNegated(); - } - return false; - } - - @NotNull - private JetPattern getPattern(@NotNull JetWhenCondition condition) { - JetPattern pattern; - if (condition instanceof JetWhenConditionIsPattern) { - pattern = ((JetWhenConditionIsPattern) condition).getPattern(); - } else if (condition instanceof JetWhenConditionWithExpression) { - pattern = ((JetWhenConditionWithExpression) condition).getPattern(); - } else { - throw new AssertionError("Wrong type of JetWhenCondition"); - } - assert pattern != null : "Condition should have a non null pattern."; - return pattern; - } - - @NotNull - private JsExpression translateExpressionToMatch(@NotNull JetWhenExpression expression) { - JetExpression subject = expression.getSubjectExpression(); - assert subject != null : "Subject should not be null."; - return Translation.translateAsExpression(subject, context()); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/foreach/ArrayForTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/foreach/ArrayForTranslator.java deleted file mode 100644 index 296427f2163..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/foreach/ArrayForTranslator.java +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression.foreach; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.psi.JetForExpression; -import org.jetbrains.jet.lang.types.JetType; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.intrinsic.string.LengthIntrinsic; -import org.jetbrains.k2js.translate.utils.BindingUtils; - -import java.util.Collections; -import java.util.List; - -import static org.jetbrains.k2js.translate.expression.foreach.ForTranslatorUtils.temporariesInitialization; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getClassDescriptorForType; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopBody; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopRange; - -/** - * @author Pavel Talanov - */ -public final class ArrayForTranslator extends ForTranslator { - - @NotNull - public static JsStatement translate(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - return (new ArrayForTranslator(expression, context).translate()); - } - - public static boolean isApplicable(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - JetExpression loopRange = getLoopRange(expression); - JetType rangeType = BindingUtils.getTypeForExpression(context.bindingContext(), loopRange); - //TODO: better check - //TODO: IMPORTANT! - return getClassDescriptorForType(rangeType).getName().equals("Array") - || getClassDescriptorForType(rangeType).getName().equals("IntArray"); - } - - @NotNull - private final TemporaryVariable loopRange; - - @NotNull - private final TemporaryVariable end; - - @NotNull - private final TemporaryVariable index; - - private ArrayForTranslator(@NotNull JetForExpression forExpression, @NotNull TranslationContext context) { - super(forExpression, context); - loopRange = context.declareTemporary(Translation.translateAsExpression(getLoopRange(expression), context)); - JsExpression length = LengthIntrinsic.INSTANCE.apply(loopRange.reference(), Collections.emptyList(), context()); - end = context().declareTemporary(length); - index = context().declareTemporary(program().getNumberLiteral(0)); - } - - @NotNull - private JsBlock translate() { - List blockStatements = temporariesInitialization(loopRange, end); - blockStatements.add(generateForExpression()); - return AstUtil.newBlock(blockStatements); - } - - @NotNull - private JsFor generateForExpression() { - JsFor result = new JsFor(); - result.setInitVars(initExpression()); - result.setCondition(getCondition()); - result.setIncrExpr(getIncrExpression()); - result.setBody(getBody()); - return result; - } - - @NotNull - private JsStatement getBody() { - JsArrayAccess arrayAccess = new JsArrayAccess(loopRange.reference(), index.reference()); - JsStatement currentVar = AstUtil.newVar(parameterName, arrayAccess); - JsStatement realBody = Translation.translateAsStatement(getLoopBody(expression), context()); - return AstUtil.newBlock(currentVar, realBody); - } - - @NotNull - private JsVars initExpression() { - return AstUtil.newVar(index.name(), program().getNumberLiteral(0)); - } - - @NotNull - private JsExpression getCondition() { - return AstUtil.notEqual(index.reference(), end.reference()); - } - - @NotNull - private JsExpression getIncrExpression() { - return new JsPrefixOperation(JsUnaryOperator.INC, index.reference()); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/foreach/ForTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/foreach/ForTranslator.java deleted file mode 100644 index 776d8d578e8..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/foreach/ForTranslator.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression.foreach; - -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsStatement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetForExpression; -import org.jetbrains.jet.lang.psi.JetParameter; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; - -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopBody; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopParameter; - -/** - * @author Pavel Talanov - */ - -//TODO: create util class for managing stuff like binary operations -public abstract class ForTranslator extends AbstractTranslator { - - @NotNull - public static JsStatement translate(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - if (RangeLiteralForTranslator.isApplicable(expression, context)) { - return RangeLiteralForTranslator.translate(expression, context); - } - if (RangeForTranslator.isApplicable(expression, context)) { - return RangeForTranslator.translate(expression, context); - } - if (ArrayForTranslator.isApplicable(expression, context)) { - return ArrayForTranslator.translate(expression, context); - } - return IteratorForTranslator.translate(expression, context); - } - - @NotNull - protected final JetForExpression expression; - @NotNull - protected final JsName parameterName; - - protected ForTranslator(@NotNull JetForExpression forExpression, @NotNull TranslationContext context) { - super(context); - this.expression = forExpression; - this.parameterName = declareParameter(); - } - - @NotNull - private JsName declareParameter() { - JetParameter loopParameter = getLoopParameter(expression); - return context().getNameForElement(loopParameter); - } - - //TODO: look for should-be-usages - @NotNull - protected JsStatement translateOriginalBodyExpression() { - return Translation.translateAsStatement(getLoopBody(expression), context()); - } - - -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/foreach/ForTranslatorUtils.java b/translator/src/org/jetbrains/k2js/translate/expression/foreach/ForTranslatorUtils.java deleted file mode 100644 index 6dc81395ca3..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/foreach/ForTranslatorUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression.foreach; - -import com.google.common.collect.Lists; -import com.google.dart.compiler.backend.js.ast.JsStatement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.k2js.translate.context.TemporaryVariable; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -//TODO: consider moving some of the binary/unary operations stuff here -public final class ForTranslatorUtils { - - private ForTranslatorUtils() { - } - - @NotNull - public static List temporariesInitialization(@NotNull TemporaryVariable... temporaries) { - List result = Lists.newArrayList(); - for (TemporaryVariable temporary : temporaries) { - result.add(temporary.assignmentExpression().makeStmt()); - } - return result; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/foreach/IteratorForTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/foreach/IteratorForTranslator.java deleted file mode 100644 index e1c0e15f9a8..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/foreach/IteratorForTranslator.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression.foreach; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; -import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.psi.JetForExpression; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.reference.CallBuilder; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.*; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopBody; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopRange; - -/** - * @author Pavel Talanov - */ -public final class IteratorForTranslator extends ForTranslator { - - @NotNull - public static JsStatement translate(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - return (new IteratorForTranslator(expression, context).translate()); - } - - @NotNull - private final TemporaryVariable iterator; - - private IteratorForTranslator(@NotNull JetForExpression forExpression, @NotNull TranslationContext context) { - super(forExpression, context); - iterator = context().declareTemporary(iteratorMethodInvocation()); - } - - @NotNull - private JsBlock translate() { - JsBlock bodyBlock = generateCycleBody(); - JsWhile cycle = new JsWhile(hasNextMethodInvocation(), bodyBlock); - return AstUtil.newBlock(iterator.assignmentExpression().makeStmt(), cycle); - } - - @NotNull - private JsBlock generateCycleBody() { - JsBlock cycleBody = new JsBlock(); - JsStatement parameterAssignment = AstUtil.newVar(parameterName, nextMethodInvocation()); - JsNode originalBody = Translation.translateExpression(getLoopBody(expression), context().innerBlock(cycleBody)); - cycleBody.addStatement(parameterAssignment); - cycleBody.addStatement(AstUtil.convertToBlock(originalBody)); - return cycleBody; - } - - @NotNull - private JsExpression nextMethodInvocation() { - FunctionDescriptor nextFunction = getNextFunction(bindingContext(), getLoopRange(expression)); - return translateMethodInvocation(iterator.reference(), nextFunction); - } - - @NotNull - private JsExpression hasNextMethodInvocation() { - CallableDescriptor hasNextFunction = getHasNextCallable(bindingContext(), getLoopRange(expression)); - return translateMethodInvocation(iterator.reference(), hasNextFunction); - } - - @NotNull - private JsExpression iteratorMethodInvocation() { - JetExpression rangeExpression = getLoopRange(expression); - JsExpression range = Translation.translateAsExpression(rangeExpression, context()); - FunctionDescriptor iteratorFunction = getIteratorFunction(bindingContext(), rangeExpression); - return translateMethodInvocation(range, iteratorFunction); - } - - @NotNull - private JsExpression translateMethodInvocation(@Nullable JsExpression receiver, - @NotNull CallableDescriptor descriptor) { - return CallBuilder.build(context()) - .receiver(receiver) - .descriptor(descriptor) - .translate(); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/foreach/RangeForTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/foreach/RangeForTranslator.java deleted file mode 100644 index 9cf83198ba2..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/foreach/RangeForTranslator.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression.foreach; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.psi.JetForExpression; -import org.jetbrains.jet.lang.types.JetType; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.utils.BindingUtils; - -import java.util.List; - -import static org.jetbrains.k2js.translate.expression.foreach.ForTranslatorUtils.temporariesInitialization; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getClassDescriptorForType; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopBody; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopRange; - -/** - * @author Pavel Talanov - */ -public final class RangeForTranslator extends ForTranslator { - - @NotNull - public static JsStatement translate(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - return (new RangeForTranslator(expression, context).translate()); - } - - public static boolean isApplicable(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - JetExpression loopRange = getLoopRange(expression); - JetType rangeType = BindingUtils.getTypeForExpression(context.bindingContext(), loopRange); - //TODO: better check - return getClassDescriptorForType(rangeType).getName().equals("IntRange"); - } - - @NotNull - private final TemporaryVariable rangeExpression; - @NotNull - private final TemporaryVariable incrVar; - @NotNull - private final TemporaryVariable start; - @NotNull - private final TemporaryVariable end; - - private RangeForTranslator(@NotNull JetForExpression forExpression, @NotNull TranslationContext context) { - super(forExpression, context); - rangeExpression = context.declareTemporary(Translation.translateAsExpression(getLoopRange(expression), context)); - JsExpression isReversed = callFunction("get_reversed"); - JsConditional incrVarValue = new JsConditional(isReversed, - program().getNumberLiteral(-1), - program().getNumberLiteral(1)); - incrVar = context().declareTemporary(incrVarValue); - start = context().declareTemporary(callFunction("get_start")); - end = context().declareTemporary(new JsBinaryOperation(JsBinaryOperator.ADD, callFunction("get_end"), incrVar.reference())); - } - - @NotNull - private JsBlock translate() { - List blockStatements = temporariesInitialization(rangeExpression, incrVar, start, end); - blockStatements.add(generateForExpression()); - return AstUtil.newBlock(blockStatements); - } - - @NotNull - private JsFor generateForExpression() { - JsFor result = new JsFor(); - result.setInitVars(initExpression()); - result.setCondition(getCondition()); - result.setIncrExpr(getIncrExpression()); - result.setBody(Translation.translateAsStatement(getLoopBody(expression), context())); - return result; - } - - @NotNull - private JsVars initExpression() { - return AstUtil.newVar(parameterName, start.reference()); - } - - @NotNull - private JsExpression getCondition() { - return AstUtil.notEqual(parameterName.makeRef(), end.reference()); - } - - @NotNull - private JsExpression getIncrExpression() { - return new JsBinaryOperation(JsBinaryOperator.ASG_ADD, parameterName.makeRef(), incrVar.reference()); - } - - @NotNull - private JsExpression getField(@NotNull String fieldName) { - JsNameRef nameRef = AstUtil.newQualifiedNameRef(fieldName); - AstUtil.setQualifier(nameRef, rangeExpression.reference()); - return nameRef; - } - - @NotNull - private JsExpression callFunction(@NotNull String funName) { - return AstUtil.newInvocation(getField(funName)); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/expression/foreach/RangeLiteralForTranslator.java b/translator/src/org/jetbrains/k2js/translate/expression/foreach/RangeLiteralForTranslator.java deleted file mode 100644 index 25cc708664a..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/expression/foreach/RangeLiteralForTranslator.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.expression.foreach; - -import com.google.common.collect.Lists; -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetBinaryExpression; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.psi.JetForExpression; -import org.jetbrains.jet.lexer.JetTokens; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import java.util.List; - -import static org.jetbrains.k2js.translate.expression.foreach.ForTranslatorUtils.temporariesInitialization; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getLoopRange; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.translateLeftExpression; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.translateRightExpression; - -/** - * @author Pavel Talanov - */ - -// TODO: implement reverse semantics -public final class RangeLiteralForTranslator extends ForTranslator { - - @NotNull - public static JsStatement translate(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - return (new RangeLiteralForTranslator(expression, context).translate()); - } - - public static boolean isApplicable(@NotNull JetForExpression expression, - @NotNull TranslationContext context) { - JetExpression loopRange = getLoopRange(expression); - if (!(loopRange instanceof JetBinaryExpression)) { - return false; - } - boolean isRangeToOperation = ((JetBinaryExpression) loopRange).getOperationToken() == JetTokens.RANGE; - return isRangeToOperation && RangeForTranslator.isApplicable(expression, context); - } - - @NotNull - private final JsExpression rangeStart; - - @NotNull - private final TemporaryVariable rangeEnd; - - private RangeLiteralForTranslator(@NotNull JetForExpression forExpression, @NotNull TranslationContext context) { - super(forExpression, context); - JetExpression loopRange = getLoopRange(expression); - assert loopRange instanceof JetBinaryExpression; - JetBinaryExpression loopRangeAsBinary = ((JetBinaryExpression) loopRange); - rangeStart = translateLeftExpression(context, loopRangeAsBinary); - rangeEnd = context.declareTemporary(getRangeEnd(loopRangeAsBinary)); - } - - @NotNull - private JsExpression getRangeEnd(@NotNull JetBinaryExpression loopRangeAsBinary) { - JsExpression rightExpression = translateRightExpression(context(), loopRangeAsBinary); - return new JsBinaryOperation(JsBinaryOperator.ADD, rightExpression, program().getNumberLiteral(1)); - } - - @NotNull - private JsBlock translate() { - List blockStatements = temporariesInitialization(rangeEnd); - blockStatements.add(generateForExpression()); - return AstUtil.newBlock(blockStatements); - } - - @NotNull - private JsFor generateForExpression() { - JsFor result = new JsFor(); - result.setInitVars(initExpression()); - result.setCondition(getCondition()); - result.setIncrExpr(getIncrExpression()); - result.setBody(translateOriginalBodyExpression()); - return result; - } - - @NotNull - private JsVars initExpression() { - return AstUtil.newVar(parameterName, rangeStart); - } - - @NotNull - private JsExpression getCondition() { - return AstUtil.notEqual(parameterName.makeRef(), rangeEnd.reference()); - } - - @NotNull - private JsExpression getIncrExpression() { - return new JsPrefixOperation(JsUnaryOperator.INC, parameterName.makeRef()); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/general/AbstractTranslator.java b/translator/src/org/jetbrains/k2js/translate/general/AbstractTranslator.java deleted file mode 100644 index 8113fc46054..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/general/AbstractTranslator.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.general; - -import com.google.dart.compiler.backend.js.ast.JsProgram; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.k2js.translate.context.Aliaser; -import org.jetbrains.k2js.translate.context.TranslationContext; - -/** - * @author Pavel Talanov - */ -public abstract class AbstractTranslator { - - @NotNull - private final TranslationContext context; - - protected AbstractTranslator(@NotNull TranslationContext context) { - this.context = context; - } - - @NotNull - protected JsProgram program() { - return context.program(); - } - - @NotNull - protected TranslationContext context() { - return context; - } - - @NotNull - protected Aliaser aliaser() { - return context.aliaser(); - } - - @NotNull - protected BindingContext bindingContext() { - return context.bindingContext(); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/general/Translation.java b/translator/src/org/jetbrains/k2js/translate/general/Translation.java deleted file mode 100644 index dc69b2e67d9..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/general/Translation.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.general; - -import com.google.dart.compiler.backend.js.JsNamer; -import com.google.dart.compiler.backend.js.JsPrettyNamer; -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.types.JetStandardLibrary; -import org.jetbrains.k2js.translate.context.StaticContext; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.declaration.ClassTranslator; -import org.jetbrains.k2js.translate.declaration.NamespaceDeclarationTranslator; -import org.jetbrains.k2js.translate.expression.ExpressionVisitor; -import org.jetbrains.k2js.translate.expression.FunctionTranslator; -import org.jetbrains.k2js.translate.expression.PatternTranslator; -import org.jetbrains.k2js.translate.expression.WhenTranslator; -import org.jetbrains.k2js.translate.initializer.ClassInitializerTranslator; -import org.jetbrains.k2js.translate.initializer.NamespaceInitializerTranslator; - -import java.util.List; - -/** - * @author Pavel Talanov - *

- * This class provides a interface which all translators use to interact with each other. - * Goal is to simlify interaction between translators. - */ -public final class Translation { - - @NotNull - public static FunctionTranslator functionTranslator(@NotNull JetDeclarationWithBody function, - @NotNull TranslationContext context) { - return FunctionTranslator.newInstance(function, context); - } - - @NotNull - public static List translateFiles(@NotNull List files, @NotNull TranslationContext context) { - return NamespaceDeclarationTranslator.translateFiles(files, context); - } - - @NotNull - public static JsInvocation translateClassDeclaration(@NotNull JetClass classDeclaration, - @NotNull TranslationContext context) { - return ClassTranslator.generateClassCreationExpression(classDeclaration, context); - } - - @NotNull - public static PatternTranslator patternTranslator(@NotNull TranslationContext context) { - return PatternTranslator.newInstance(context); - } - - @NotNull - public static JsNode translateExpression(@NotNull JetExpression expression, @NotNull TranslationContext context) { - return expression.accept(new ExpressionVisitor(), context); - } - - @NotNull - public static JsExpression translateAsExpression(@NotNull JetExpression expression, - @NotNull TranslationContext context) { - return AstUtil.convertToExpression(translateExpression(expression, context)); - } - - @NotNull - public static JsStatement translateAsStatement(@NotNull JetExpression expression, - @NotNull TranslationContext context) { - return AstUtil.convertToStatement(translateExpression(expression, context)); - } - - @NotNull - public static JsNode translateWhenExpression(@NotNull JetWhenExpression expression, - @NotNull TranslationContext context) { - return WhenTranslator.translateWhenExpression(expression, context); - } - - //TODO: see if generate*Initializer methods fit somewhere else - @NotNull - public static JsPropertyInitializer generateClassInitializerMethod(@NotNull JetClassOrObject classDeclaration, - @NotNull TranslationContext context) { - return (new ClassInitializerTranslator(classDeclaration, context)).generateInitializeMethod(); - } - - @NotNull - public static JsPropertyInitializer generateNamespaceInitializerMethod(@NotNull NamespaceDescriptor namespace, - @NotNull TranslationContext context) { - return (new NamespaceInitializerTranslator(namespace, context)).generateInitializeMethod(); - } - - public static JsProgram generateAst(@NotNull BindingContext bindingContext, - @NotNull List files) { - //TODO: move some of the code somewhere - JetStandardLibrary standardLibrary = JetStandardLibrary.getInstance(); - StaticContext staticContext = StaticContext.generateStaticContext(standardLibrary, bindingContext); - JsBlock block = staticContext.getProgram().getFragmentBlock(0); - TranslationContext context = TranslationContext.rootContext(staticContext); - block.getStatements().addAll(Translation.translateFiles(files, context)); - JsNamer namer = new JsPrettyNamer(); - namer.exec(context.program()); - return context.program(); - } - - -} diff --git a/translator/src/org/jetbrains/k2js/translate/general/TranslatorVisitor.java b/translator/src/org/jetbrains/k2js/translate/general/TranslatorVisitor.java deleted file mode 100644 index c42299032f2..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/general/TranslatorVisitor.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.general; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetElement; -import org.jetbrains.jet.lang.psi.JetVisitor; -import org.jetbrains.k2js.translate.context.TranslationContext; - -/** - * @author Pavel Talanov - *

- * This class is a base class for all visitors. - */ -public class TranslatorVisitor extends JetVisitor { - - @Override - @NotNull - public T visitJetElement(JetElement expression, TranslationContext context) { - throw new UnsupportedOperationException("Unsupported expression encountered:" + expression.toString()); - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/initializer/AbstractInitializerTranslator.java b/translator/src/org/jetbrains/k2js/translate/initializer/AbstractInitializerTranslator.java deleted file mode 100644 index 6c53ec13495..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/initializer/AbstractInitializerTranslator.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.initializer; - -import com.google.dart.compiler.backend.js.ast.JsFunction; -import com.google.dart.compiler.backend.js.ast.JsPropertyInitializer; -import com.google.dart.compiler.backend.js.ast.JsStatement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.psi.JetClassOrObject; -import org.jetbrains.k2js.translate.context.Namer; -import org.jetbrains.k2js.translate.context.NamingScope; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public abstract class AbstractInitializerTranslator extends AbstractTranslator { - - @NotNull - private final InitializerVisitor visitor; - @NotNull - protected final NamingScope initializerMethodScope; - - protected AbstractInitializerTranslator(@NotNull NamingScope scope, @NotNull TranslationContext context) { - super(context.contextWithScope(scope)); - this.visitor = new InitializerVisitor(); - this.initializerMethodScope = scope; - } - - abstract protected JsFunction generateInitializerFunction(); - - @NotNull - public JsPropertyInitializer generateInitializeMethod() { - JsPropertyInitializer initializer = new JsPropertyInitializer(); - initializer.setLabelExpr(Namer.initializeMethodReference()); - initializer.setValueExpr(generateInitializerFunction()); - return initializer; - } - - @NotNull - protected List translateClassInitializers(@NotNull JetClassOrObject declaration) { - return visitor.traverseClass(declaration, context()); - } - - @NotNull - protected List translateNamespaceInitializers(@NotNull NamespaceDescriptor namespace) { - return visitor.traverseNamespace(namespace, context()); - - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.java b/translator/src/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.java deleted file mode 100644 index 374299eb26a..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.initializer; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; -import org.jetbrains.jet.lang.psi.JetClassOrObject; -import org.jetbrains.jet.lang.psi.JetDelegationSpecifier; -import org.jetbrains.jet.lang.psi.JetDelegatorToSuperCall; -import org.jetbrains.jet.lang.psi.JetParameter; -import org.jetbrains.k2js.translate.context.Namer; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.utils.PsiUtils; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -import java.util.ArrayList; -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.*; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.assignmentToBackingField; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.functionWithScope; - -/** - * @author Pavel Talanov - */ -public final class ClassInitializerTranslator extends AbstractInitializerTranslator { - - @NotNull - private final JetClassOrObject classDeclaration; - @NotNull - private final List initializerStatements = new ArrayList(); - - public ClassInitializerTranslator(@NotNull JetClassOrObject classDeclaration, @NotNull TranslationContext context) { - super(context.getScopeForElement(classDeclaration).innerScope - ("initializer " + classDeclaration.getName()), context); - this.classDeclaration = classDeclaration; - } - - @Override - @NotNull - protected JsFunction generateInitializerFunction() { - JsFunction result = functionWithScope(initializerMethodScope); - //NOTE: that while we translateAsLocalNameReference constructor parameters we also add property initializer statements - // for properties declared as constructor parameters - result.setParameters(translatePrimaryConstructorParameters()); - mayBeAddCallToSuperMethod(); - result.setBody(generateInitializerMethodBody()); - return result; - } - - @NotNull - private JsBlock generateInitializerMethodBody() { - initializerStatements.addAll(translateClassInitializers(classDeclaration)); - return AstUtil.newBlock(initializerStatements); - } - - private void mayBeAddCallToSuperMethod() { - if (hasAncestorClass(bindingContext(), classDeclaration)) { - JetDelegatorToSuperCall superCall = getSuperCall(); - if (superCall == null) return; - addCallToSuperMethod(superCall); - } - } - - private void addCallToSuperMethod(@NotNull JetDelegatorToSuperCall superCall) { - //TODO: look into - JsName superMethodName = initializerMethodScope.jsScope().declareName(Namer.superMethodName()); - List arguments = translateArguments(superCall); - initializerStatements.add(AstUtil.convertToStatement - (AstUtil.newInvocation(AstUtil.thisQualifiedReference(superMethodName), arguments))); - } - - @NotNull - private List translateArguments(@NotNull JetDelegatorToSuperCall superCall) { - //TODO: use the same mechanism as in call translator - return TranslationUtils.translateArgumentList(context(), superCall.getValueArguments()); - } - - @Nullable - private JetDelegatorToSuperCall getSuperCall() { - JetDelegatorToSuperCall result = null; - for (JetDelegationSpecifier specifier : classDeclaration.getDelegationSpecifiers()) { - if (specifier instanceof JetDelegatorToSuperCall) { - result = (JetDelegatorToSuperCall) specifier; - } - } - //assert result != null : "Class must call ancestor's constructor."; - return result; - } - - @NotNull - List translatePrimaryConstructorParameters() { - List parameterList = PsiUtils.getPrimaryConstructorParameters(classDeclaration); - List result = new ArrayList(); - for (JetParameter jetParameter : parameterList) { - result.add(translateParameter(jetParameter)); - } - return result; - } - - @NotNull - private JsParameter translateParameter(@NotNull JetParameter jetParameter) { - DeclarationDescriptor parameterDescriptor = - getDescriptorForElement(bindingContext(), jetParameter); - JsName parameterName = context().getNameForDescriptor(parameterDescriptor); - JsParameter jsParameter = new JsParameter(parameterName); - mayBeAddInitializerStatementForProperty(jsParameter, jetParameter); - return jsParameter; - } - - private void mayBeAddInitializerStatementForProperty(@NotNull JsParameter jsParameter, - @NotNull JetParameter jetParameter) { - PropertyDescriptor propertyDescriptor = - getPropertyDescriptorForConstructorParameter(bindingContext(), jetParameter); - if (propertyDescriptor != null) { - JsStatement assignmentToBackingFieldExpression = assignmentToBackingField - (context(), propertyDescriptor, jsParameter.getName().makeRef()); - initializerStatements.add(assignmentToBackingFieldExpression); - } - } - - -} diff --git a/translator/src/org/jetbrains/k2js/translate/initializer/InitializerVisitor.java b/translator/src/org/jetbrains/k2js/translate/initializer/InitializerVisitor.java deleted file mode 100644 index 20b5cc5f835..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/initializer/InitializerVisitor.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.initializer; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsInvocation; -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.backend.js.ast.JsStatement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.declaration.ClassTranslator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.general.TranslatorVisitor; -import org.jetbrains.k2js.translate.utils.BindingUtils; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -import static java.util.Collections.singletonList; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getDeclarationsForNamespace; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getPropertyDescriptorForObjectDeclaration; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getObjectDeclarationForName; - -/** - * @author Pavel Talanov - */ -public final class InitializerVisitor extends TranslatorVisitor> { - - /*package*/ InitializerVisitor() { - } - - @Override - @NotNull - public List visitProperty(@NotNull JetProperty expression, @NotNull TranslationContext context) { - JetExpression initializer = expression.getInitializer(); - if (initializer == null) { - return new ArrayList(); - } - return Arrays.asList(translateInitializer(expression, context, initializer)); - } - - @NotNull - private JsStatement translateInitializer(@NotNull JetProperty property, @NotNull TranslationContext context, - @NotNull JetExpression initializer) { - JsExpression initExpression = Translation.translateAsExpression(initializer, context); - return assignmentToBackingField(property, initExpression, context); - } - - //TODO: - @NotNull - JsStatement assignmentToBackingField(@NotNull JetProperty property, @NotNull JsExpression initExpression, - @NotNull TranslationContext context) { - - PropertyDescriptor propertyDescriptor = BindingUtils.getPropertyDescriptor(context.bindingContext(), property); - return TranslationUtils.assignmentToBackingField(context, propertyDescriptor, initExpression); - } - - @Override - @NotNull - public List visitAnonymousInitializer(@NotNull JetClassInitializer initializer, - @NotNull TranslationContext context) { - return Arrays.asList(Translation.translateAsStatement(initializer.getBody(), context)); - } - - @Override - @NotNull - // Not interested in other types of declarations, they do not contain initializers. - public List visitDeclaration(@NotNull JetDeclaration expression, @NotNull TranslationContext context) { - return Collections.emptyList(); - } - - @Override - @NotNull - public List visitObjectDeclarationName(@NotNull JetObjectDeclarationName objectName, - @NotNull TranslationContext context) { - PropertyDescriptor propertyDescriptorForObjectDeclaration - = getPropertyDescriptorForObjectDeclaration(context.bindingContext(), objectName); - JsName objectPropertyName = context.getNameForDescriptor(propertyDescriptorForObjectDeclaration); - JetObjectDeclaration objectDeclaration = getObjectDeclarationForName(objectName); - JsInvocation objectValue = ClassTranslator.generateClassCreationExpression(objectDeclaration, context); - return singletonList(TranslationUtils.assignmentToBackingField(context, - propertyDescriptorForObjectDeclaration, objectValue)); - } - - @NotNull - public List traverseClass(@NotNull JetClassOrObject expression, @NotNull TranslationContext context) { - List initializerStatements = new ArrayList(); - for (JetDeclaration declaration : expression.getDeclarations()) { - initializerStatements.addAll(declaration.accept(this, context)); - } - return initializerStatements; - } - - @NotNull - public List traverseNamespace(@NotNull NamespaceDescriptor namespace, @NotNull TranslationContext context) { - List initializerStatements = new ArrayList(); - for (JetDeclaration declaration : getDeclarationsForNamespace(context.bindingContext(), namespace)) { - initializerStatements.addAll(declaration.accept(this, context)); - } - return initializerStatements; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/initializer/NamespaceInitializerTranslator.java b/translator/src/org/jetbrains/k2js/translate/initializer/NamespaceInitializerTranslator.java deleted file mode 100644 index 4132315e645..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/initializer/NamespaceInitializerTranslator.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.initializer; - -import com.google.dart.compiler.backend.js.ast.JsFunction; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import static org.jetbrains.k2js.translate.utils.TranslationUtils.functionWithScope; - -/** - * @author Pavel Talanov - */ -public final class NamespaceInitializerTranslator extends AbstractInitializerTranslator { - - @NotNull - private final NamespaceDescriptor namespace; - - public NamespaceInitializerTranslator(@NotNull NamespaceDescriptor namespace, @NotNull TranslationContext context) { - super(context.getScopeForDescriptor(namespace).innerScope - ("initializer " + namespace.getName()), context); - this.namespace = namespace; - } - - @Override - @NotNull - protected JsFunction generateInitializerFunction() { - JsFunction result = functionWithScope(initializerMethodScope); - result.setBody(AstUtil.newBlock(translateNamespaceInitializers(namespace))); - return result; - } - - -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/CompareToIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/CompareToIntrinsic.java deleted file mode 100644 index 0dbeeb4fca4..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/CompareToIntrinsic.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.types.expressions.OperatorConventions; -import org.jetbrains.jet.lexer.JetToken; - -/** - * @author Pavel Talanov - */ -public abstract class CompareToIntrinsic implements Intrinsic { - - private JetToken comparisonToken = null; - - @NotNull - protected JetToken getComparisonToken() { - assert comparisonToken != null : "Should use set token first"; - return comparisonToken; - } - - public void setComparisonToken(@NotNull JetToken comparisonToken) { - assert OperatorConventions.COMPARISON_OPERATIONS.contains(comparisonToken) - : "Should be a comparison operation"; - this.comparisonToken = comparisonToken; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/EqualsIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/EqualsIntrinsic.java deleted file mode 100644 index 3cd074970eb..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/EqualsIntrinsic.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic; - -import org.jetbrains.annotations.NotNull; - -/** - * @author Pavel Talanov - */ -public abstract class EqualsIntrinsic implements Intrinsic { - - @NotNull - private Boolean isNegated = false; - - public void setNegated(boolean isNegated) { - this.isNegated = isNegated; - } - - protected boolean isNegated() { - return isNegated; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/FunctionIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/FunctionIntrinsic.java deleted file mode 100644 index 9a5e0eab723..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/FunctionIntrinsic.java +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic; - -/** - * @author Pavel Talanov - */ -public interface FunctionIntrinsic extends Intrinsic { - -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/Intrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/Intrinsic.java deleted file mode 100644 index 425e5f04b68..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/Intrinsic.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import java.util.List; - -/** - * @author Pavel Talanov - *

- * Base class for all intrinsics. - */ -public interface Intrinsic { - - @NotNull - JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context); -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/Intrinsics.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/Intrinsics.java deleted file mode 100644 index 9893e8f489d..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/Intrinsics.java +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic; - -import com.google.common.collect.Lists; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.resolve.scopes.JetScope; -import org.jetbrains.jet.lang.types.JetStandardClasses; -import org.jetbrains.jet.lang.types.JetStandardLibrary; -import org.jetbrains.jet.lang.types.JetType; -import org.jetbrains.jet.lang.types.PrimitiveType; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.k2js.translate.intrinsic.array.*; -import org.jetbrains.k2js.translate.intrinsic.primitive.*; -import org.jetbrains.k2js.translate.intrinsic.string.CharAtIntrinsic; -import org.jetbrains.k2js.translate.intrinsic.string.LengthIntrinsic; -import org.jetbrains.k2js.translate.intrinsic.tuple.TupleAccessIntrinsic; -import org.jetbrains.k2js.translate.operation.OperatorTable; -import org.jetbrains.k2js.translate.utils.DescriptorUtils; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.jetbrains.jet.lang.types.expressions.OperatorConventions.*; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getFunctionByName; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getPropertyByName; - -/** - * @author Pavel Talanov - *

- * Provides mechanism to substitute method calls /w native constucts directly. - */ -public final class Intrinsics { - - @NotNull - private final Map functionIntrinsics = - new HashMap(); - - @NotNull - private final Map equalsIntrinsics = - new HashMap(); - - @NotNull - private final Map compareToIntrinsics = - new HashMap(); - - public static Intrinsics standardLibraryIntrinsics(@NotNull JetStandardLibrary library) { - return new Intrinsics(library); - } - - @NotNull - private final JetStandardLibrary library; - - private Intrinsics(@NotNull JetStandardLibrary library) { - this.library = library; - declareOperatorIntrinsics(); - declareStringIntrinsics(); - declareTuplesIntrinsics(); - declareArrayIntrinsics(); - } - - private void declareTuplesIntrinsics() { - for (int tupleSize = 0; tupleSize < JetStandardClasses.TUPLE_COUNT; ++tupleSize) { - declareTupleIntrinsics(tupleSize); - } - } - - //TODO: provide generic mechanism or refactor - private void declareArrayIntrinsics() { - - List arrayTypes = getLibraryArrayTypes(); - - for (JetType arrayType : arrayTypes) { - declareIntrinsicsForArrayType(arrayType); - } - declareNullConstructorIntrinsic(); - } - - private void declareNullConstructorIntrinsic() { - //TODO: - FunctionDescriptor nullArrayConstructor = library.getLibraryScope().getFunctions("Array").iterator().next(); - functionIntrinsics.put(nullArrayConstructor, ArrayNullConstructorIntrinsic.INSTANCE); - } - - //TODO: some dangerous operation unchecked here - private void declareIntrinsicsForArrayType(@NotNull JetType arrayType) { - JetScope arrayMemberScope = arrayType.getMemberScope(); - FunctionDescriptor setFunction = getFunctionByName(arrayMemberScope, "set"); - functionIntrinsics.put(setFunction, ArraySetIntrinsic.INSTANCE); - FunctionDescriptor getFunction = getFunctionByName(arrayMemberScope, "get"); - functionIntrinsics.put(getFunction, ArrayGetIntrinsic.INSTANCE); - PropertyDescriptor sizeProperty = getPropertyByName(arrayMemberScope, "size"); - functionIntrinsics.put(sizeProperty.getGetter(), ArraySizeIntrinsic.INSTANCE); - PropertyDescriptor indicesProperty = getPropertyByName(arrayMemberScope, "indices"); - functionIntrinsics.put(indicesProperty.getGetter(), ArrayIndicesIntrinsic.INSTANCE); - FunctionDescriptor iteratorFunction = getFunctionByName(arrayMemberScope, "iterator"); - functionIntrinsics.put(iteratorFunction, ArrayIteratorIntrinsic.INSTANCE); - ConstructorDescriptor arrayConstructor = - ((ClassDescriptor) arrayMemberScope.getContainingDeclaration()).getConstructors().iterator().next(); - functionIntrinsics.put(arrayConstructor, ArrayFunctionConstructorIntrinsic.INSTANCE); - } - - private List getLibraryArrayTypes() { - List arrayTypes = Lists.newArrayList(); - for (PrimitiveType type : PrimitiveType.values()) { - arrayTypes.add(library.getPrimitiveArrayJetType(type)); - } - arrayTypes.add(library.getArray().getDefaultType()); - return arrayTypes; - } - - private void declareTupleIntrinsics(int tupleSize) { - JetScope libraryScope = library.getLibraryScope(); - assert libraryScope != null; - ClassifierDescriptor tupleDescriptor = libraryScope.getClassifier("Tuple" + tupleSize); - assert tupleDescriptor != null; - declareTupleIntrinsicAccessors(tupleDescriptor, tupleSize); - } - - private void declareStringIntrinsics() { - PropertyDescriptor lengthProperty = - getPropertyByName(library.getCharSequence().getDefaultType().getMemberScope(), "length"); - functionIntrinsics.put(lengthProperty.getGetter(), LengthIntrinsic.INSTANCE); - FunctionDescriptor getFunction = - getFunctionByName(library.getString().getDefaultType().getMemberScope(), "get"); - functionIntrinsics.put(getFunction, CharAtIntrinsic.INSTANCE); - } - - private void declareTupleIntrinsicAccessors(@NotNull ClassifierDescriptor tupleDescriptor, - int tupleSize) { - for (int elementIndex = 0; elementIndex < tupleSize; ++elementIndex) { - String accessorName = "_" + (elementIndex + 1); - PropertyDescriptor propertyDescriptor = - getPropertyByName(tupleDescriptor.getDefaultType().getMemberScope(), accessorName); - functionIntrinsics.put(propertyDescriptor.getGetter(), new TupleAccessIntrinsic(elementIndex)); - } - } - - private void declareOperatorIntrinsics() { - IntrinsicDeclarationVisitor visitor = new IntrinsicDeclarationVisitor(); - for (DeclarationDescriptor descriptor : library.getLibraryScope().getAllDescriptors()) { - //noinspection NullableProblems - descriptor.accept(visitor, null); - } - } - - public boolean isIntrinsic(@NotNull DeclarationDescriptor descriptor) { - //NOTE: that if we want to add other intrinsics we have to modify this method - if (descriptor instanceof FunctionDescriptor) { - FunctionDescriptor functionDescriptor = (FunctionDescriptor) descriptor.getOriginal(); - return (equalsIntrinsics.containsKey(functionDescriptor) || - compareToIntrinsics.containsKey(functionDescriptor) || - functionIntrinsics.containsKey(functionDescriptor)); - } - return false; - } - - @NotNull - public FunctionIntrinsic getFunctionIntrinsic(@NotNull FunctionDescriptor descriptor) { - return functionIntrinsics.get(descriptor.getOriginal()); - } - - @NotNull - public CompareToIntrinsic getCompareToIntrinsic(@NotNull FunctionDescriptor descriptor) { - return compareToIntrinsics.get(descriptor.getOriginal()); - } - - @NotNull - public EqualsIntrinsic getEqualsIntrinsic(@NotNull FunctionDescriptor descriptor) { - return equalsIntrinsics.get(descriptor.getOriginal()); - } - - private final class IntrinsicDeclarationVisitor extends DeclarationDescriptorVisitor { - - @Override - public Void visitClassDescriptor(@NotNull ClassDescriptor descriptor, @Nullable Void nothing) { - for (DeclarationDescriptor memberDescriptor : - descriptor.getDefaultType().getMemberScope().getAllDescriptors()) { - //noinspection NullableProblems - memberDescriptor.accept(this, null); - } - return null; - } - - @Override - public Void visitFunctionDescriptor(@NotNull FunctionDescriptor descriptor, @Nullable Void nothing) { - if (!isIntrinsic(descriptor)) { - declareOperatorIntrinsic(descriptor); - } - return null; - } - - - /*package*/ void declareOperatorIntrinsic(@NotNull FunctionDescriptor descriptor) { - tryResolveAsEqualsCompareToOrRangeToIntrinsic(descriptor); - tryResolveAsUnaryIntrinsics(descriptor); - tryResolveAsBinaryIntrinsics(descriptor); - } - - private void tryResolveAsEqualsCompareToOrRangeToIntrinsic(@NotNull FunctionDescriptor descriptor) { - String functionName = descriptor.getName(); - if (functionName.equals(COMPARE_TO)) { - compareToIntrinsics.put(descriptor, PrimitiveCompareToIntrinsic.newInstance()); - } - if (functionName.equals(EQUALS)) { - equalsIntrinsics.put(descriptor, PrimitiveEqualsIntrinsic.newInstance()); - } - if (functionName.equals("rangeTo")) { - functionIntrinsics.put(descriptor, PrimitiveRangeToIntrinsic.newInstance()); - } - } - - private void tryResolveAsUnaryIntrinsics(@NotNull FunctionDescriptor descriptor) { - String functionName = descriptor.getName(); - JetToken token = UNARY_OPERATION_NAMES.inverse().get(functionName); - - if (token == null) return; - if (!isUnaryOperation(descriptor)) return; - - functionIntrinsics.put(descriptor, PrimitiveUnaryOperationIntrinsic.newInstance(token)); - } - - private void tryResolveAsBinaryIntrinsics(@NotNull FunctionDescriptor descriptor) { - String functionName = descriptor.getName(); - - if (isUnaryOperation(descriptor)) return; - - JetToken token = BINARY_OPERATION_NAMES.inverse().get(functionName); - if (token == null) return; - - if (!OperatorTable.hasCorrespondingBinaryOperator(token)) return; - functionIntrinsics.put(descriptor, PrimitiveBinaryOperationIntrinsic.newInstance(token)); - } - - private boolean isUnaryOperation(@NotNull FunctionDescriptor descriptor) { - return !DescriptorUtils.hasParameters(descriptor); - } - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayFunctionConstructorIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayFunctionConstructorIntrinsic.java deleted file mode 100644 index 6cd6f5cd2fd..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayFunctionConstructorIntrinsic.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.array; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum ArrayFunctionConstructorIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, - @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver == null; - assert arguments.size() == 2; - //TODO: provide better mechanism - JsNameRef iteratorFunName = AstUtil.newQualifiedNameRef("Kotlin.arrayFromFun"); - return AstUtil.newInvocation(iteratorFunName, arguments); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayGetIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayGetIntrinsic.java deleted file mode 100644 index ea0d565247d..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayGetIntrinsic.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.array; - -import com.google.dart.compiler.backend.js.ast.JsArrayAccess; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum ArrayGetIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver != null; - assert arguments.size() == 1 : "Array get expression must have one argument."; - JsExpression indexExpression = arguments.get(0); - return new JsArrayAccess(receiver, indexExpression); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayIndicesIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayIndicesIntrinsic.java deleted file mode 100644 index c9e9f9d1005..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayIndicesIntrinsic.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.array; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum ArrayIndicesIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver != null; - assert arguments.size() == 0; - //TODO: provide better mechanism - JsNameRef iteratorFunName = AstUtil.newQualifiedNameRef("Kotlin.arrayIndices"); - return AstUtil.newInvocation(iteratorFunName, receiver); - } -} \ No newline at end of file diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayIteratorIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayIteratorIntrinsic.java deleted file mode 100644 index cc04aa26246..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayIteratorIntrinsic.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.array; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum ArrayIteratorIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver != null; - assert arguments.size() == 0; - //TODO: provide better mechanism - JsNameRef iteratorFunName = AstUtil.newQualifiedNameRef("Kotlin.arrayIterator"); - return AstUtil.newInvocation(iteratorFunName, receiver); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayNullConstructorIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayNullConstructorIntrinsic.java deleted file mode 100644 index a9e0ee1cea3..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArrayNullConstructorIntrinsic.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.array; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum ArrayNullConstructorIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - //TODO: implement function passing to array constructor - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver == null; - assert arguments.size() == 1; - //TODO: provide better mechanism - JsNameRef nullArrayFunName = AstUtil.newQualifiedNameRef("Kotlin.nullArray"); - return AstUtil.newInvocation(nullArrayFunName, arguments); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArraySetIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArraySetIntrinsic.java deleted file mode 100644 index 03f41d57c7c..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArraySetIntrinsic.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.array; - -import com.google.dart.compiler.backend.js.ast.JsArrayAccess; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum ArraySetIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver != null; - assert arguments.size() == 2 : "Array set expression must have two arguments."; - JsExpression indexExpression = arguments.get(0); - JsExpression value = arguments.get(1); - JsArrayAccess arrayAccess = AstUtil.newArrayAccess(receiver, indexExpression); - return AstUtil.newAssignment(arrayAccess, value); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArraySizeIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArraySizeIntrinsic.java deleted file mode 100644 index 69a04d2231f..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/array/ArraySizeIntrinsic.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.array; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum ArraySizeIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver != null; - assert arguments.isEmpty() : "Length expression must have zero arguments."; - //TODO: provide better way - JsNameRef lengthProperty = AstUtil.newQualifiedNameRef("length"); - AstUtil.setQualifier(lengthProperty, receiver); - return lengthProperty; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveBinaryOperationIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveBinaryOperationIntrinsic.java deleted file mode 100644 index 5d6039319e9..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveBinaryOperationIntrinsic.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.primitive; - -import com.google.dart.compiler.backend.js.ast.JsBinaryOperation; -import com.google.dart.compiler.backend.js.ast.JsBinaryOperator; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; -import org.jetbrains.k2js.translate.operation.OperatorTable; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class PrimitiveBinaryOperationIntrinsic implements FunctionIntrinsic { - - @NotNull - public static PrimitiveBinaryOperationIntrinsic newInstance(@NotNull JetToken token) { - JsBinaryOperator operator = OperatorTable.getBinaryOperator(token); - return new PrimitiveBinaryOperationIntrinsic(operator); - } - - @NotNull - private final JsBinaryOperator operator; - - private PrimitiveBinaryOperationIntrinsic(@NotNull JsBinaryOperator operator) { - this.operator = operator; - } - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert arguments.size() == 1 : "Binary operator should have a receiver and one argument"; - return new JsBinaryOperation(operator, receiver, arguments.get(0)); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveCompareToIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveCompareToIntrinsic.java deleted file mode 100644 index c43708008e5..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveCompareToIntrinsic.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.primitive; - -import com.google.dart.compiler.backend.js.ast.JsBinaryOperation; -import com.google.dart.compiler.backend.js.ast.JsBinaryOperator; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.CompareToIntrinsic; -import org.jetbrains.k2js.translate.operation.OperatorTable; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class PrimitiveCompareToIntrinsic extends CompareToIntrinsic { - - @NotNull - public static PrimitiveCompareToIntrinsic newInstance() { - return new PrimitiveCompareToIntrinsic(); - } - - private PrimitiveCompareToIntrinsic() { - } - - @NotNull - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert arguments.size() == 1 : "Equals operation should have one argument"; - JsBinaryOperator operator = OperatorTable.getBinaryOperator(getComparisonToken()); - JsExpression argument = arguments.get(0); - return new JsBinaryOperation(operator, receiver, argument); - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveEqualsIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveEqualsIntrinsic.java deleted file mode 100644 index 05cd57be9cd..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveEqualsIntrinsic.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.primitive; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.EqualsIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class PrimitiveEqualsIntrinsic extends EqualsIntrinsic { - - @NotNull - public static PrimitiveEqualsIntrinsic newInstance() { - return new PrimitiveEqualsIntrinsic(); - } - - private PrimitiveEqualsIntrinsic() { - } - - @NotNull - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert arguments.size() == 1 : "Equals operation should have one argument"; - if (isNegated()) { - return AstUtil.notEqual(receiver, arguments.get(0)); - } else { - return AstUtil.equals(receiver, arguments.get(0)); - } - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveRangeToIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveRangeToIntrinsic.java deleted file mode 100644 index 723beaf07dc..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveRangeToIntrinsic.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.primitive; - -import com.google.dart.compiler.backend.js.ast.JsBinaryOperation; -import com.google.dart.compiler.backend.js.ast.JsBooleanLiteral; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNew; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class PrimitiveRangeToIntrinsic implements FunctionIntrinsic { - - @NotNull - public static PrimitiveRangeToIntrinsic newInstance() { - return new PrimitiveRangeToIntrinsic(); - } - - private PrimitiveRangeToIntrinsic() { - } - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression rangeStart, @NotNull List arguments, - @NotNull TranslationContext context) { - assert arguments.size() == 1 : "RangeTo must have one argument."; - JsExpression rangeEnd = arguments.get(0); - JsBinaryOperation rangeSize = AstUtil.sum(AstUtil.subtract(rangeEnd, rangeStart), - context.program().getNumberLiteral(1)); - //TODO: provide a way not to hard code this value - JsNew numberRangeConstructorInvocation - = new JsNew(AstUtil.newQualifiedNameRef("Kotlin.NumberRange")); - //TODO: add tests and correct expression for reversed ranges. - JsBooleanLiteral isRangeReversed = context.program().getFalseLiteral(); - numberRangeConstructorInvocation.setArguments(Arrays.asList(rangeStart, rangeSize, isRangeReversed)); - return numberRangeConstructorInvocation; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveUnaryOperationIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveUnaryOperationIntrinsic.java deleted file mode 100644 index 817461472a3..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/primitive/PrimitiveUnaryOperationIntrinsic.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.primitive; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsPrefixOperation; -import com.google.dart.compiler.backend.js.ast.JsUnaryOperator; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; -import org.jetbrains.k2js.translate.operation.OperatorTable; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class PrimitiveUnaryOperationIntrinsic implements FunctionIntrinsic { - - @NotNull - public static PrimitiveUnaryOperationIntrinsic newInstance(@NotNull JetToken token) { - JsUnaryOperator operator = OperatorTable.getUnaryOperator(token); - return new PrimitiveUnaryOperationIntrinsic(operator); - } - - @NotNull - private final JsUnaryOperator operator; - - private PrimitiveUnaryOperationIntrinsic(@NotNull JsUnaryOperator operator) { - this.operator = operator; - } - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver != null; - assert arguments.size() == 0 : "Unary operator should not have arguments."; - //NOTE: cannot use this for increment/decrement - return new JsPrefixOperation(operator, receiver); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/string/CharAtIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/string/CharAtIntrinsic.java deleted file mode 100644 index e2bcfb82eb3..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/string/CharAtIntrinsic.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.string; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum CharAtIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver != null; - assert arguments.size() == 1 : "get Char expression must have 1 arguments."; - //TODO: provide better way - JsNameRef charAtReference = AstUtil.newQualifiedNameRef("charAt"); - AstUtil.setQualifier(charAtReference, receiver); - return AstUtil.newInvocation(charAtReference, arguments); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/string/LengthIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/string/LengthIntrinsic.java deleted file mode 100644 index 3e66610f8e2..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/string/LengthIntrinsic.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.string; - - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public enum LengthIntrinsic implements FunctionIntrinsic { - - INSTANCE; - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert receiver != null; - assert arguments.isEmpty() : "Length expression must have zero arguments."; - //TODO: provide better way - JsNameRef lengthProperty = AstUtil.newQualifiedNameRef("length"); - AstUtil.setQualifier(lengthProperty, receiver); - return lengthProperty; - } -} \ No newline at end of file diff --git a/translator/src/org/jetbrains/k2js/translate/intrinsic/tuple/TupleAccessIntrinsic.java b/translator/src/org/jetbrains/k2js/translate/intrinsic/tuple/TupleAccessIntrinsic.java deleted file mode 100644 index 0dd7aa92dcb..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/intrinsic/tuple/TupleAccessIntrinsic.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.intrinsic.tuple; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; - -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class TupleAccessIntrinsic implements FunctionIntrinsic { - - private final int elementIndex; - - public TupleAccessIntrinsic(int elementIndex) { - this.elementIndex = elementIndex; - } - - @NotNull - @Override - public JsExpression apply(@Nullable JsExpression receiver, @NotNull List arguments, - @NotNull TranslationContext context) { - assert arguments.isEmpty() : "Tuple access expression should not have any arguments."; - return AstUtil.newArrayAccess(receiver, context.program().getNumberLiteral(elementIndex)); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/AssignmentTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/AssignmentTranslator.java deleted file mode 100644 index 59a0b1fbe69..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/AssignmentTranslator.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetBinaryExpression; -import org.jetbrains.jet.lang.types.expressions.OperatorConventions; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.reference.AccessTranslator; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.isVariableReassignment; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getOperationToken; -import static org.jetbrains.k2js.translate.utils.PsiUtils.isAssignment; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.isIntrinsicOperation; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.translateRightExpression; - -/** - * @author Pavel Talanov - */ -public abstract class AssignmentTranslator extends AbstractTranslator { - - public static boolean isAssignmentOperator(JetBinaryExpression expression) { - JetToken operationToken = getOperationToken(expression); - return (OperatorConventions.ASSIGNMENT_OPERATIONS.keySet().contains(operationToken) - || isAssignment(operationToken)); - } - - @NotNull - public static JsExpression translate(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - if (isIntrinsicOperation(context, expression)) { - return IntrinsicAssignmentTranslator.translate(expression, context); - } - return OverloadedAssignmentTranslator.translate(expression, context); - } - - @NotNull - protected final JetBinaryExpression expression; - protected final AccessTranslator accessTranslator; - protected final boolean isVariableReassignment; - @NotNull - protected final JsExpression right; - - protected AssignmentTranslator(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - this.isVariableReassignment = isVariableReassignment(context.bindingContext(), expression); - this.accessTranslator = AccessTranslator.getAccessTranslator(expression.getLeft(), context()); - this.right = translateRightExpression(context(), expression); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.java deleted file mode 100644 index 6fdf03194f2..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsBinaryOperation; -import com.google.dart.compiler.backend.js.ast.JsBinaryOperator; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; -import org.jetbrains.jet.lang.psi.JetBinaryExpression; -import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; -import org.jetbrains.jet.lang.types.expressions.OperatorConventions; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.jet.lexer.JetTokens; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.intrinsic.EqualsIntrinsic; -import org.jetbrains.k2js.translate.reference.CallBuilder; -import org.jetbrains.k2js.translate.reference.CallType; - -import java.util.Arrays; - -import static com.google.dart.compiler.util.AstUtil.not; -import static org.jetbrains.k2js.translate.operation.AssignmentTranslator.isAssignmentOperator; -import static org.jetbrains.k2js.translate.operation.CompareToTranslator.isCompareToCall; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getFunctionDescriptorForOperationExpression; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getResolvedCall; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.isEquals; -import static org.jetbrains.k2js.translate.utils.PsiUtils.*; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.translateLeftExpression; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.translateRightExpression; - - -/** - * @author Pavel Talanov - */ -public final class BinaryOperationTranslator extends AbstractTranslator { - - @NotNull - public static JsExpression translate(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - return (new BinaryOperationTranslator(expression, context).translate()); - } - - @NotNull - /*package*/ static JsExpression translateAsOverloadedCall(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - return (new BinaryOperationTranslator(expression, context)).translateAsOverloadedBinaryOperation(); - } - - @NotNull - private final JetBinaryExpression expression; - - @Nullable - private final FunctionDescriptor operationDescriptor; - - private BinaryOperationTranslator(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - this.operationDescriptor = - getFunctionDescriptorForOperationExpression(bindingContext(), expression); - } - - @NotNull - private JsExpression translate() { - if (isAssignmentOperator(expression)) { - return AssignmentTranslator.translate(expression, context()); - } - if (isNotOverloadable()) { - return translateAsUnOverloadableBinaryOperation(); - } - if (isCompareToCall(expression, context())) { - return CompareToTranslator.translate(expression, context()); - } - assert operationDescriptor != null : - "Overloadable operations must have not null descriptor"; - if (isEquals(operationDescriptor)) { - return translateAsEqualsCall(); - } - return translateAsOverloadedBinaryOperation(); - } - - private boolean isNotOverloadable() { - return operationDescriptor == null; - } - - @NotNull - private JsExpression translateAsEqualsCall() { - assert operationDescriptor != null : "Equals operation must resolve to descriptor."; - EqualsIntrinsic intrinsic = context().intrinsics().getEqualsIntrinsic(operationDescriptor); - intrinsic.setNegated(expression.getOperationToken().equals(JetTokens.EXCLEQ)); - JsExpression left = translateLeftExpression(context(), expression); - JsExpression right = translateRightExpression(context(), expression); - return intrinsic.apply(left, Arrays.asList(right), context()); - } - - @NotNull - private JsExpression translateAsUnOverloadableBinaryOperation() { - JetToken token = getOperationToken(expression); - JsBinaryOperator operator = OperatorTable.getBinaryOperator(token); - assert OperatorConventions.NOT_OVERLOADABLE.contains(token); - JsExpression left = translateLeftExpression(context(), expression); - JsExpression right = translateRightExpression(context(), expression); - return new JsBinaryOperation(operator, left, right); - } - - - @NotNull - private JsExpression translateAsOverloadedBinaryOperation() { - CallBuilder callBuilder = setReceiverAndArguments(); - ResolvedCall resolvedCall1 = - getResolvedCall(bindingContext(), expression.getOperationReference()); - JsExpression result = callBuilder.resolvedCall(resolvedCall1) - .type(CallType.NORMAL).translate(); - return mayBeWrapWithNegation(result); - } - - @NotNull - private CallBuilder setReceiverAndArguments() { - CallBuilder callBuilder = CallBuilder.build(context()); - - JsExpression leftExpression = translateLeftExpression(context(), expression); - JsExpression rightExpression = translateRightExpression(context(), expression); - - if (isInOrNotInOperation(expression)) { - return callBuilder.receiver(rightExpression).args(leftExpression); - } else { - return callBuilder.receiver(leftExpression).args(rightExpression); - } - } - - @NotNull - private JsExpression mayBeWrapWithNegation(@NotNull JsExpression result) { - if (isNotInOperation(expression)) { - return not(result); - } else { - return result; - } - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/CompareToTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/CompareToTranslator.java deleted file mode 100644 index 3ce5449c216..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/CompareToTranslator.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsBinaryOperation; -import com.google.dart.compiler.backend.js.ast.JsBinaryOperator; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; -import org.jetbrains.jet.lang.psi.JetBinaryExpression; -import org.jetbrains.jet.lang.types.expressions.OperatorConventions; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.intrinsic.CompareToIntrinsic; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -import java.util.Arrays; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getFunctionDescriptorForOperationExpression; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.isCompareTo; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getOperationToken; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.*; - -/** - * @author Pavel Talanov - */ -public final class CompareToTranslator extends AbstractTranslator { - - public static boolean isCompareToCall(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - FunctionDescriptor operationDescriptor = - getFunctionDescriptorForOperationExpression(context.bindingContext(), expression); - - if (operationDescriptor == null) return false; - - return (isCompareTo(operationDescriptor)); - } - - @NotNull - public static JsExpression translate(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - return (new CompareToTranslator(expression, context)).translate(); - } - - @NotNull - private final JetBinaryExpression expression; - - @NotNull - private final FunctionDescriptor descriptor; - - private CompareToTranslator(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - FunctionDescriptor functionDescriptor = - getFunctionDescriptorForOperationExpression(context.bindingContext(), expression); - assert functionDescriptor != null : "CompareTo should always have a descriptor"; - this.descriptor = functionDescriptor; - assert (OperatorConventions.COMPARISON_OPERATIONS.contains(getOperationToken(expression))); - } - - @NotNull - private JsExpression translate() { - if (isIntrinsicOperation(context(), expression)) { - return intrinsicCompareTo(); - } - return overloadedCompareTo(); - } - - @NotNull - private JsExpression overloadedCompareTo() { - JsBinaryOperator correspondingOperator = OperatorTable.getBinaryOperator(getOperationToken(expression)); - JsExpression methodCall = BinaryOperationTranslator.translateAsOverloadedCall(expression, context()); - return new JsBinaryOperation(correspondingOperator, methodCall, TranslationUtils.zeroLiteral(context())); - } - - @NotNull - private JsExpression intrinsicCompareTo() { - CompareToIntrinsic intrinsic = context().intrinsics().getCompareToIntrinsic(descriptor); - intrinsic.setComparisonToken((JetToken) expression.getOperationToken()); - JsExpression left = translateLeftExpression(context(), expression); - JsExpression right = translateRightExpression(context(), expression); - return intrinsic.apply(left, Arrays.asList(right), context()); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/IncrementTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/IncrementTranslator.java deleted file mode 100644 index 0852a3e1179..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/IncrementTranslator.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.psi.JetUnaryExpression; -import org.jetbrains.jet.lang.types.expressions.OperatorConventions; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.reference.AccessTranslator; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.isStatement; -import static org.jetbrains.k2js.translate.utils.BindingUtils.isVariableReassignment; -import static org.jetbrains.k2js.translate.utils.PsiUtils.*; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.isIntrinsicOperation; - -/** - * @author Pavel Talanov - */ -// TODO: provide better increment translator logic -public abstract class IncrementTranslator extends AbstractTranslator { - - public static boolean isIncrement(@NotNull JetUnaryExpression expression) { - return OperatorConventions.INCREMENT_OPERATIONS.contains(getOperationToken(expression)); - } - - @NotNull - public static JsExpression translate(@NotNull JetUnaryExpression expression, - @NotNull TranslationContext context) { - if (isIntrinsicOperation(context, expression)) { - return IntrinsicIncrementTranslator.translate(expression, context); - } - return OverloadedIncrementTranslator.translate(expression, context); - } - - @NotNull - protected final JetUnaryExpression expression; - @NotNull - protected final AccessTranslator accessTranslator; - private final boolean isVariableReassignment; - - protected IncrementTranslator(@NotNull JetUnaryExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - this.isVariableReassignment = isVariableReassignment(context.bindingContext(), expression); - JetExpression baseExpression = getBaseExpression(expression); - this.accessTranslator = AccessTranslator.getAccessTranslator(baseExpression, context()); - } - - @NotNull - protected JsExpression translateAsMethodCall() { - if (returnValueIgnored() || isPrefix(expression)) { - return asPrefix(); - } - if (isVariableReassignment) { - return asPostfixWithReassignment(); - } else { - return asPostfixWithNoReassignment(); - } - } - - private boolean returnValueIgnored() { - return isStatement(bindingContext(), expression); - } - - @NotNull - private JsExpression asPrefix() { - JsExpression getExpression = accessTranslator.translateAsGet(); - if (isVariableReassignment) { - return variableReassignment(getExpression); - } - return operationExpression(getExpression); - } - - //TODO: decide if this expression can be optimised in case of direct access (not property) - @NotNull - private JsExpression asPostfixWithReassignment() { - // code fragment: expr(a++) - // generate: expr( (t1 = a, t2 = t1, a = t1.inc(), t2) ) - TemporaryVariable t1 = context().declareTemporary(accessTranslator.translateAsGet()); - TemporaryVariable t2 = context().declareTemporary(t1.reference()); - JsExpression variableReassignment = variableReassignment(t1.reference()); - return AstUtil.newSequence(t1.assignmentExpression(), t2.assignmentExpression(), - variableReassignment, t2.reference()); - } - - //TODO: TEST - @NotNull - private JsExpression asPostfixWithNoReassignment() { - // code fragment: expr(a++) - // generate: expr( (t1 = a, t2 = t1, t2.inc(), t1) ) - TemporaryVariable t1 = context().declareTemporary(accessTranslator.translateAsGet()); - TemporaryVariable t2 = context().declareTemporary(t1.reference()); - JsExpression methodCall = operationExpression(t2.reference()); - JsExpression returnedValue = t1.reference(); - return AstUtil.newSequence(t1.assignmentExpression(), t2.assignmentExpression(), methodCall, returnedValue); - } - - @NotNull - private JsExpression variableReassignment(@NotNull JsExpression toCallMethodUpon) { - JsExpression overloadedMethodCallOnPropertyGetter = operationExpression(toCallMethodUpon); - return accessTranslator.translateAsSet(overloadedMethodCallOnPropertyGetter); - } - - @NotNull - abstract JsExpression operationExpression(@NotNull JsExpression receiver); -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/IntrinsicAssignmentTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/IntrinsicAssignmentTranslator.java deleted file mode 100644 index e845b34a175..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/IntrinsicAssignmentTranslator.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsBinaryOperation; -import com.google.dart.compiler.backend.js.ast.JsBinaryOperator; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetBinaryExpression; -import org.jetbrains.jet.lang.types.expressions.OperatorConventions; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.reference.ReferenceAccessTranslator; - -import static org.jetbrains.k2js.translate.utils.PsiUtils.getOperationToken; -import static org.jetbrains.k2js.translate.utils.PsiUtils.isAssignment; - -/** - * @author Pavel Talanov - */ -public final class IntrinsicAssignmentTranslator extends AssignmentTranslator { - - - @NotNull - public static JsExpression translate(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - return (new IntrinsicAssignmentTranslator(expression, context)).translate(); - } - - private IntrinsicAssignmentTranslator(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - super(expression, context); - } - - @NotNull - protected JsExpression translate() { - if (isAssignment(getOperationToken(expression))) { - return translateAsPlainAssignment(); - } - return translateAsAssignmentOperation(); - } - - @NotNull - private JsExpression translateAsAssignmentOperation() { - if (accessTranslator instanceof ReferenceAccessTranslator) { - return translateAsPlainAssignmentOperation(); - } - return translateAsAssignToCounterpart(); - } - - @NotNull - private JsExpression translateAsAssignToCounterpart() { - JsBinaryOperator operator = getCounterpartOperator(); - JsBinaryOperation counterpartOperation = - new JsBinaryOperation(operator, accessTranslator.translateAsGet(), right); - return accessTranslator.translateAsSet(counterpartOperation); - } - - @NotNull - private JsBinaryOperator getCounterpartOperator() { - JetToken assignmentOperationToken = getOperationToken(expression); - assert OperatorConventions.ASSIGNMENT_OPERATIONS.containsKey(assignmentOperationToken); - JetToken counterpartToken = OperatorConventions.ASSIGNMENT_OPERATION_COUNTERPARTS.get(assignmentOperationToken); - assert OperatorTable.hasCorrespondingBinaryOperator(counterpartToken) : - "Unsupported token encountered: " + counterpartToken.toString(); - return OperatorTable.getBinaryOperator(counterpartToken); - } - - @NotNull - private JsExpression translateAsPlainAssignmentOperation() { - JsBinaryOperator operator = getAssignmentOperator(); - return new JsBinaryOperation(operator, accessTranslator.translateAsGet(), right); - } - - @NotNull - private JsBinaryOperator getAssignmentOperator() { - JetToken token = getOperationToken(expression); - assert OperatorConventions.ASSIGNMENT_OPERATIONS.containsKey(token); - assert OperatorTable.hasCorrespondingBinaryOperator(token) : - "Unsupported token encountered: " + token.toString(); - return OperatorTable.getBinaryOperator(token); - } - - @NotNull - private JsExpression translateAsPlainAssignment() { - return accessTranslator.translateAsSet(right); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/IntrinsicIncrementTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/IntrinsicIncrementTranslator.java deleted file mode 100644 index 4fe2c79bab6..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/IntrinsicIncrementTranslator.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.*; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetUnaryExpression; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.jet.lexer.JetTokens; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.reference.ReferenceAccessTranslator; - -import static org.jetbrains.k2js.translate.utils.PsiUtils.getOperationToken; -import static org.jetbrains.k2js.translate.utils.PsiUtils.isPrefix; - - -/** - * @author Pavel Talanov - */ -public final class IntrinsicIncrementTranslator extends IncrementTranslator { - - - @NotNull - public static JsExpression translate(@NotNull JetUnaryExpression expression, - @NotNull TranslationContext context) { - return (new IntrinsicIncrementTranslator(expression, context)) - .translate(); - } - - private IntrinsicIncrementTranslator(@NotNull JetUnaryExpression expression, - @NotNull TranslationContext context) { - super(expression, context); - } - - @NotNull - protected JsExpression translate() { - if (isPrimitiveExpressionIncrement()) { - return jsUnaryExpression(); - } - return translateAsMethodCall(); - } - - private boolean isPrimitiveExpressionIncrement() { - return accessTranslator instanceof ReferenceAccessTranslator; - } - - @NotNull - private JsExpression jsUnaryExpression() { - JsUnaryOperator operator = OperatorTable.getUnaryOperator(getOperationToken(expression)); - JsExpression getExpression = accessTranslator.translateAsGet(); - if (isPrefix(expression)) { - return new JsPrefixOperation(operator, getExpression); - } else { - return new JsPostfixOperation(operator, getExpression); - } - } - - @Override - @NotNull - protected JsExpression operationExpression(@NotNull JsExpression receiver) { - return unaryAsBinary(receiver); - } - - public JsBinaryOperation unaryAsBinary(@NotNull JsExpression leftExpression) { - JsNumberLiteral oneLiteral = program().getNumberLiteral(1); - JetToken token = getOperationToken(expression); - if (token.equals(JetTokens.PLUSPLUS)) { - return new JsBinaryOperation(JsBinaryOperator.ADD, leftExpression, oneLiteral); - } - if (token.equals(JetTokens.MINUSMINUS)) { - return new JsBinaryOperation(JsBinaryOperator.SUB, leftExpression, oneLiteral); - } - throw new AssertionError("This method should be called only for increment and decrement operators"); - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/OperatorTable.java b/translator/src/org/jetbrains/k2js/translate/operation/OperatorTable.java deleted file mode 100644 index 25405b9042b..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/OperatorTable.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsBinaryOperator; -import com.google.dart.compiler.backend.js.ast.JsUnaryOperator; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.jet.lexer.JetTokens; - -import java.util.HashMap; -import java.util.Map; - -/** - * @author Pavel Talanov - */ - -//TODO: refactor using guava builders -public final class OperatorTable { - - private static final Map binaryOperatorsMap = new HashMap(); - private static final Map unaryOperatorsMap = new HashMap(); - - static { - unaryOperatorsMap.put(JetTokens.PLUSPLUS, JsUnaryOperator.INC); //++ - unaryOperatorsMap.put(JetTokens.MINUSMINUS, JsUnaryOperator.DEC); //-- - unaryOperatorsMap.put(JetTokens.EXCL, JsUnaryOperator.NOT); //! - unaryOperatorsMap.put(JetTokens.MINUS, JsUnaryOperator.NEG); //- - unaryOperatorsMap.put(JetTokens.PLUS, JsUnaryOperator.POS); //+ - } - - //TODO : not all operators , add and test bit operators - static { - binaryOperatorsMap.put(JetTokens.PLUS, JsBinaryOperator.ADD); - binaryOperatorsMap.put(JetTokens.MINUS, JsBinaryOperator.SUB); - binaryOperatorsMap.put(JetTokens.MUL, JsBinaryOperator.MUL); - binaryOperatorsMap.put(JetTokens.DIV, JsBinaryOperator.DIV); - binaryOperatorsMap.put(JetTokens.EQ, JsBinaryOperator.ASG); - binaryOperatorsMap.put(JetTokens.GT, JsBinaryOperator.GT); - binaryOperatorsMap.put(JetTokens.GTEQ, JsBinaryOperator.GTE); - binaryOperatorsMap.put(JetTokens.LT, JsBinaryOperator.LT); - binaryOperatorsMap.put(JetTokens.LTEQ, JsBinaryOperator.LTE); - binaryOperatorsMap.put(JetTokens.EQEQ, JsBinaryOperator.REF_EQ); - binaryOperatorsMap.put(JetTokens.ANDAND, JsBinaryOperator.AND); - binaryOperatorsMap.put(JetTokens.OROR, JsBinaryOperator.OR); - binaryOperatorsMap.put(JetTokens.EXCLEQ, JsBinaryOperator.NEQ); - binaryOperatorsMap.put(JetTokens.PERC, JsBinaryOperator.MOD); - binaryOperatorsMap.put(JetTokens.PLUSEQ, JsBinaryOperator.ASG_ADD); - binaryOperatorsMap.put(JetTokens.MINUSEQ, JsBinaryOperator.ASG_SUB); - binaryOperatorsMap.put(JetTokens.DIVEQ, JsBinaryOperator.ASG_DIV); - binaryOperatorsMap.put(JetTokens.MULTEQ, JsBinaryOperator.ASG_MUL); - binaryOperatorsMap.put(JetTokens.PERCEQ, JsBinaryOperator.ASG_MOD); - } - - - public static boolean hasCorrespondingBinaryOperator(@NotNull JetToken token) { - return binaryOperatorsMap.containsKey(token); - } - - @NotNull - static public JsBinaryOperator getBinaryOperator(@NotNull JetToken token) { - assert JetTokens.OPERATIONS.contains(token) : "Token should represent an operation!"; - return binaryOperatorsMap.get(token); - } - - @NotNull - static public JsUnaryOperator getUnaryOperator(@NotNull JetToken token) { - assert JetTokens.OPERATIONS.contains(token) : "Token should represent an operation!"; - return unaryOperatorsMap.get(token); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.java deleted file mode 100644 index b51a05e360f..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetBinaryExpression; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import static org.jetbrains.k2js.translate.utils.TranslationUtils.getMethodReferenceForOverloadedOperation; - -/** - * @author Pavel Talanov - */ -public final class OverloadedAssignmentTranslator extends AssignmentTranslator { - - @NotNull - public static JsExpression translate(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - return (new OverloadedAssignmentTranslator(expression, context)).translate(); - } - - @NotNull - private final JsNameRef operationReference; - - private OverloadedAssignmentTranslator(@NotNull JetBinaryExpression expression, - @NotNull TranslationContext context) { - super(expression, context); - this.operationReference = getMethodReferenceForOverloadedOperation(context, expression); - } - - @NotNull - protected JsExpression translate() { - if (isVariableReassignment) { - return reassignment(); - } - return overloadedMethodInvocation(); - } - - @NotNull - private JsExpression reassignment() { - return accessTranslator.translateAsSet(overloadedMethodInvocation()); - } - - @NotNull - private JsExpression overloadedMethodInvocation() { - AstUtil.setQualifier(operationReference, accessTranslator.translateAsGet()); - return AstUtil.newInvocation(operationReference, right); - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.java deleted file mode 100644 index bbeea97e9b0..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetUnaryExpression; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import static org.jetbrains.k2js.translate.utils.TranslationUtils.getMethodReferenceForOverloadedOperation; - -/** - * @author Pavel Talanov - */ -public final class OverloadedIncrementTranslator extends IncrementTranslator { - - @NotNull - public static JsExpression translate(@NotNull JetUnaryExpression expression, - @NotNull TranslationContext context) { - return (new OverloadedIncrementTranslator(expression, context)) - .translate(); - } - - @NotNull - private final JsNameRef operationReference; - - private OverloadedIncrementTranslator(@NotNull JetUnaryExpression expression, - @NotNull TranslationContext context) { - super(expression, context); - this.operationReference = getMethodReferenceForOverloadedOperation(context, expression); - } - - @NotNull - protected JsExpression translate() { - return translateAsMethodCall(); - } - - @Override - @NotNull - protected JsExpression operationExpression(@NotNull JsExpression receiver) { - AstUtil.setQualifier(operationReference, receiver); - return AstUtil.newInvocation(operationReference); - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.java b/translator/src/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.java deleted file mode 100644 index f6e9f1fc060..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.operation; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetUnaryExpression; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.reference.CallBuilder; -import org.jetbrains.k2js.translate.reference.CallType; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -import java.util.Collections; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getResolvedCall; - -/** - * @author Pavel Talanov - */ - -public final class UnaryOperationTranslator { - - @NotNull - public static JsExpression translate(@NotNull JetUnaryExpression expression, - @NotNull TranslationContext context) { - if (IncrementTranslator.isIncrement(expression)) { - return IncrementTranslator.translate(expression, context); - } - return translateAsCall(expression, context); - } - - @NotNull - private static JsExpression translateAsCall(@NotNull JetUnaryExpression expression, - @NotNull TranslationContext context) { - return CallBuilder.build(context) - .receiver(TranslationUtils.translateBaseExpression(context, expression)) - .args(Collections.emptyList()) - .resolvedCall(getResolvedCall(context.bindingContext(), expression.getOperationReference())) - .type(CallType.NORMAL).translate(); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/AccessTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/AccessTranslator.java deleted file mode 100644 index 33a59596c2b..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/AccessTranslator.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; - -/** - * @author Pavel Talanov - *

- * Abstract entity for language constructs that you can get/set. Also dispatches to the real implemntation. - */ -public abstract class AccessTranslator extends AbstractTranslator { - - //TODO: this piece of code represents dangerously convoluted logic, think of the ways it can be improved - @NotNull - public static AccessTranslator getAccessTranslator(@NotNull JetExpression referenceExpression, - @NotNull TranslationContext context) { - assert ((referenceExpression instanceof JetReferenceExpression) || - (referenceExpression instanceof JetQualifiedExpression)); - if (PropertyAccessTranslator.canBePropertyAccess(referenceExpression, context)) { - if (referenceExpression instanceof JetQualifiedExpression) { - return QualifiedExpressionTranslator.getAccessTranslator((JetQualifiedExpression) referenceExpression, context); - } - assert referenceExpression instanceof JetSimpleNameExpression; - return PropertyAccessTranslator.newInstance((JetSimpleNameExpression) referenceExpression, - null, CallType.NORMAL, context); - } - if (referenceExpression instanceof JetArrayAccessExpression) { - return ArrayAccessTranslator.newInstance((JetArrayAccessExpression) referenceExpression, context); - } - return ReferenceAccessTranslator.newInstance((JetSimpleNameExpression) referenceExpression, context); - } - - - @NotNull - public static JsExpression translateAsGet(@NotNull JetReferenceExpression expression, - @NotNull TranslationContext context) { - return (getAccessTranslator(expression, context)).translateAsGet(); - } - - - protected AccessTranslator(@Deprecated TranslationContext context) { - super(context); - } - - public abstract JsExpression translateAsGet(); - - public abstract JsExpression translateAsSet(@NotNull JsExpression setTo); - -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/ArrayAccessTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/ArrayAccessTranslator.java deleted file mode 100644 index 963a05e4b05..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/ArrayAccessTranslator.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; -import org.jetbrains.jet.lang.psi.JetArrayAccessExpression; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.utils.BindingUtils; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getDescriptorForReferenceExpression; - -/** - * @author Pavel Talanov - */ - -//TODO: inspect not clear how the class handles set and get operations differently -public final class ArrayAccessTranslator extends AccessTranslator { - - /*package*/ - static ArrayAccessTranslator newInstance(@NotNull JetArrayAccessExpression expression, - @NotNull TranslationContext context) { - return new ArrayAccessTranslator(expression, context); - } - - @NotNull - private final JetArrayAccessExpression expression; - @NotNull - private final FunctionDescriptor methodDescriptor; - - private ArrayAccessTranslator(@NotNull JetArrayAccessExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - //TODO: that is strange - this.methodDescriptor = (FunctionDescriptor) - getDescriptorForReferenceExpression(context.bindingContext(), expression); - } - - @Override - @NotNull - public JsExpression translateAsGet() { - List arguments = translateIndexExpressions(); - return translateAsMethodCall(arguments); - } - - @Override - @NotNull - public JsExpression translateAsSet(@NotNull JsExpression expression) { - - List arguments = translateIndexExpressions(); - arguments.add(expression); - return translateAsMethodCall(arguments); - } - - @NotNull - private JsExpression translateAsMethodCall(@NotNull List arguments) { - return CallBuilder.build(context()) - .receiver(translateArrayExpression()) - .args(arguments) - .resolvedCall(BindingUtils.getResolvedCall(bindingContext(), expression)) - .descriptor(methodDescriptor) - .translate(); - } - - @NotNull - private List translateIndexExpressions() { - return TranslationUtils.translateExpressionList(context(), expression.getIndexExpressions()); - } - - @NotNull - private JsExpression translateArrayExpression() { - return Translation.translateAsExpression(expression.getArrayExpression(), context()); - } - - -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java b/translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java deleted file mode 100644 index fb8d82ea3a9..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/CallBuilder.java +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.common.collect.Lists; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; -import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; -import org.jetbrains.jet.lang.resolve.calls.ResolvedCallImpl; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class CallBuilder { - - public static CallBuilder build(@NotNull TranslationContext context) { - return new CallBuilder(context); - } - - @NotNull - private final TranslationContext context; - @Nullable - private /*var*/ JsExpression receiver = null; - @NotNull - private final List args = Lists.newArrayList(); - @NotNull - private /*var*/ CallType callType = CallType.NORMAL; - @Nullable - private /*var*/ ResolvedCall resolvedCall = null; - @Nullable - private /*var*/ CallableDescriptor descriptor = null; - @Nullable - private /*var*/ JsExpression callee = null; - - - private CallBuilder(@NotNull TranslationContext context) { - this.context = context; - } - - @NotNull - public CallBuilder receiver(@Nullable JsExpression receiver) { - this.receiver = receiver; - return this; - } - - @NotNull - public CallBuilder args(@NotNull List args) { - assert this.args.isEmpty(); - this.args.addAll(args); - return this; - } - - @NotNull - public CallBuilder args(@NotNull JsExpression... args) { - return args(Arrays.asList(args)); - } - - @NotNull - public CallBuilder descriptor(@NotNull CallableDescriptor descriptor) { - this.descriptor = descriptor; - return this; - } - - @NotNull - public CallBuilder callee(@Nullable JsExpression callee) { - this.callee = callee; - return this; - } - - @NotNull - public CallBuilder resolvedCall(@NotNull ResolvedCall call) { - this.resolvedCall = call; - return this; - } - - @NotNull - public CallBuilder type(@NotNull CallType type) { - this.callType = type; - return this; - } - - //TODO: must be private - @NotNull - public CallTranslator finish() { - if (resolvedCall == null) { - assert descriptor != null; - resolvedCall = ResolvedCallImpl.create(descriptor); - } - if (descriptor == null) { - descriptor = resolvedCall.getCandidateDescriptor().getOriginal(); - } - assert resolvedCall != null; - return new CallTranslator(receiver, callee, args, resolvedCall, descriptor, callType, context); - } - - @NotNull - public JsExpression translate() { - return finish().translate(); - } - /* - @NotNull - private CallTranslator buildFromUnary(@NotNull JetUnaryExpression unaryExpression) { - JsExpression receiver = TranslationUtils.translateBaseExpression(context, unaryExpression); - List arguments = Collections.emptyList(); - ResolvedCall resolvedCall = - getResolvedCall(context.bindingContext(), unaryExpression.getOperationReference()); - return new CallTranslator(receiver, null, arguments, resolvedCall, null, CallType.NORMAL, context); - } - - //TODO: method too long - @NotNull - private CallTranslator buildFromBinary(@NotNull JetBinaryExpression binaryExpression, - boolean swapReceiverAndArgument) { - - JsExpression leftExpression = translateLeftExpression(context, binaryExpression); - JsExpression rightExpression = translateRightExpression(context, binaryExpression); - - JsExpression receiver; - List arguments; - if (swapReceiverAndArgument) { - receiver = rightExpression; - arguments = Arrays.asList(leftExpression); - } else { - receiver = leftExpression; - arguments = Arrays.asList(rightExpression); - } - - ResolvedCall resolvedCall = - getResolvedCall(context.bindingContext(), binaryExpression.getOperationReference()); - return new CallTranslator(receiver, null, arguments, resolvedCall, null, CallType.NORMAL, context); - } - - @NotNull - private CallTranslator buildFromCallExpression(@NotNull JetCallExpression callExpression, - @Nullable JsExpression receiver, - @NotNull CallType callType) { - ResolvedCall resolvedCall = getResolvedCallForCallExpression(context.bindingContext(), callExpression); - List arguments = translateArgumentsForCallExpression(callExpression, context); - JsExpression callee = null; - if (resolvedCall.getCandidateDescriptor() instanceof ExpressionAsFunctionDescriptor) { - callee = Translation.translateAsExpression(getCallee(callExpression), context); - } - return new CallTranslator(receiver, callee, arguments, resolvedCall, null, callType, context); - } - - @NotNull - private List translateArgumentsForCallExpression(@NotNull JetCallExpression callExpression, - @NotNull TranslationContext context) { - List result = new ArrayList(); - ResolvedCall resolvedCall = getResolvedCallForCallExpression(context.bindingContext(), callExpression); - Map formalToActualArguments = resolvedCall.getValueArguments(); - for (ValueParameterDescriptor parameterDescriptor : resolvedCall.getResultingDescriptor().getValueParameters()) { - ResolvedValueArgument actualArgument = formalToActualArguments.get(parameterDescriptor); - result.add(translateSingleArgument(actualArgument, parameterDescriptor)); - } - return result; - } - - - //TODO: refactor - @NotNull - private JsExpression translateSingleArgument(@NotNull ResolvedValueArgument actualArgument, - @NotNull ValueParameterDescriptor parameterDescriptor) { - List argumentExpressions = actualArgument.getArgumentExpressions(); - if (actualArgument instanceof VarargValueArgument) { - return translateVarargArgument(argumentExpressions); - } - if (actualArgument instanceof DefaultValueArgument) { - JetExpression defaultArgument = getDefaultArgument(context.bindingContext(), parameterDescriptor); - return Translation.translateAsExpression(defaultArgument, context); - } - assert actualArgument instanceof ExpressionValueArgument; - assert argumentExpressions.size() == 1; - return Translation.translateAsExpression(argumentExpressions.get(0), context); - } - - @NotNull - private JsExpression translateVarargArgument(@NotNull List arguments) { - JsArrayLiteral varargArgument = new JsArrayLiteral(); - for (JetExpression argument : arguments) { - varargArgument.getExpressions().add(Translation.translateAsExpression(argument, context)); - } - return varargArgument; - } - */ - - -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/CallExpressionTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/CallExpressionTranslator.java deleted file mode 100644 index 713a9fd9e73..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/CallExpressionTranslator.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.common.collect.Lists; -import com.google.dart.compiler.backend.js.ast.JsArrayLiteral; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; -import org.jetbrains.jet.lang.psi.JetCallExpression; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.resolve.calls.*; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.general.Translation; -import org.jetbrains.k2js.translate.utils.AnnotationsUtils; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getDefaultArgument; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getResolvedCallForCallExpression; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getCallee; - -/** - * @author Pavel Talanov - */ -public final class CallExpressionTranslator extends AbstractTranslator { - - @NotNull - public static JsExpression translate(@NotNull JetCallExpression expression, - @Nullable JsExpression receiver, - @NotNull CallType callType, - @NotNull TranslationContext context) { - return (new CallExpressionTranslator(expression, context)).translate(receiver, callType); - } - - @NotNull - private final JetCallExpression expression; - @NotNull - private final ResolvedCall resolvedCall; - private final boolean isNativeFunctionCall; - - private CallExpressionTranslator(@NotNull JetCallExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - this.resolvedCall = getResolvedCallForCallExpression(bindingContext(), expression); - this.isNativeFunctionCall = AnnotationsUtils.isNativeObject(resolvedCall.getCandidateDescriptor()); - } - - @NotNull - private JsExpression translate(@Nullable JsExpression receiver, - @NotNull CallType callType) { - return CallBuilder.build(context()) - .receiver(receiver) - .callee(getCalleeExpression()) - .args(translateArguments()) - .resolvedCall(resolvedCall) - .type(callType) - .translate(); - } - - @Nullable - private JsExpression getCalleeExpression() { - if (resolvedCall.getCandidateDescriptor() instanceof ExpressionAsFunctionDescriptor) { - return Translation.translateAsExpression(getCallee(expression), context()); - } - return null; - } - - @NotNull - private List translateArguments() { - List result = new ArrayList(); - ResolvedCall resolvedCall = getResolvedCallForCallExpression(bindingContext(), expression); - for (ValueParameterDescriptor parameterDescriptor : resolvedCall.getResultingDescriptor().getValueParameters()) { - ResolvedValueArgument actualArgument = resolvedCall.getValueArgumentsByIndex().get(parameterDescriptor.getIndex()); - result.addAll(translateSingleArgument(actualArgument, parameterDescriptor)); - } - return result; - } - - @NotNull - private List translateSingleArgument(@NotNull ResolvedValueArgument actualArgument, - @NotNull ValueParameterDescriptor parameterDescriptor) { - List argumentExpressions = actualArgument.getArgumentExpressions(); - if (actualArgument instanceof VarargValueArgument) { - return translateVarargArgument(argumentExpressions); - } - if (actualArgument instanceof DefaultValueArgument) { - JetExpression defaultArgument = getDefaultArgument(bindingContext(), parameterDescriptor); - return Arrays.asList(Translation.translateAsExpression(defaultArgument, context())); - } - assert actualArgument instanceof ExpressionValueArgument; - assert argumentExpressions.size() == 1; - return Arrays.asList(Translation.translateAsExpression(argumentExpressions.get(0), context())); - } - - @NotNull - private List translateVarargArgument(@NotNull List arguments) { - List translatedArgs = Lists.newArrayList(); - for (JetExpression argument : arguments) { - translatedArgs.add(Translation.translateAsExpression(argument, context())); - } - if (isNativeFunctionCall) { - return translatedArgs; - } - return wrapInArrayLiteral(translatedArgs); - } - - @NotNull - private List wrapInArrayLiteral(@NotNull List translatedArgs) { - JsArrayLiteral argsWrappedInArray = new JsArrayLiteral(); - argsWrappedInArray.getExpressions().addAll(translatedArgs); - return Arrays.asList(argsWrappedInArray); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/CallTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/CallTranslator.java deleted file mode 100644 index 199d9e4b446..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/CallTranslator.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsInvocation; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.backend.js.ast.JsNew; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.resolve.calls.ExpressionAsFunctionDescriptor; -import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; -import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.AbstractTranslator; -import org.jetbrains.k2js.translate.intrinsic.FunctionIntrinsic; -import org.jetbrains.k2js.translate.utils.AnnotationsUtils; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -import java.util.ArrayList; -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.*; -import static org.jetbrains.k2js.translate.utils.TranslationUtils.getThisObject; - -/** - * @author Pavel Talanov - */ -//TODO: write tests on calling backing fields as functions -public final class CallTranslator extends AbstractTranslator { - - private static class CallParameters { - - public CallParameters(@Nullable JsExpression receiver, @NotNull JsExpression functionReference) { - this.receiver = receiver; - this.functionReference = functionReference; - } - - @Nullable - public /*var*/ JsExpression receiver; - @NotNull - public /*var*/ JsExpression functionReference; - } - - //NOTE: receiver may mean this object as well - @Nullable - private /*var*/ JsExpression receiver; - - @Nullable - private final JsExpression callee; - - @NotNull - private final List arguments; - - @NotNull - private final ResolvedCall resolvedCall; - - @NotNull - private final CallableDescriptor descriptor; - - @NotNull - private final CallType callType; - - /*package*/ CallTranslator(@Nullable JsExpression receiver, @Nullable JsExpression callee, - @NotNull List arguments, - @NotNull ResolvedCall resolvedCall, - @NotNull CallableDescriptor descriptorToCall, - @NotNull CallType callType, - @NotNull TranslationContext context) { - super(context); - this.receiver = receiver; - this.arguments = arguments; - this.resolvedCall = resolvedCall; - this.callType = callType; - this.descriptor = descriptorToCall; - this.callee = callee; - } - - @NotNull - /*package*/ JsExpression translate() { - //NOTE: treat native extension function calls as usual calls - if (isIntrinsic()) { - return intrinsicInvocation(); - } - if (isConstructor()) { - return constructorCall(); - } - if (isNative()) { - return methodCall(); - } - if (isExtensionFunctionLiteral()) { - return extensionFunctionLiteralCall(); - } - if (isExtensionFunction()) { - return extensionFunctionCall(); - } - return methodCall(); - } - - private boolean isIntrinsic() { - return context().intrinsics().isIntrinsic(descriptor); - } - - @NotNull - private JsExpression intrinsicInvocation() { - assert descriptor instanceof FunctionDescriptor; - FunctionIntrinsic functionIntrinsic = - context().intrinsics().getFunctionIntrinsic((FunctionDescriptor) descriptor); - JsExpression receiverExpression = resolveThisObject(/*do not get qualifier*/false); - return functionIntrinsic.apply(receiverExpression, arguments, context()); - } - - private boolean isConstructor() { - return isConstructorDescriptor(descriptor); - } - - @NotNull - private JsExpression constructorCall() { - JsExpression constructorReference = translateAsFunctionWithNoThisObject(descriptor); - JsNew constructorCall = new JsNew(constructorReference); - constructorCall.setArguments(arguments); - return constructorCall; - } - - @NotNull - private JsExpression translateAsFunctionWithNoThisObject(@NotNull DeclarationDescriptor descriptor) { - return ReferenceTranslator.translateAsFQReference(descriptor, context()); - } - - private boolean isNative() { - return AnnotationsUtils.isNativeObject(descriptor); - } - - private boolean isExtensionFunctionLiteral() { - boolean isLiteral = descriptor instanceof VariableAsFunctionDescriptor - || descriptor instanceof ExpressionAsFunctionDescriptor; - return isExtensionFunction() && isLiteral; - } - - @NotNull - private JsExpression extensionFunctionLiteralCall() { - JsExpression realReceiver = getExtensionFunctionCallReceiver(); - return callType.constructCall(realReceiver, new CallType.CallConstructor() { - @NotNull - @Override - public JsExpression construct(@Nullable JsExpression receiver) { - assert receiver != null : "Could not be null for extensions"; - return constructExtensionLiteralCall(receiver); - } - }, context()); - } - - @NotNull - private JsExpression constructExtensionLiteralCall(@NotNull JsExpression realReceiver) { - List callArguments = generateExtensionCallArgumentList(realReceiver); - JsInvocation callMethodInvocation = generateCallMethodInvocation(); - callMethodInvocation.setArguments(callArguments); - return callMethodInvocation; - } - - @NotNull - private JsInvocation generateCallMethodInvocation() { - JsNameRef callMethodNameRef = AstUtil.newQualifiedNameRef("call"); - JsInvocation callMethodInvocation = new JsInvocation(); - callMethodInvocation.setQualifier(callMethodNameRef); - AstUtil.setQualifier(callMethodInvocation, callParameters().functionReference); - return callMethodInvocation; - } - - @SuppressWarnings("UnnecessaryLocalVariable") - private boolean isExtensionFunction() { - boolean hasReceiver = resolvedCall.getReceiverArgument().exists(); - return hasReceiver; - } - - @NotNull - private JsExpression extensionFunctionCall() { - JsExpression realReceiver = getExtensionFunctionCallReceiver(); - return callType.constructCall(realReceiver, new CallType.CallConstructor() { - @NotNull - @Override - public JsExpression construct(@Nullable JsExpression receiver) { - assert receiver != null : "Could not be null for extensions"; - return constructExtensionFunctionCall(receiver); - } - }, context()); - } - - @NotNull - private JsExpression getExtensionFunctionCallReceiver() { - if (receiver != null) { - JsExpression result = receiver; - //Now the rest of the code can work as if it was simple method invocation - receiver = null; - return result; - } - DeclarationDescriptor expectedReceiverDescriptor = getExpectedReceiverDescriptor(descriptor); - assert expectedReceiverDescriptor != null; - return getThisObject(context(), expectedReceiverDescriptor); - } - - @NotNull - private JsExpression constructExtensionFunctionCall(@NotNull JsExpression receiver) { - List argumentList = generateExtensionCallArgumentList(receiver); - JsExpression functionReference = callParameters().functionReference; - AstUtil.setQualifier(functionReference, callParameters().receiver); - return AstUtil.newInvocation(functionReference, argumentList); - } - - @NotNull - private List generateExtensionCallArgumentList(@NotNull JsExpression receiver) { - List argumentList = new ArrayList(); - assert this.receiver == null : "Should be null at that point"; - argumentList.add(receiver); - argumentList.addAll(arguments); - return argumentList; - } - - @NotNull - private JsExpression methodCall() { - final CallParameters callParameters = callParameters(); - return callType.constructCall(callParameters.receiver, new CallType.CallConstructor() { - @NotNull - @Override - public JsExpression construct(@Nullable JsExpression receiver) { - JsExpression functionReference = callParameters.functionReference; - if (receiver != null) { - AstUtil.setQualifier(functionReference, receiver); - } - return AstUtil.newInvocation(functionReference, arguments); - } - }, context()); - } - - @NotNull - private CallParameters callParameters() { - if (callee != null) { - return new CallParameters(null, callee); - } - JsExpression thisObject = resolveThisObject(/*just get qualifier if null*/ true); - JsExpression functionReference = functionReference(); - return new CallParameters(thisObject, functionReference); - } - - @NotNull - private JsExpression functionReference() { - if (!isVariableAsFunction(descriptor)) { - return ReferenceTranslator.translateAsLocalNameReference(descriptor, context()); - } - VariableDescriptor variableDescriptor = - getVariableDescriptorForVariableAsFunction((VariableAsFunctionDescriptor) descriptor); - if (variableDescriptor instanceof PropertyDescriptor) { - return getterCall((PropertyDescriptor) variableDescriptor); - } - return ReferenceTranslator.translateAsLocalNameReference(variableDescriptor, context()); - } - - @NotNull - private JsExpression getterCall(@NotNull PropertyDescriptor variableDescriptor) { - //TODO: call type? - return PropertyAccessTranslator.translateAsPropertyGetterCall(variableDescriptor, resolvedCall, context()); - } - - //TODO: refactor - @Nullable - private JsExpression resolveThisObject(boolean getQualifierIfNull) { - if (receiver != null) { - return receiver; - } - ReceiverDescriptor thisObject = resolvedCall.getThisObject(); - if (thisObject.exists()) { - DeclarationDescriptor expectedThisDescriptor = getDeclarationDescriptorForReceiver(thisObject); - return TranslationUtils.getThisObject(context(), expectedThisDescriptor); - } - if (getQualifierIfNull) { - return context().getQualifierForDescriptor(descriptor); - } - return null; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/CallType.java b/translator/src/org/jetbrains/k2js/translate/reference/CallType.java deleted file mode 100644 index 73f4c4842b4..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/CallType.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsBinaryOperation; -import com.google.dart.compiler.backend.js.ast.JsConditional; -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNullLiteral; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.psi.JetDotQualifiedExpression; -import org.jetbrains.jet.lang.psi.JetQualifiedExpression; -import org.jetbrains.jet.lang.psi.JetSafeQualifiedExpression; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import static com.google.dart.compiler.util.AstUtil.newSequence; - -/** - * @author Pavel Talanov - */ -public enum CallType { - SAFE { - @NotNull - @Override - JsExpression constructCall(@Nullable JsExpression receiver, @NotNull CallConstructor constructor, - @NotNull TranslationContext context) { - assert receiver != null; - TemporaryVariable temporaryVariable = context.declareTemporary(receiver); - JsNullLiteral nullLiteral = context.program().getNullLiteral(); - //TODO: find similar not null checks - JsBinaryOperation notNullCheck = AstUtil.notEqual(temporaryVariable.reference(), nullLiteral); - JsConditional callMethodIfNotNullElseNull = - new JsConditional(notNullCheck, constructor.construct(temporaryVariable.reference()), nullLiteral); - return newSequence(temporaryVariable.assignmentExpression(), callMethodIfNotNullElseNull); - } - }, - //TODO: bang qualifier is not implemented in frontend for now - // BANG, - NORMAL { - @NotNull - @Override - JsExpression constructCall(@Nullable JsExpression receiver, @NotNull CallConstructor constructor, - @NotNull TranslationContext context) { - return constructor.construct(receiver); - } - }; - - @NotNull - abstract JsExpression constructCall(@Nullable JsExpression receiver, @NotNull CallConstructor constructor, - @NotNull TranslationContext context); - - @NotNull - public static CallType getCallTypeForQualifiedExpression(@NotNull JetQualifiedExpression expression) { - if (expression instanceof JetSafeQualifiedExpression) { - return SAFE; - } - assert expression instanceof JetDotQualifiedExpression; - return NORMAL; - } - - public interface CallConstructor { - @NotNull - JsExpression construct(@Nullable JsExpression receiver); - } - -} \ No newline at end of file diff --git a/translator/src/org/jetbrains/k2js/translate/reference/KotlinPropertyAccessTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/KotlinPropertyAccessTranslator.java deleted file mode 100644 index fb35e37f667..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/KotlinPropertyAccessTranslator.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertyGetterDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertySetterDescriptor; -import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; -import org.jetbrains.k2js.translate.context.TranslationContext; - -/** - * @author Pavel Talanov - *

- * For properies /w accessors. - */ -public final class KotlinPropertyAccessTranslator extends PropertyAccessTranslator { - - @Nullable - private final JsExpression qualifier; - @NotNull - private final PropertyDescriptor propertyDescriptor; - @NotNull - ResolvedCall resolvedCall; - - //TODO: too many params in constructor - /*package*/ KotlinPropertyAccessTranslator(@NotNull PropertyDescriptor descriptor, - @Nullable JsExpression qualifier, - @NotNull ResolvedCall resolvedCall, - @NotNull TranslationContext context) { - super(context); - this.qualifier = qualifier; - this.propertyDescriptor = descriptor.getOriginal(); - this.resolvedCall = resolvedCall; - } - - @Override - @NotNull - public JsExpression translateAsGet() { - //TODO: check for duplication - PropertyGetterDescriptor getter = propertyDescriptor.getGetter(); - assert getter != null : "Getter for kotlin properties should bot be null."; - return callBuilderForAccessor() - .descriptor(getter) - .translate(); - } - - @Override - @NotNull - public JsExpression translateAsSet(@NotNull JsExpression toSetTo) { - //TODO: check for duplication - PropertySetterDescriptor setter = propertyDescriptor.getSetter(); - assert setter != null : "Getter for kotlin properties should bot be null."; - return callBuilderForAccessor() - .args(toSetTo) - .descriptor(setter) - .translate(); - } - - @NotNull - private CallBuilder callBuilderForAccessor() { - return CallBuilder.build(context()) - .receiver(qualifier) - .resolvedCall(resolvedCall) - .type(getCallType()); - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/NativePropertyAccessTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/NativePropertyAccessTranslator.java deleted file mode 100644 index f6744be776c..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/NativePropertyAccessTranslator.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.utils.TranslationUtils; - -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getExpectedThisDescriptor; - -/** - * @author Pavel Talanov - *

- * For native apis that use .property notation for access. - */ -public final class NativePropertyAccessTranslator extends PropertyAccessTranslator { - - - @Nullable - private final JsExpression qualifier; - @NotNull - private final PropertyDescriptor propertyDescriptor; - - /*package*/ - NativePropertyAccessTranslator(@NotNull PropertyDescriptor descriptor, - @Nullable JsExpression qualifier, - @NotNull TranslationContext context) { - super(context); - this.qualifier = qualifier; - this.propertyDescriptor = descriptor.getOriginal(); - } - - - @Override - @NotNull - public JsExpression translateAsGet() { - JsName nativePropertyName = context().getNameForDescriptor(propertyDescriptor); - JsExpression realQualifier = getQualifier(); - if (realQualifier != null) { - return AstUtil.qualified(nativePropertyName, realQualifier); - } else { - return nativePropertyName.makeRef(); - } - } - - @Override - @NotNull - public JsExpression translateAsSet(@NotNull JsExpression setTo) { - return AstUtil.assignment(translateAsGet(), setTo); - } - - @Nullable - public JsExpression getQualifier() { - if (qualifier != null) { - return qualifier; - } - assert !propertyDescriptor.getReceiverParameter().exists() : "Cant have native extension properties."; - DeclarationDescriptor expectedThisDescriptor = getExpectedThisDescriptor(propertyDescriptor); - if (expectedThisDescriptor == null) { - return null; - } - return TranslationUtils.getThisObject(context(), expectedThisDescriptor); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/PropertyAccessTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/PropertyAccessTranslator.java deleted file mode 100644 index 4de16989916..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/PropertyAccessTranslator.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; -import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.psi.JetQualifiedExpression; -import org.jetbrains.jet.lang.psi.JetSimpleNameExpression; -import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import static org.jetbrains.k2js.translate.utils.AnnotationsUtils.isNativeObject; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getDescriptorForReferenceExpression; -import static org.jetbrains.k2js.translate.utils.BindingUtils.getResolvedCall; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getSelectorAsSimpleName; -import static org.jetbrains.k2js.translate.utils.PsiUtils.isBackingFieldReference; - -/** - * @author Pavel Talanov - */ -public abstract class PropertyAccessTranslator extends AccessTranslator { - - @NotNull - public static PropertyAccessTranslator newInstance(@NotNull PropertyDescriptor descriptor, - @NotNull ResolvedCall resolvedCall, - @NotNull TranslationContext context) { - if (isNativeObject(descriptor)) { - return new NativePropertyAccessTranslator(descriptor, /*qualifier = */ null, context); - } else { - return new KotlinPropertyAccessTranslator(descriptor, /*qualifier = */ null, resolvedCall, context); - } - } - - @NotNull - public static PropertyAccessTranslator newInstance(@NotNull JetSimpleNameExpression expression, - @Nullable JsExpression qualifier, - @NotNull CallType callType, - @NotNull TranslationContext context) { - PropertyAccessTranslator result; - PropertyDescriptor propertyDescriptor = getPropertyDescriptor(expression, context); - if (isNativeObject(propertyDescriptor) || isBackingFieldReference(expression)) { - result = new NativePropertyAccessTranslator(propertyDescriptor, qualifier, context); - } else { - ResolvedCall resolvedCall = getResolvedCall(context.bindingContext(), expression); - result = new KotlinPropertyAccessTranslator(propertyDescriptor, qualifier, resolvedCall, context); - } - result.setCallType(callType); - return result; - } - - @NotNull - /*package*/ static PropertyDescriptor getPropertyDescriptor(@NotNull JetSimpleNameExpression expression, - @NotNull TranslationContext context) { - DeclarationDescriptor descriptor = - getDescriptorForReferenceExpression(context.bindingContext(), expression); - assert descriptor instanceof PropertyDescriptor : "Must be a property descriptor."; - return (PropertyDescriptor) descriptor; - } - - - @NotNull - /*package*/ - static JsExpression translateAsPropertyGetterCall(@NotNull PropertyDescriptor descriptor, - @NotNull ResolvedCall resolvedCall, - @NotNull TranslationContext context) { - return (newInstance(descriptor, resolvedCall, context)) - .translateAsGet(); - } - - @NotNull - public static JsExpression translateAsPropertyGetterCall(@NotNull JetSimpleNameExpression expression, - @Nullable JsExpression qualifier, - @NotNull CallType callType, - @NotNull TranslationContext context) { - return (newInstance(expression, qualifier, callType, context)) - .translateAsGet(); - } - - - public static boolean canBePropertyGetterCall(@NotNull JetQualifiedExpression expression, - @NotNull TranslationContext context) { - JetSimpleNameExpression selector = getSelectorAsSimpleName(expression); - assert selector != null : "Only names are allowed after the dot"; - return canBePropertyGetterCall(selector, context); - } - - public static boolean canBePropertyGetterCall(@NotNull JetSimpleNameExpression expression, - @NotNull TranslationContext context) { - return (getDescriptorForReferenceExpression - (context.bindingContext(), expression) instanceof PropertyDescriptor); - } - - public static boolean canBePropertyGetterCall(@NotNull JetExpression expression, - @NotNull TranslationContext context) { - if (expression instanceof JetQualifiedExpression) { - return canBePropertyGetterCall((JetQualifiedExpression) expression, context); - } - if (expression instanceof JetSimpleNameExpression) { - return canBePropertyGetterCall((JetSimpleNameExpression) expression, context); - } - return false; - } - - public static boolean canBePropertyAccess(@NotNull JetExpression expression, - @NotNull TranslationContext context) { - return canBePropertyGetterCall(expression, context); - } - - //TODO: we use normal by default but may cause bugs - private /*var*/ CallType callType = CallType.NORMAL; - - protected PropertyAccessTranslator(@NotNull TranslationContext context) { - super(context); - } - - public void setCallType(@NotNull CallType callType) { - this.callType = callType; - } - - @NotNull - protected CallType getCallType() { - assert callType != null : "CallType not set"; - return callType; - } -} \ No newline at end of file diff --git a/translator/src/org/jetbrains/k2js/translate/reference/QualifiedExpressionTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/QualifiedExpressionTranslator.java deleted file mode 100644 index be4321a95a0..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/QualifiedExpressionTranslator.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetCallExpression; -import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.psi.JetQualifiedExpression; -import org.jetbrains.jet.lang.psi.JetSimpleNameExpression; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import static org.jetbrains.k2js.translate.general.Translation.translateAsExpression; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getNotNullSimpleNameSelector; -import static org.jetbrains.k2js.translate.utils.PsiUtils.getSelector; - -/** - * @author Pavel Talanov - */ -public final class QualifiedExpressionTranslator { - - private QualifiedExpressionTranslator() { - } - - @NotNull - public static AccessTranslator getAccessTranslator(@NotNull JetQualifiedExpression expression, - @NotNull TranslationContext context) { - - JsExpression receiver = translateReceiver(expression, context); - PropertyAccessTranslator result = - PropertyAccessTranslator.newInstance(getNotNullSimpleNameSelector(expression), receiver, - CallType.getCallTypeForQualifiedExpression(expression), context); - result.setCallType(CallType.getCallTypeForQualifiedExpression(expression)); - return result; - } - - @NotNull - public static JsExpression translateQualifiedExpression(@NotNull JetQualifiedExpression expression, - @NotNull TranslationContext context) { - JsExpression receiver = translateReceiver(expression, context); - JetExpression selector = getSelector(expression); - CallType callType = CallType.getCallTypeForQualifiedExpression(expression); - return dispatchToCorrectTranslator(receiver, selector, callType, context); - } - - @NotNull - private static JsExpression dispatchToCorrectTranslator(@NotNull JsExpression receiver, - @NotNull JetExpression selector, - @NotNull CallType callType, - @NotNull TranslationContext context) { - if (PropertyAccessTranslator.canBePropertyGetterCall(selector, context)) { - assert selector instanceof JetSimpleNameExpression : "Selectors for properties must be simple names."; - return PropertyAccessTranslator.translateAsPropertyGetterCall - ((JetSimpleNameExpression) selector, receiver, callType, context); - } - if (selector instanceof JetCallExpression) { - return CallExpressionTranslator.translate((JetCallExpression) selector, receiver, callType, context); - } - throw new AssertionError("Unexpected qualified expression"); - } - - //TODO: if has duplications - @NotNull - private static JsExpression translateReceiver(@NotNull JetQualifiedExpression expression, - @NotNull TranslationContext context) { - return translateAsExpression(expression.getReceiverExpression(), context); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/ReferenceAccessTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/ReferenceAccessTranslator.java deleted file mode 100644 index a80842e8ec0..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/ReferenceAccessTranslator.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsNameRef; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetSimpleNameExpression; -import org.jetbrains.k2js.translate.context.TranslationContext; - -/** - * @author Pavel Talanov - */ -public final class ReferenceAccessTranslator extends AccessTranslator { - - @NotNull - /*package*/ static ReferenceAccessTranslator newInstance(@NotNull JetSimpleNameExpression expression, - @NotNull TranslationContext context) { - return new ReferenceAccessTranslator(expression, context); - } - - @NotNull - private final JetSimpleNameExpression expression; - - private ReferenceAccessTranslator(@NotNull JetSimpleNameExpression expression, - @NotNull TranslationContext context) { - super(context); - this.expression = expression; - } - - @Override - @NotNull - public JsExpression translateAsGet() { - //TODO: consider evaluating only once - return ReferenceTranslator.translateSimpleName(expression, context()); - } - - @Override - @NotNull - public JsExpression translateAsSet(@NotNull JsExpression toSetTo) { - //TODO: consider evaluating only once - JsExpression reference = ReferenceTranslator.translateSimpleName(expression, context()); - assert reference instanceof JsNameRef; - return AstUtil.newAssignment((JsNameRef) reference, toSetTo); - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/reference/ReferenceTranslator.java b/translator/src/org/jetbrains/k2js/translate/reference/ReferenceTranslator.java deleted file mode 100644 index 34c0f453f54..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/reference/ReferenceTranslator.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.reference; - -import com.google.dart.compiler.backend.js.ast.JsExpression; -import com.google.dart.compiler.backend.js.ast.JsName; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; -import org.jetbrains.jet.lang.psi.JetSimpleNameExpression; -import org.jetbrains.k2js.translate.context.TranslationContext; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.getDescriptorForReferenceExpression; - -/** - * @author Pavel Talanov - */ -public final class ReferenceTranslator { - - @NotNull - public static JsExpression translateSimpleName(@NotNull JetSimpleNameExpression expression, - @NotNull TranslationContext context) { - if (PropertyAccessTranslator.canBePropertyGetterCall(expression, context)) { - return PropertyAccessTranslator.translateAsPropertyGetterCall(expression, null, CallType.NORMAL, context); - } - DeclarationDescriptor referencedDescriptor = - getDescriptorForReferenceExpression(context.bindingContext(), expression); - return translateAsLocalNameReference(referencedDescriptor, context); - } - - @NotNull - public static JsExpression translateAsFQReference(@NotNull DeclarationDescriptor referencedDescriptor, - @NotNull TranslationContext context) { - JsExpression qualifier = context.getQualifierForDescriptor(referencedDescriptor); - if (qualifier == null) { - return translateAsLocalNameReference(referencedDescriptor, context); - } - JsName referencedName = context.getNameForDescriptor(referencedDescriptor); - return AstUtil.qualified(referencedName, qualifier); - } - - @NotNull - public static JsExpression translateAsLocalNameReference(@NotNull DeclarationDescriptor referencedDescriptor, - @NotNull TranslationContext context) { - JsName referencedName = context.getNameForDescriptor(referencedDescriptor); - return referencedName.makeRef(); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/utils/AnnotationsUtils.java b/translator/src/org/jetbrains/k2js/translate/utils/AnnotationsUtils.java deleted file mode 100644 index d169f11ac6e..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/utils/AnnotationsUtils.java +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.utils; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; -import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; -import org.jetbrains.jet.lang.resolve.DescriptorUtils; -import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; - -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getContainingClass; - -/** - * @author Pavel Talanov - */ -public final class AnnotationsUtils { - - @NotNull - public static final String NATIVE_ANNOTATION_FQNAME = "js.native"; - @NotNull - public static final String LIBRARY_ANNOTATION_FQNAME = "js.library"; - - private AnnotationsUtils() { - } - - //TODO: make public, use when necessary - private static boolean hasAnnotation(@NotNull DeclarationDescriptor descriptor, - @NotNull String annotationFQNAme) { - return getAnnotationByName(descriptor, annotationFQNAme) != null; - } - - @NotNull - public static String getAnnotationStringParameter(@NotNull DeclarationDescriptor declarationDescriptor, - @NotNull String annotationFQName) { - AnnotationDescriptor annotationDescriptor = - getAnnotationByName(declarationDescriptor, annotationFQName); - assert annotationDescriptor != null; - //TODO: this is a quick fix for unsupported default args problem - if (annotationDescriptor.getValueArguments().isEmpty()) { - return ""; - } - CompileTimeConstant constant = annotationDescriptor.getValueArguments().iterator().next(); - //TODO: this is a quick fix for unsupported default args problem - if (constant == null) { - return ""; - } - Object value = constant.getValue(); - assert value instanceof String : "Native function annotation should have one String parameter"; - return (String) value; - } - - @Nullable - public static AnnotationDescriptor getAnnotationByName(@NotNull DeclarationDescriptor descriptor, - @NotNull String FQName) { - for (AnnotationDescriptor annotationDescriptor : descriptor.getAnnotations()) { - String annotationClassFQName = getAnnotationClassFQName(annotationDescriptor); - if (annotationClassFQName.equals(FQName)) { - return annotationDescriptor; - } - } - return null; - } - - @NotNull - private static String getAnnotationClassFQName(@NotNull AnnotationDescriptor annotationDescriptor) { - DeclarationDescriptor annotationDeclaration = - annotationDescriptor.getType().getConstructor().getDeclarationDescriptor(); - assert annotationDeclaration != null : "Annotation supposed to have a declaration"; - return DescriptorUtils.getFQName(annotationDeclaration); - } - - public static boolean isNativeObject(@NotNull DeclarationDescriptor descriptor) { - return hasAnnotationOrInsideAnnotatedClass(descriptor, NATIVE_ANNOTATION_FQNAME); - } - - public static boolean isLibraryObject(@NotNull DeclarationDescriptor descriptor) { - return hasAnnotationOrInsideAnnotatedClass(descriptor, LIBRARY_ANNOTATION_FQNAME); - } - - //TODO: the use of this method is splattered across the code which can be hard to track - public static boolean isPredefinedObject(@NotNull DeclarationDescriptor descriptor) { - return isLibraryObject(descriptor) || isNativeObject(descriptor); - } - - private static boolean hasAnnotationOrInsideAnnotatedClass(DeclarationDescriptor descriptor, String annotationFQName) { - if (getAnnotationByName(descriptor, annotationFQName) != null) { - return true; - } - ClassDescriptor containingClass = getContainingClass(descriptor); - if (containingClass == null) { - return false; - } - return (getAnnotationByName(containingClass, annotationFQName) != null); - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/utils/BindingUtils.java b/translator/src/org/jetbrains/k2js/translate/utils/BindingUtils.java deleted file mode 100644 index 636d0e6b9ff..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/utils/BindingUtils.java +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.utils; - -import com.google.common.collect.Sets; -import com.intellij.psi.PsiElement; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.calls.ResolvedCall; -import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; -import org.jetbrains.jet.lang.types.JetStandardClasses; -import org.jetbrains.jet.lang.types.JetType; - -import java.util.ArrayList; -import java.util.List; -import java.util.Set; - -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.*; - -/** - * @author Pavel Talanov - *

- * This class contains some code related to BindingContext use. Intention is not to pollute other classes. - * Every call to BindingContext.get() is supposed to be wrapped by this utility class. - */ -public final class BindingUtils { - - private BindingUtils() { - } - - @NotNull - static private - D getDescriptorForExpression(@NotNull BindingContext context, @NotNull E expression, Class descriptorClass) { - DeclarationDescriptor descriptor = context.get(BindingContext.DECLARATION_TO_DESCRIPTOR, expression); - assert descriptor != null; - assert descriptorClass.isInstance(descriptor) - : expression.toString() + " expected to have of type" + descriptorClass.toString(); - //noinspection unchecked - return (D) descriptor; - } - - @NotNull - public static ClassDescriptor getClassDescriptor(@NotNull BindingContext context, - @NotNull JetClassOrObject declaration) { - return getDescriptorForExpression(context, declaration, ClassDescriptor.class); - } - - @NotNull - public static NamespaceDescriptor getNamespaceDescriptor(@NotNull BindingContext context, - @NotNull JetFile declaration) { - NamespaceDescriptor namespaceDescriptor = - context.get(BindingContext.FQNAME_TO_NAMESPACE_DESCRIPTOR, JetPsiUtil.getFQName(declaration)); - assert namespaceDescriptor != null : "File should have a namespace descriptor."; - return namespaceDescriptor; - } - - @NotNull - public static FunctionDescriptor getFunctionDescriptor(@NotNull BindingContext context, - @NotNull JetDeclarationWithBody declaration) { - return getDescriptorForExpression(context, declaration, FunctionDescriptor.class); - } - - //TODO: - @NotNull - public static PropertyAccessorDescriptor getPropertyAccessorDescriptor(@NotNull BindingContext context, - @NotNull JetPropertyAccessor declaration) { - return getDescriptorForExpression(context, declaration, PropertyAccessorDescriptor.class); - } - - @NotNull - public static PropertyDescriptor getPropertyDescriptor(@NotNull BindingContext context, - @NotNull JetProperty declaration) { - return getDescriptorForExpression(context, declaration, PropertyDescriptor.class); - } - - @NotNull - public static JetClass getClassForDescriptor(@NotNull BindingContext context, - @NotNull ClassDescriptor descriptor) { - PsiElement result = context.get(BindingContext.DESCRIPTOR_TO_DECLARATION, descriptor); - assert result instanceof JetClass : "ClassDescriptor should have declaration of type JetClass"; - return (JetClass) result; - } - - @NotNull - public static List getDeclarationsForNamespace(@NotNull BindingContext bindingContext, - @NotNull NamespaceDescriptor namespace) { - List declarations = new ArrayList(); - for (DeclarationDescriptor descriptor : namespace.getMemberScope().getAllDescriptors()) { - if (AnnotationsUtils.isPredefinedObject(descriptor)) { - continue; - } - //TODO: - if (descriptor instanceof NamespaceDescriptor) { - continue; - } - JetDeclaration declaration = BindingUtils.getDeclarationForDescriptor(bindingContext, descriptor); - if (declaration != null) { - declarations.add(declaration); - } - } - return declarations; - } - - @Nullable - private static JetDeclaration getDeclarationForDescriptor(@NotNull BindingContext context, - @NotNull DeclarationDescriptor descriptor) { - PsiElement result = context.get(BindingContext.DESCRIPTOR_TO_DECLARATION, descriptor); - if (result == null) { - //TODO: never get there - return null; - } - assert result instanceof JetDeclaration : "Descriptor should correspond to an element."; - return (JetDeclaration) result; - } - - @NotNull - private static JetParameter getParameterForDescriptor(@NotNull BindingContext context, - @NotNull ValueParameterDescriptor descriptor) { - PsiElement result = context.get(BindingContext.DESCRIPTOR_TO_DECLARATION, descriptor); - assert result instanceof JetParameter : "ValueParameterDescriptor should have corresponding JetParameter."; - return (JetParameter) result; - } - - public static boolean hasAncestorClass(@NotNull BindingContext context, @NotNull JetClassOrObject classDeclaration) { - ClassDescriptor classDescriptor = getClassDescriptor(context, classDeclaration); - List superclassDescriptors = getSuperclassDescriptors(classDescriptor); - return (DescriptorUtils.findAncestorClass(superclassDescriptors) != null); - } - - public static boolean isStatement(@NotNull BindingContext context, @NotNull JetExpression expression) { - Boolean isStatement = context.get(BindingContext.STATEMENT, expression); - assert isStatement != null : "Invalid behaviour of get(BindingContext.STATEMENT)"; - return isStatement; - // return IsStatement.isStatement(expression); - } - - @NotNull - public static JetType getTypeByReference(@NotNull BindingContext context, - @NotNull JetTypeReference typeReference) { - JetType result = context.get(BindingContext.TYPE, typeReference); - assert result != null : "TypeReference should reference a type"; - return result; - } - - @NotNull - public static ClassDescriptor getClassDescriptorForTypeReference(@NotNull BindingContext context, - @NotNull JetTypeReference typeReference) { - return getClassDescriptorForType(getTypeByReference(context, typeReference)); - } - - @Nullable - public static PropertyDescriptor getPropertyDescriptorForConstructorParameter(@NotNull BindingContext context, - @NotNull JetParameter parameter) { - return context.get(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, parameter); - } - - @Nullable - public static JetProperty getPropertyForDescriptor(@NotNull BindingContext context, - @NotNull PropertyDescriptor property) { - PsiElement result = context.get(BindingContext.DESCRIPTOR_TO_DECLARATION, property); - if (!(result instanceof JetProperty)) { - return null; - } - return (JetProperty) result; - } - - @NotNull - public static DeclarationDescriptor getDescriptorForReferenceExpression(@NotNull BindingContext context, - @NotNull JetReferenceExpression reference) { - DeclarationDescriptor referencedDescriptor = getNullableDescriptorForReferenceExpression(context, reference); - assert referencedDescriptor != null : "Reference expression must reference a descriptor."; - return referencedDescriptor; - } - - @Nullable - private static DeclarationDescriptor getNullableDescriptorForReferenceExpression(@NotNull BindingContext context, - @NotNull JetReferenceExpression reference) { - DeclarationDescriptor referencedDescriptor = context.get(BindingContext.REFERENCE_TARGET, reference); - if (isVariableAsFunction(referencedDescriptor)) { - assert referencedDescriptor != null; - return getVariableDescriptorForVariableAsFunction((VariableAsFunctionDescriptor) referencedDescriptor); - } - return referencedDescriptor; - } - - public static boolean isNotAny(@NotNull DeclarationDescriptor superClassDescriptor) { - return !superClassDescriptor.equals(JetStandardClasses.getAny()); - } - - - //TODO: check where we use there, suspicious - public static boolean isOwnedByNamespace(@NotNull DeclarationDescriptor descriptor) { - if (descriptor instanceof ConstructorDescriptor) { - DeclarationDescriptor classDescriptor = descriptor.getContainingDeclaration(); - assert classDescriptor != null; - return isOwnedByNamespace(classDescriptor); - } - return (descriptor.getContainingDeclaration() instanceof NamespaceDescriptor); - } - - public static boolean isOwnedByClass(@NotNull DeclarationDescriptor descriptor) { - if (descriptor instanceof ConstructorDescriptor) { - DeclarationDescriptor classDescriptor = descriptor.getContainingDeclaration(); - assert classDescriptor != null; - return isOwnedByClass(classDescriptor); - } - return (descriptor.getContainingDeclaration() instanceof ClassDescriptor); - } - - @NotNull - public static ResolvedCall getResolvedCall(@NotNull BindingContext context, - @NotNull JetExpression expression) { - ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, expression); - assert resolvedCall != null : "Must resolve to a call."; - return resolvedCall; - } - - @NotNull - public static ResolvedCall getResolvedCallForCallExpression(@NotNull BindingContext context, - @NotNull JetCallExpression expression) { - JetExpression calleeExpression = PsiUtils.getCallee(expression); - return getResolvedCall(context, calleeExpression); - } - - public static boolean isVariableReassignment(@NotNull BindingContext context, @NotNull JetExpression expression) { - Boolean result = context.get(BindingContext.VARIABLE_REASSIGNMENT, expression); - assert result != null; - return result; - } - - - @Nullable - public static FunctionDescriptor getFunctionDescriptorForOperationExpression(@NotNull BindingContext context, - @NotNull JetOperationExpression expression) { - DeclarationDescriptor descriptorForReferenceExpression = getNullableDescriptorForReferenceExpression - (context, expression.getOperationReference()); - - if (descriptorForReferenceExpression == null) return null; - - assert descriptorForReferenceExpression instanceof FunctionDescriptor - : "Operation should resolve to function descriptor."; - return (FunctionDescriptor) descriptorForReferenceExpression; - } - - @NotNull - public static DeclarationDescriptor getDescriptorForElement(@NotNull BindingContext context, - @NotNull PsiElement element) { - DeclarationDescriptor descriptor = context.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element); - assert descriptor != null : element + " doesn't have a descriptor."; - return descriptor; - } - - @Nullable - public static Object getCompileTimeValue(@NotNull BindingContext context, @NotNull JetExpression expression) { - CompileTimeConstant compileTimeValue = context.get(BindingContext.COMPILE_TIME_VALUE, expression); - if (compileTimeValue != null) { - return compileTimeValue.getValue(); - } - return null; - } - - @NotNull - public static JetExpression getDefaultArgument(@NotNull BindingContext context, - @NotNull ValueParameterDescriptor parameterDescriptor) { - assert parameterDescriptor.hasDefaultValue() : "Unsupplied parameter must have default value."; - JetParameter psiParameter = getParameterForDescriptor(context, parameterDescriptor); - JetExpression defaultValue = psiParameter.getDefaultValue(); - assert defaultValue != null : "No default value found in PSI."; - return defaultValue; - } - - @NotNull - public static FunctionDescriptor getIteratorFunction(@NotNull BindingContext context, - @NotNull JetExpression rangeExpression) { - FunctionDescriptor functionDescriptor = context.get(BindingContext.LOOP_RANGE_ITERATOR, rangeExpression); - assert functionDescriptor != null : "Range expression must have a descriptor for iterator function."; - return functionDescriptor; - } - - @NotNull - public static FunctionDescriptor getNextFunction(@NotNull BindingContext context, - @NotNull JetExpression rangeExpression) { - FunctionDescriptor functionDescriptor = context.get(BindingContext.LOOP_RANGE_NEXT, rangeExpression); - assert functionDescriptor != null : "Range expression must have a descriptor for next function."; - return functionDescriptor; - } - - @NotNull - public static CallableDescriptor getHasNextCallable(@NotNull BindingContext context, - @NotNull JetExpression rangeExpression) { - CallableDescriptor hasNextDescriptor = context.get(BindingContext.LOOP_RANGE_HAS_NEXT, rangeExpression); - assert hasNextDescriptor != null : "Range expression must have a descriptor for hasNext function or property."; - return hasNextDescriptor; - } - - @NotNull - public static PropertyDescriptor getPropertyDescriptorForObjectDeclaration(@NotNull BindingContext context, - @NotNull JetObjectDeclarationName name) { - PropertyDescriptor propertyDescriptor = context.get(BindingContext.OBJECT_DECLARATION, name); - assert propertyDescriptor != null; - return propertyDescriptor; - } - - @NotNull - public static Set getAllNonNativeNamespaceDescriptors(@NotNull BindingContext context, - @NotNull List files) { - Set descriptorSet = Sets.newHashSet(); - for (JetFile file : files) { - NamespaceDescriptor namespaceDescriptor = getNamespaceDescriptor(context, file); - if (!AnnotationsUtils.isPredefinedObject(namespaceDescriptor)) { - descriptorSet.add(namespaceDescriptor); - } - } - return descriptorSet; - } - - @NotNull - public static JetType getTypeForExpression(@NotNull BindingContext context, - @NotNull JetExpression expression) { - JetType type = context.get(BindingContext.EXPRESSION_TYPE, expression); - assert type != null; - return type; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/utils/ClassSorter.java b/translator/src/org/jetbrains/k2js/translate/utils/ClassSorter.java deleted file mode 100644 index 2ad048cd13c..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/utils/ClassSorter.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.utils; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.psi.JetClass; -import org.jetbrains.jet.lang.resolve.BindingContext; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getSuperclassDescriptors; - - -//TODO: can optimise using less dumb implementation -//TODO: pass list of descriptors here, not the list of jet classes - -/** - * @author Pavel Talanov - */ -public final class ClassSorter { - - @NotNull - private final List descriptorList; - @NotNull - private final List classesWithNoAncestors; - @NotNull - private final Map classWasInheritedCount = new HashMap(); - @NotNull - private final BindingContext bindingContext; - - @NotNull - public static List sortUsingInheritanceOrder(@NotNull List original, - @NotNull BindingContext bindingContext) { - ClassSorter sorter = new ClassSorter(original, bindingContext); - return sorter.sortUsingInheritanceOrder(); - } - - private ClassSorter(@NotNull List original, @NotNull BindingContext bindingContext) { - this.bindingContext = bindingContext; - this.descriptorList = getDescriptorList(original); - this.classesWithNoAncestors = new ArrayList(descriptorList); - setInitialCount(); - } - - @NotNull - private List sortUsingInheritanceOrder() { - List sortedClasses = new ArrayList(); - while (!classesWithNoAncestors.isEmpty()) { - ClassDescriptor classDescriptor = getNextClass(); - sortedClasses.add(BindingUtils.getClassForDescriptor(bindingContext, classDescriptor)); - } - assert sortedClasses.size() == descriptorList.size(); - return sortedClasses; - } - - @NotNull - private ClassDescriptor getNextClass() { - ClassDescriptor result = popFromList(); - decreaseCountForDerivedClasses(result); - classWasInheritedCount.remove(result); - return result; - } - - private void decreaseCountForDerivedClasses(@NotNull ClassDescriptor result) { - for (ClassDescriptor derived : descriptorList) { - if (isDerivedClass(result, derived)) { - decreaseCountForDerivedClass(derived); - } - } - } - - private void decreaseCountForDerivedClass(@NotNull ClassDescriptor derived) { - Integer timesInherited = classWasInheritedCount.get(derived); - assert timesInherited != null; - assert timesInherited > 0; - int newCount = timesInherited - 1; - classWasInheritedCount.put(derived, newCount); - if (newCount == 0) { - classesWithNoAncestors.add(derived); - } - } - - private boolean isDerivedClass(@NotNull ClassDescriptor ancestor, @NotNull ClassDescriptor derived) { - return (getSuperclassDescriptors(derived).contains(ancestor)); - } - - @NotNull - private ClassDescriptor popFromList() { - assert !classesWithNoAncestors.isEmpty(); - ClassDescriptor result = classesWithNoAncestors.get(classesWithNoAncestors.size() - 1); - ClassDescriptor removed = classesWithNoAncestors.remove(classesWithNoAncestors.size() - 1); - assert removed != null; - return result; - } - - - @NotNull - private List getDescriptorList(@NotNull List classesToSort) { - List descriptorList = new ArrayList(); - for (JetClass jetClass : classesToSort) { - descriptorList.add(BindingUtils.getClassDescriptor(bindingContext, jetClass)); - } - return descriptorList; - } - - private void setInitialCount() { - for (ClassDescriptor descriptor : descriptorList) { - List superclasses = getSuperclassDescriptors(descriptor); - int count = 0; - for (ClassDescriptor superclassDescriptor : superclasses) { - if (descriptorList.contains(superclassDescriptor)) { - count++; - } - } - classWasInheritedCount.put(descriptor, superclasses.size()); - if (count > 0) { - boolean success = classesWithNoAncestors.remove(descriptor); - assert success; - } - } - } - -} diff --git a/translator/src/org/jetbrains/k2js/translate/utils/DescriptorUtils.java b/translator/src/org/jetbrains/k2js/translate/utils/DescriptorUtils.java deleted file mode 100644 index 19fc3588871..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/utils/DescriptorUtils.java +++ /dev/null @@ -1,222 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.utils; - -import com.google.common.collect.Lists; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.resolve.scopes.JetScope; -import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor; -import org.jetbrains.jet.lang.types.JetType; -import org.jetbrains.jet.lang.types.expressions.OperatorConventions; -import org.jetbrains.k2js.translate.context.Namer; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import java.util.Set; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.isNotAny; - -/** - * @author Pavel Talanov - */ -public final class DescriptorUtils { - - private DescriptorUtils() { - } - - private static int valueParametersCount(@NotNull FunctionDescriptor functionDescriptor) { - return functionDescriptor.getValueParameters().size(); - } - - public static boolean hasParameters(@NotNull FunctionDescriptor functionDescriptor) { - return (valueParametersCount(functionDescriptor) > 0); - } - - public static boolean isEquals(@NotNull FunctionDescriptor functionDescriptor) { - return (functionDescriptor.getName().equals(OperatorConventions.EQUALS)); - } - - public static boolean isCompareTo(@NotNull FunctionDescriptor functionDescriptor) { - return (functionDescriptor.getName().equals(OperatorConventions.COMPARE_TO)); - } - - public static boolean isConstructorDescriptor(@NotNull CallableDescriptor descriptor) { - return (descriptor instanceof ConstructorDescriptor); - } - - @NotNull - public static FunctionDescriptor getFunctionByName(@NotNull JetScope scope, - @NotNull String name) { - Set functionDescriptors = scope.getFunctions(name); - assert functionDescriptors.size() == 1 : - "In scope " + scope + " supposed to be exactly one " + name + " function.\n" + - "Found: " + functionDescriptors.size(); - //noinspection LoopStatementThatDoesntLoop - for (FunctionDescriptor descriptor : functionDescriptors) { - return descriptor; - } - throw new AssertionError("In scope " + scope - + " supposed to be exactly one " + name + " function."); - } - - //TODO: some stange stuff happening to this method - @NotNull - public static PropertyDescriptor getPropertyByName(@NotNull JetScope scope, - @NotNull String name) { - VariableDescriptor variable = scope.getLocalVariable(name); - if (variable == null) { - variable = scope.getPropertyByFieldReference("$" + name); - } - Set variables = scope.getProperties(name); - assert variables.size() == 1 : "Actual size: " + variables.size(); - variable = variables.iterator().next(); - PropertyDescriptor descriptor = (PropertyDescriptor) variable; - assert descriptor != null : "Must have a descriptor."; - return descriptor; - } - - @Nullable - public static ClassDescriptor findAncestorClass(@NotNull List superclassDescriptors) { - for (ClassDescriptor descriptor : superclassDescriptors) { - if (descriptor.getKind() == ClassKind.CLASS) { - return descriptor; - } - } - return null; - } - - @NotNull - public static List getSuperclassDescriptors(@NotNull ClassDescriptor classDescriptor) { - Collection superclassTypes = classDescriptor.getTypeConstructor().getSupertypes(); - List superClassDescriptors = new ArrayList(); - for (JetType type : superclassTypes) { - ClassDescriptor result = getClassDescriptorForType(type); - if (isNotAny(result)) { - superClassDescriptors.add(result); - } - } - return superClassDescriptors; - } - - @Nullable - public static ClassDescriptor getSuperclass(@NotNull ClassDescriptor classDescriptor) { - return findAncestorClass(getSuperclassDescriptors(classDescriptor)); - } - - @NotNull - public static ClassDescriptor getClassDescriptorForType(@NotNull JetType type) { - DeclarationDescriptor superClassDescriptor = - type.getConstructor().getDeclarationDescriptor(); - assert superClassDescriptor instanceof ClassDescriptor - : "Superclass descriptor of a type should be of type ClassDescriptor"; - return (ClassDescriptor) superClassDescriptor; - } - - @NotNull - public static VariableDescriptor getVariableDescriptorForVariableAsFunction - (@NotNull VariableAsFunctionDescriptor descriptor) { - VariableDescriptor functionVariable = descriptor.getVariableDescriptor(); - assert functionVariable != null; - return functionVariable; - } - - - public static boolean isVariableAsFunction(@Nullable DeclarationDescriptor referencedDescriptor) { - return referencedDescriptor instanceof VariableAsFunctionDescriptor; - } - - @NotNull - public static DeclarationDescriptor getContainingDeclaration(@NotNull DeclarationDescriptor descriptor) { - DeclarationDescriptor containing = descriptor.getContainingDeclaration(); - assert containing != null : "Should be called on objects that have containing declaration."; - return containing; - } - - public static boolean isExtensionFunction(@NotNull CallableDescriptor functionDescriptor) { - return (functionDescriptor.getReceiverParameter().exists()); - } - - @NotNull - public static String getNameForNamespace(@NotNull NamespaceDescriptor descriptor) { - String name = descriptor.getName(); - if (name.equals("")) { - return Namer.getAnonymousNamespaceName(); - } - return name; - } - - //TODO: why callable descriptor - @Nullable - public static DeclarationDescriptor getExpectedThisDescriptor(@NotNull CallableDescriptor callableDescriptor) { - ReceiverDescriptor expectedThisObject = callableDescriptor.getExpectedThisObject(); - if (!expectedThisObject.exists()) { - return null; - } - return getDeclarationDescriptorForReceiver(expectedThisObject); - } - - @NotNull - public static DeclarationDescriptor getDeclarationDescriptorForReceiver - (@NotNull ReceiverDescriptor receiverParameter) { - DeclarationDescriptor declarationDescriptor = - receiverParameter.getType().getConstructor().getDeclarationDescriptor(); - //TODO: WHY assert? - assert declarationDescriptor != null; - return declarationDescriptor.getOriginal(); - } - - @Nullable - public static DeclarationDescriptor getExpectedReceiverDescriptor(@NotNull CallableDescriptor callableDescriptor) { - ReceiverDescriptor receiverParameter = callableDescriptor.getReceiverParameter(); - if (!receiverParameter.exists()) { - return null; - } - return getDeclarationDescriptorForReceiver(receiverParameter); - } - - //TODO: maybe we have similar routine - @Nullable - public static ClassDescriptor getContainingClass(@NotNull DeclarationDescriptor descriptor) { - DeclarationDescriptor containing = descriptor.getContainingDeclaration(); - while (containing != null) { - if (containing instanceof ClassDescriptor) { - return (ClassDescriptor) containing; - } - containing = containing.getContainingDeclaration(); - } - return null; - } - - @NotNull - public static List getAllClassesDefinedInNamespace(@NotNull NamespaceDescriptor namespaceDescriptor) { - List classDescriptors = Lists.newArrayList(); - for (DeclarationDescriptor descriptor : namespaceDescriptor.getMemberScope().getAllDescriptors()) { - if (AnnotationsUtils.isPredefinedObject(descriptor)) { - continue; - } - if (descriptor instanceof ClassDescriptor) { - classDescriptors.add((ClassDescriptor) descriptor); - } - } - return classDescriptors; - } - - -} diff --git a/translator/src/org/jetbrains/k2js/translate/utils/PsiUtils.java b/translator/src/org/jetbrains/k2js/translate/utils/PsiUtils.java deleted file mode 100644 index 1625d013acb..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/utils/PsiUtils.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.utils; - -import com.intellij.psi.PsiElement; -import com.intellij.psi.tree.IElementType; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.jet.lexer.JetToken; -import org.jetbrains.jet.lexer.JetTokens; -import org.jetbrains.k2js.translate.context.Namer; - -import java.util.Collections; -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class PsiUtils { - - private PsiUtils() { - } - - @Nullable - public static JetSimpleNameExpression getSelectorAsSimpleName(@NotNull JetQualifiedExpression expression) { - JetExpression selectorExpression = getSelector(expression); - if (!(selectorExpression instanceof JetSimpleNameExpression)) { - return null; - } - return (JetSimpleNameExpression) selectorExpression; - } - - @NotNull - public static JetExpression getSelector(@NotNull JetQualifiedExpression expression) { - JetExpression selectorExpression = expression.getSelectorExpression(); - assert selectorExpression != null : "Selector should not be null."; - return selectorExpression; - } - - @NotNull - public static JetSimpleNameExpression getNotNullSimpleNameSelector(@NotNull JetQualifiedExpression expression) { - JetSimpleNameExpression selectorAsSimpleName = getSelectorAsSimpleName(expression); - assert selectorAsSimpleName != null; - return selectorAsSimpleName; - } - - @NotNull - public static JetToken getOperationToken(@NotNull JetOperationExpression expression) { - JetSimpleNameExpression operationExpression = expression.getOperationReference(); - IElementType elementType = operationExpression.getReferencedNameElementType(); - assert elementType instanceof JetToken : "Unary expression should have operation token of type JetToken"; - return (JetToken) elementType; - } - - @NotNull - public static JetExpression getBaseExpression(@NotNull JetUnaryExpression expression) { - JetExpression baseExpression = expression.getBaseExpression(); - assert baseExpression != null; - return baseExpression; - } - - public static boolean isPrefix(@NotNull JetUnaryExpression expression) { - return (expression instanceof JetPrefixExpression); - } - - public static boolean isAssignment(JetToken token) { - return (token == JetTokens.EQ); - } - - public static boolean isBackingFieldReference(@NotNull JetSimpleNameExpression expression) { - return expression.getReferencedNameElementType() == JetTokens.FIELD_IDENTIFIER; - } - - public static boolean isInOrNotInOperation(@NotNull JetBinaryExpression binaryExpression) { - return isInOperation(binaryExpression) || isNotInOperation(binaryExpression); - } - - public static boolean isNotInOperation(@NotNull JetBinaryExpression binaryExpression) { - return (binaryExpression.getOperationToken() == JetTokens.NOT_IN); - } - - private static boolean isInOperation(@NotNull JetBinaryExpression binaryExpression) { - return (binaryExpression.getOperationToken() == JetTokens.IN_KEYWORD); - } - - @NotNull - public static JetExpression getCallee(@NotNull JetCallExpression expression) { - JetExpression calleeExpression = expression.getCalleeExpression(); - assert calleeExpression != null; - return calleeExpression; - } - - @NotNull - public static JetExpression getLoopBody(@NotNull JetLoopExpression expression) { - JetExpression body = expression.getBody(); - assert body != null : "Loops cannot have null bodies."; - return body; - } - - @NotNull - public static JetParameter getLoopParameter(@NotNull JetForExpression expression) { - JetParameter loopParameter = expression.getLoopParameter(); - assert loopParameter != null; - return loopParameter; - } - - @NotNull - public static List getPrimaryConstructorParameters(@NotNull JetClassOrObject classDeclaration) { - if (classDeclaration instanceof JetClass) { - return ((JetClass) classDeclaration).getPrimaryConstructorParameters(); - } - return Collections.emptyList(); - } - - @NotNull - public static JetObjectDeclaration getObjectDeclarationForName(@NotNull JetObjectDeclarationName name) { - PsiElement parent = name.getParent(); - assert parent instanceof JetObjectDeclaration : - "ObjectDeclarationName should have a parent of type ObjectDeclaration."; - return (JetObjectDeclaration) parent; - } - - @NotNull - public static JetObjectDeclarationName getObjectDeclarationName(@NotNull JetObjectDeclaration objectDeclaration) { - //TODO: util - JetObjectDeclarationName nameAsDeclaration = objectDeclaration.getNameAsDeclaration(); - assert nameAsDeclaration != null; - return nameAsDeclaration; - } - - @NotNull - public static String getNamespaceName(@NotNull JetFile psiFile) { - JetNamespaceHeader namespaceHeader = psiFile.getNamespaceHeader(); - String name = namespaceHeader.getName(); - assert name != null : "NamespaceHeader must have a name"; - if (name.equals("")) { - return Namer.getAnonymousNamespaceName(); - } - return name; - } - - @NotNull - public static JetExpression getLoopRange(@NotNull JetForExpression expression) { - JetExpression rangeExpression = expression.getLoopRange(); - assert rangeExpression != null; - return rangeExpression; - } -} diff --git a/translator/src/org/jetbrains/k2js/translate/utils/TranslationUtils.java b/translator/src/org/jetbrains/k2js/translate/utils/TranslationUtils.java deleted file mode 100644 index d0832046e8e..00000000000 --- a/translator/src/org/jetbrains/k2js/translate/utils/TranslationUtils.java +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.translate.utils; - -import com.google.dart.compiler.backend.js.ast.*; -import com.google.dart.compiler.util.AstUtil; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.*; -import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.k2js.translate.context.NamingScope; -import org.jetbrains.k2js.translate.context.TemporaryVariable; -import org.jetbrains.k2js.translate.context.TranslationContext; -import org.jetbrains.k2js.translate.general.Translation; - -import java.util.ArrayList; -import java.util.List; - -import static org.jetbrains.k2js.translate.utils.BindingUtils.*; -import static org.jetbrains.k2js.translate.utils.DescriptorUtils.getExpectedReceiverDescriptor; - -/** - * @author Pavel Talanov - */ -public final class TranslationUtils { - - @NotNull - public static JsBinaryOperation notNullCheck(@NotNull TranslationContext context, - @NotNull JsExpression expressionToCheck) { - JsNullLiteral nullLiteral = context.program().getNullLiteral(); - return AstUtil.notEqual(expressionToCheck, nullLiteral); - } - - @NotNull - public static JsBinaryOperation isNullCheck(@NotNull TranslationContext context, - @NotNull JsExpression expressionToCheck) { - JsNullLiteral nullLiteral = context.program().getNullLiteral(); - return AstUtil.equals(expressionToCheck, nullLiteral); - } - - @NotNull - public static List translateArgumentList(@NotNull TranslationContext context, - @NotNull List jetArguments) { - List jsArguments = new ArrayList(); - for (ValueArgument argument : jetArguments) { - jsArguments.add(translateArgument(context, argument)); - } - return jsArguments; - } - - @NotNull - private static JsExpression translateArgument(@NotNull TranslationContext context, @NotNull ValueArgument argument) { - JetExpression jetExpression = argument.getArgumentExpression(); - assert jetExpression != null : "Argument with no expression"; - return Translation.translateAsExpression(jetExpression, context); - } - - //TODO: refactor backing field reference generation to use the generic way - @NotNull - public static JsNameRef backingFieldReference(@NotNull TranslationContext context, - @NotNull JetProperty expression) { - PropertyDescriptor propertyDescriptor = getPropertyDescriptor(context.bindingContext(), expression); - return backingFieldReference(context, propertyDescriptor); - } - - @NotNull - public static JsNameRef backingFieldReference(@NotNull TranslationContext context, - @NotNull PropertyDescriptor descriptor) { - JsName backingFieldName = context.getNameForDescriptor(descriptor); - if (isOwnedByClass(descriptor)) { - return AstUtil.qualified(backingFieldName, new JsThisRef()); - } - assert isOwnedByNamespace(descriptor) - : "Only classes and namespaces may own backing fields."; - JsNameRef qualifier = context.getQualifierForDescriptor(descriptor); - return AstUtil.qualified(backingFieldName, qualifier); - } - - @NotNull - public static JsStatement assignmentToBackingField(@NotNull TranslationContext context, - @NotNull PropertyDescriptor descriptor, - @NotNull JsExpression assignTo) { - JsNameRef backingFieldReference = backingFieldReference(context, descriptor); - return AstUtil.newAssignmentStatement(backingFieldReference, assignTo); - } - - @Nullable - public static JsExpression translateInitializerForProperty(@NotNull JetProperty declaration, - @NotNull TranslationContext context) { - JsExpression jsInitExpression = null; - JetExpression initializer = declaration.getInitializer(); - if (initializer != null) { - jsInitExpression = Translation.translateAsExpression(initializer, context); - } - return jsInitExpression; - } - - @NotNull - public static JsNameRef getQualifiedReference(@NotNull TranslationContext context, - @NotNull DeclarationDescriptor descriptor) { - JsName name = context.getNameForDescriptor(descriptor); - JsNameRef reference = name.makeRef(); - JsNameRef qualifier = context.getQualifierForDescriptor(descriptor); - if (qualifier != null) { - AstUtil.setQualifier(reference, qualifier); - } - return reference; - } - - //TODO: refactor - @NotNull - public static JsExpression getThisObject(@NotNull TranslationContext context, - @NotNull DeclarationDescriptor correspondingDeclaration) { - JsExpression thisRef = null; - if (correspondingDeclaration instanceof ClassDescriptor) { - if (context.aliaser().hasAliasForThis(correspondingDeclaration)) { - thisRef = context.aliaser().getAliasForThis(correspondingDeclaration); - } - } - if (correspondingDeclaration instanceof CallableDescriptor) { - DeclarationDescriptor receiverDescriptor = - getExpectedReceiverDescriptor((CallableDescriptor) correspondingDeclaration); - assert receiverDescriptor != null; - if (context.aliaser().hasAliasForThis(receiverDescriptor)) { - thisRef = context.aliaser().getAliasForThis(receiverDescriptor); - } - } - if (thisRef != null) { - return thisRef; - } - return new JsThisRef(); - } - - @NotNull - public static List translateExpressionList(@NotNull TranslationContext context, - @NotNull List expressions) { - List result = new ArrayList(); - for (JetExpression expression : expressions) { - result.add(Translation.translateAsExpression(expression, context)); - } - return result; - } - - @NotNull - public static JsExpression translateBaseExpression(@NotNull TranslationContext context, - @NotNull JetUnaryExpression expression) { - JetExpression baseExpression = PsiUtils.getBaseExpression(expression); - return Translation.translateAsExpression(baseExpression, context); - } - - //TODO: - @NotNull - public static JsExpression translateReceiver(@NotNull TranslationContext context, - @NotNull JetDotQualifiedExpression expression) { - return Translation.translateAsExpression(expression.getReceiverExpression(), context); - } - - - @NotNull - public static JsExpression translateLeftExpression(@NotNull TranslationContext context, - @NotNull JetBinaryExpression expression) { - return Translation.translateAsExpression(expression.getLeft(), context); - } - - @NotNull - public static JsExpression translateRightExpression(@NotNull TranslationContext context, - @NotNull JetBinaryExpression expression) { - JetExpression rightExpression = expression.getRight(); - assert rightExpression != null : "Binary expression should have a right expression"; - return Translation.translateAsExpression(rightExpression, context); - } - - public static boolean isIntrinsicOperation(@NotNull TranslationContext context, - @NotNull JetOperationExpression expression) { - FunctionDescriptor operationDescriptor = - BindingUtils.getFunctionDescriptorForOperationExpression(context.bindingContext(), expression); - - if (operationDescriptor == null) return true; - if (context.intrinsics().isIntrinsic(operationDescriptor)) return true; - - return false; - } - - @NotNull - public static JsNameRef getMethodReferenceForOverloadedOperation(@NotNull TranslationContext context, - @NotNull JetOperationExpression expression) { - FunctionDescriptor overloadedOperationDescriptor = getFunctionDescriptorForOperationExpression - (context.bindingContext(), expression); - assert overloadedOperationDescriptor != null; - JsNameRef overloadedOperationReference = context.getNameForDescriptor(overloadedOperationDescriptor).makeRef(); - assert overloadedOperationReference != null; - return overloadedOperationReference; - } - - @NotNull - public static JsFunction functionWithScope(@NotNull NamingScope scope) { - return JsFunction.getAnonymousFunctionWithScope(scope.jsScope()); - } - - @NotNull - public static JsNumberLiteral zeroLiteral(@NotNull TranslationContext context) { - return context.program().getNumberLiteral(0); - } - - @NotNull - public static TemporaryVariable newAliasForThis(@NotNull TranslationContext context, - @NotNull DeclarationDescriptor descriptor) { - JsExpression thisQualifier = getThisObject(context, descriptor); - TemporaryVariable aliasForThis = context.declareTemporary(thisQualifier); - context.aliaser().setAliasForThis(descriptor, aliasForThis.name()); - return aliasForThis; - } - - public static void removeAliasForThis(@NotNull TranslationContext context, - @NotNull DeclarationDescriptor descriptor) { - context.aliaser().removeAliasForThis(descriptor); - } - -} diff --git a/translator/src/org/jetbrains/k2js/utils/GenerationUtils.java b/translator/src/org/jetbrains/k2js/utils/GenerationUtils.java deleted file mode 100644 index ae96b635c59..00000000000 --- a/translator/src/org/jetbrains/k2js/utils/GenerationUtils.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.utils; - -import org.jetbrains.annotations.NotNull; - -import java.util.List; - -//TODO: very thin class - -/** - * @author Pavel Talanov - */ -public final class GenerationUtils { - - @NotNull - public static String generateCallToMain(@NotNull String namespaceName, @NotNull List arguments) { - String constructArguments = "var args = [];\n"; - int index = 0; - for (String argument : arguments) { - constructArguments = constructArguments + "args[" + index + "]= \"" + argument + "\";\n"; - index++; - } - String callMain = namespaceName + ".main(args);\n"; - return constructArguments + callMain; - } - - -} diff --git a/translator/src/org/jetbrains/k2js/utils/JetFileUtils.java b/translator/src/org/jetbrains/k2js/utils/JetFileUtils.java deleted file mode 100644 index 76d2f7ebba9..00000000000 --- a/translator/src/org/jetbrains/k2js/utils/JetFileUtils.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.utils; - -import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.io.FileUtil; -import com.intellij.openapi.util.text.StringUtil; -import com.intellij.openapi.vfs.CharsetToolkit; -import com.intellij.psi.PsiFile; -import com.intellij.psi.PsiFileFactory; -import com.intellij.psi.impl.PsiFileFactoryImpl; -import com.intellij.testFramework.LightVirtualFile; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.plugin.JetLanguage; - -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * @author Pavel Talanov - */ -public final class JetFileUtils { - - @NotNull - public static String loadFile(@NotNull String path) throws IOException { - return doLoadFile(path); - } - - @NotNull - private static String doLoadFile(@NotNull String path) throws IOException { - String text = FileUtil.loadFile(new File(path), CharsetToolkit.UTF8).trim(); - text = StringUtil.convertLineSeparators(text); - return text; - } - - @NotNull - public static JetFile createPsiFile(@NotNull String name, - @NotNull String text, - @NotNull Project project) { - return (JetFile) createFile(name + ".jet", text, project); - } - - @NotNull - public static JetFile loadPsiFile(@NotNull String name, @NotNull Project project) { - try { - return createPsiFile(name, loadFile(name), project); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - @NotNull - private static PsiFile createFile(@NotNull String name, @NotNull String text, @NotNull Project project) { - LightVirtualFile virtualFile = new LightVirtualFile(name, JetLanguage.INSTANCE, text); - virtualFile.setCharset(CharsetToolkit.UTF8_CHARSET); - PsiFile result = ((PsiFileFactoryImpl) PsiFileFactory.getInstance(project)) - .trySetupPsiForFile(virtualFile, JetLanguage.INSTANCE, true, false); - assert result != null; - return result; - } - - - @NotNull - public static List createPsiFileList(@NotNull List inputFiles, - @NotNull Project project) { - List psiFiles = new ArrayList(); - for (String inputFile : inputFiles) { - psiFiles.add(JetFileUtils.loadPsiFile(inputFile, project)); - } - return psiFiles; - } -} diff --git a/translator/src/org/jetbrains/k2js/utils/JetTestUtils.java b/translator/src/org/jetbrains/k2js/utils/JetTestUtils.java deleted file mode 100644 index b9f3b05be11..00000000000 --- a/translator/src/org/jetbrains/k2js/utils/JetTestUtils.java +++ /dev/null @@ -1,178 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.k2js.utils; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.cfg.pseudocode.JetControlFlowDataTraceFactory; -import org.jetbrains.jet.lang.diagnostics.Diagnostic; -import org.jetbrains.jet.lang.diagnostics.Severity; -import org.jetbrains.jet.lang.diagnostics.UnresolvedReferenceDiagnostic; -import org.jetbrains.jet.lang.psi.JetFile; -import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.BindingTrace; -import org.jetbrains.jet.lang.resolve.java.AnalyzerFacade; -import org.jetbrains.jet.util.slicedmap.ReadOnlySlice; -import org.jetbrains.jet.util.slicedmap.SlicedMap; -import org.jetbrains.jet.util.slicedmap.WritableSlice; - -import java.io.File; -import java.io.IOException; -import java.util.Collection; -import java.util.Collections; - -/** - * @author abreslav - */ -public class JetTestUtils { - public static final BindingTrace DUMMY_TRACE = new BindingTrace() { - - - @Override - public BindingContext getBindingContext() { - return new BindingContext() { - - @Override - public Collection getDiagnostics() { - throw new UnsupportedOperationException(); // TODO - } - - @Override - public V get(ReadOnlySlice slice, K key) { - return DUMMY_TRACE.get(slice, key); - } - - @NotNull - @Override - public Collection getKeys(WritableSlice slice) { - return DUMMY_TRACE.getKeys(slice); - } - }; - } - - @Override - public void record(WritableSlice slice, K key, V value) { - } - - @Override - public void record(WritableSlice slice, K key) { - } - - @Override - public V get(ReadOnlySlice slice, K key) { - if (slice == BindingContext.PROCESSED) return (V) Boolean.FALSE; - return SlicedMap.DO_NOTHING.get(slice, key); - } - - @NotNull - @Override - public Collection getKeys(WritableSlice slice) { - assert slice.isCollective(); - return Collections.emptySet(); - } - - @Override - public void report(@NotNull Diagnostic diagnostic) { - if (diagnostic instanceof UnresolvedReferenceDiagnostic) { - UnresolvedReferenceDiagnostic unresolvedReferenceDiagnostic = (UnresolvedReferenceDiagnostic) diagnostic; - throw new IllegalStateException("Unresolved: " + unresolvedReferenceDiagnostic.getPsiElement().getText()); - } - } - }; - - public static BindingTrace DUMMY_EXCEPTION_ON_ERROR_TRACE = new BindingTrace() { - @Override - public BindingContext getBindingContext() { - return new BindingContext() { - @Override - public Collection getDiagnostics() { - throw new UnsupportedOperationException(); - } - - @Override - public V get(ReadOnlySlice slice, K key) { - return DUMMY_EXCEPTION_ON_ERROR_TRACE.get(slice, key); - } - - @NotNull - @Override - public Collection getKeys(WritableSlice slice) { - return DUMMY_EXCEPTION_ON_ERROR_TRACE.getKeys(slice); - } - }; - } - - @Override - public void record(WritableSlice slice, K key, V value) { - } - - @Override - public void record(WritableSlice slice, K key) { - } - - @Override - public V get(ReadOnlySlice slice, K key) { - return null; - } - - @NotNull - @Override - public Collection getKeys(WritableSlice slice) { - assert slice.isCollective(); - return Collections.emptySet(); - } - - @Override - public void report(@NotNull Diagnostic diagnostic) { - if (diagnostic.getSeverity() == Severity.ERROR) { - throw new IllegalStateException(diagnostic.getMessage()); - } - } - }; - - public static BindingContext analyzeNamespace(@NotNull JetFile file, @NotNull JetControlFlowDataTraceFactory flowDataTraceFactory) { - return AnalyzerFacade.analyzeOneFileWithJavaIntegration(file, flowDataTraceFactory); - } - - - public static void mkdirs(File file) throws IOException { - if (file.isDirectory()) { - return; - } - if (!file.mkdirs()) { - throw new IOException(); - } - } - - public static void rmrf(File file) { - if (file != null) { - File[] children = file.listFiles(); - if (children != null) { - for (File child : children) { - rmrf(child); - } - } - file.delete(); - } - } - - public static void recreateDirectory(File file) throws IOException { - rmrf(file); - mkdirs(file); - } - - -} diff --git a/translator/testFiles/canvas_helper.js b/translator/testFiles/canvas_helper.js deleted file mode 100644 index 90d9287df1f..00000000000 --- a/translator/testFiles/canvas_helper.js +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function getContext() { - return getCanvas().getContext('2d'); -} - -function getCanvas() { - return document.getElementsByTagName('canvas')[0]; -} - -function getKotlinLogo() { - return document.getElementsByTagName('img')[0]; -} \ No newline at end of file diff --git a/translator/testFiles/class/cases/classWithoutNamespace.kt b/translator/testFiles/class/cases/classWithoutNamespace.kt deleted file mode 100644 index 4aceb233099..00000000000 --- a/translator/testFiles/class/cases/classWithoutNamespace.kt +++ /dev/null @@ -1,7 +0,0 @@ -class A(var a : Int) { - { - $a=3 - } -} - -fun box() = (A(1).a == 3) \ No newline at end of file diff --git a/translator/testFiles/class/out/.gitignore b/translator/testFiles/class/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/class/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/examples/cases/closureWithParameter.jet b/translator/testFiles/examples/cases/closureWithParameter.jet deleted file mode 100644 index e0b5d616951..00000000000 --- a/translator/testFiles/examples/cases/closureWithParameter.jet +++ /dev/null @@ -1,7 +0,0 @@ -fun box() : String { - return apply( "OK", {(arg: String) -> arg } ) -} - -fun apply(arg : String, f : (p:String) -> String) : String { - return f(arg) -} diff --git a/translator/testFiles/examples/cases/closureWithParameterAndBoxing.jet b/translator/testFiles/examples/cases/closureWithParameterAndBoxing.jet deleted file mode 100644 index 2b64a547d29..00000000000 --- a/translator/testFiles/examples/cases/closureWithParameterAndBoxing.jet +++ /dev/null @@ -1,7 +0,0 @@ -fun box() : String { - return if (apply( 5, {(arg: Int) -> arg + 13 } ) == 18) "OK" else "fail" -} - -fun apply(arg : Int, f : (p:Int) -> Int) : Int { - return f(arg) -} diff --git a/translator/testFiles/examples/cases/diamondInheritance.jet b/translator/testFiles/examples/cases/diamondInheritance.jet deleted file mode 100644 index 210aecafedc..00000000000 --- a/translator/testFiles/examples/cases/diamondInheritance.jet +++ /dev/null @@ -1,24 +0,0 @@ -// Changed when traits were introduced. May not make sense any more - -open class Base() { - public var v : Int = 0 -} - -open class Left() : Base() {} -trait Right : Base {} - -class D() : Left(), Right - -fun vl(l : Left) : Int = l.v -fun vr(r : Right) : Int = r.v - -fun box() : String { - val d = D() - d.v = 42 - - if (d.v != 42) return "Fail #1" - if (vl(d) != 42) return "Fail #2" - if (vr(d) != 42) return "Fail #3" - - return "OK" -} \ No newline at end of file diff --git a/translator/testFiles/examples/cases/doubleEnclosedLocalVariable.jet b/translator/testFiles/examples/cases/doubleEnclosedLocalVariable.jet deleted file mode 100644 index 96ac7f2ef19..00000000000 --- a/translator/testFiles/examples/cases/doubleEnclosedLocalVariable.jet +++ /dev/null @@ -1,8 +0,0 @@ -fun box() : String { - val cl = 39 - return if (sum(200, { val ff = {cl}; ff() }) == 239) "OK" else "FAIL" -} - -fun sum(arg:Int, f : () -> Int) : Int { - return arg + f() -} diff --git a/translator/testFiles/examples/cases/enclosingLocalVariable.jet b/translator/testFiles/examples/cases/enclosingLocalVariable.jet deleted file mode 100644 index 01e1a103ff2..00000000000 --- a/translator/testFiles/examples/cases/enclosingLocalVariable.jet +++ /dev/null @@ -1,8 +0,0 @@ -fun box() : String { - val cl = 39 - return if (sum(200, { val m = { val r = { cl }; r() }; m() }) == 239) "OK" else "FAIL" -} - -fun sum(arg:Int, f : () -> Int) : Int { - return arg + f() -} diff --git a/translator/testFiles/examples/cases/extensionClosure.jet b/translator/testFiles/examples/cases/extensionClosure.jet deleted file mode 100644 index 21307ea42ab..00000000000 --- a/translator/testFiles/examples/cases/extensionClosure.jet +++ /dev/null @@ -1,13 +0,0 @@ -class Point(val x : Int, val y : Int) - -fun box() : String { - val answer = apply(Point(3, 5), { Point.(scalar : Int) : Point -> - Point(x * scalar, y * scalar) - }) - - return if (answer.x == 6 && answer.y == 10) "OK" else "FAIL" -} - -fun apply(arg:Point, f : Point.(scalar : Int) -> Point) : Point { - return arg.f(2) -} diff --git a/translator/testFiles/examples/cases/funDelegation.jet b/translator/testFiles/examples/cases/funDelegation.jet deleted file mode 100644 index 10a1f408b09..00000000000 --- a/translator/testFiles/examples/cases/funDelegation.jet +++ /dev/null @@ -1,17 +0,0 @@ -open class Base() { - fun n(n : Int) : Int = n + 1 -} - -trait Abstract {} - -class Derived1() : Base(), Abstract {} -class Derived2() : Abstract, Base() {} - -fun test(s : Base) : Boolean = s.n(238) == 239 - -fun box() : String { - if (!test(Base())) return "Fail #1" - if (!test(Derived1())) return "Fail #2" - if (!test(Derived2())) return "Fail #3" - return "OK" -} \ No newline at end of file diff --git a/translator/testFiles/examples/cases/incrementProperty.kt b/translator/testFiles/examples/cases/incrementProperty.kt deleted file mode 100644 index 29123dbcaf3..00000000000 --- a/translator/testFiles/examples/cases/incrementProperty.kt +++ /dev/null @@ -1,14 +0,0 @@ -class Slot() { - var vitality: Int = 10000 - - fun increaseVitality(delta: Int) { - vitality = vitality + delta - if (vitality > 65535) vitality = 65535; - } -} - -fun box(): String { - val s = Slot() - s.increaseVitality(1000) - if (s.vitality == 11000) return "OK" else return "fail" -} diff --git a/translator/testFiles/examples/cases/inheritedMethod.jet b/translator/testFiles/examples/cases/inheritedMethod.jet deleted file mode 100644 index 97d432077a8..00000000000 --- a/translator/testFiles/examples/cases/inheritedMethod.jet +++ /dev/null @@ -1,13 +0,0 @@ -open class Foo() { - fun xyzzy(): String = "xyzzy" -} - -class Bar(): Foo() { - fun test(): String = xyzzy() -} - -fun box() : String { - val bar = Bar() - val f = bar.test() - return if (f == "xyzzy") "OK" else "fail" -} diff --git a/translator/testFiles/examples/cases/initializerBlock.jet b/translator/testFiles/examples/cases/initializerBlock.jet deleted file mode 100644 index c89deeda87d..00000000000 --- a/translator/testFiles/examples/cases/initializerBlock.jet +++ /dev/null @@ -1,13 +0,0 @@ -class C() { - public var f: Int - - { - $f = 610 - } -} - -fun box(): String { - val c = C() - if (c.f != 610) return "fail" - return "OK" -} diff --git a/translator/testFiles/examples/cases/kt242.jet b/translator/testFiles/examples/cases/kt242.jet deleted file mode 100644 index 4e2de93cff3..00000000000 --- a/translator/testFiles/examples/cases/kt242.jet +++ /dev/null @@ -1,19 +0,0 @@ -fun box() : String { - val i: Int? = 7 - val j: Int? = null - val k = 7 - - //verify errors - if (i == 7) {} - if (7 == i) {} - - if (j == 7) {} - if (7 == j) {} - - if (i == k) {} - if (k == i) {} - - if (j == k) {} - if (k == j) {} - return "OK" -} \ No newline at end of file diff --git a/translator/testFiles/examples/cases/newInstanceDefaultConstructor.jet b/translator/testFiles/examples/cases/newInstanceDefaultConstructor.jet deleted file mode 100644 index 6cd0ebd954b..00000000000 --- a/translator/testFiles/examples/cases/newInstanceDefaultConstructor.jet +++ /dev/null @@ -1,11 +0,0 @@ -class SimpleClass() { - fun foo() = 610 -} - -fun box() : String { - val c = SimpleClass() - if (c.foo() == 610) { - return "OK" - } - return "FAIL" -} diff --git a/translator/testFiles/examples/cases/overloadBinaryOperator.jet b/translator/testFiles/examples/cases/overloadBinaryOperator.jet deleted file mode 100644 index bee66062979..00000000000 --- a/translator/testFiles/examples/cases/overloadBinaryOperator.jet +++ /dev/null @@ -1,25 +0,0 @@ -import java.util.* - -class ArrayWrapper() { - val contents = ArrayList() - - fun add(item: T) { - contents.add(item) - } - - fun plus(b: ArrayWrapper): ArrayWrapper { - val result = ArrayWrapper() - result.contents.addAll(contents) - result.contents.addAll(b.contents) - return result - } -} - -fun box(): String { - val v1 = ArrayWrapper() - val v2 = ArrayWrapper() - v1.add("foo") - v2.add("bar") - val v3 = v1 + v2 - return if (v3.contents.size() == 2) "OK" else "fail" -} diff --git a/translator/testFiles/examples/cases/overloadPlusAssignReturn.jet b/translator/testFiles/examples/cases/overloadPlusAssignReturn.jet deleted file mode 100644 index b6d0c3c0282..00000000000 --- a/translator/testFiles/examples/cases/overloadPlusAssignReturn.jet +++ /dev/null @@ -1,27 +0,0 @@ -import java.util.* - -class ArrayWrapper() { - val contents = ArrayList() - - fun add(item: T) { - contents.add(item) - } - - fun plusAssign(rhs: ArrayWrapper) { - contents.addAll(rhs.contents) - } - - fun get(index: Int): T { - return contents.get(index) - } -} - -fun box(): String { - var v1 = ArrayWrapper() - val v2 = ArrayWrapper() - v1.add("foo") - val v3 = v1 - v2.add("bar") - v1 += v2 - return if (v1.contents.size() == 2 && v3.contents.size() == 2) "OK" else "fail" -} diff --git a/translator/testFiles/examples/cases/overloadPlusToPlusAssign.jet b/translator/testFiles/examples/cases/overloadPlusToPlusAssign.jet deleted file mode 100644 index c5236b0ace4..00000000000 --- a/translator/testFiles/examples/cases/overloadPlusToPlusAssign.jet +++ /dev/null @@ -1,30 +0,0 @@ -import java.util.* - -class ArrayWrapper() { - val contents = ArrayList() - - fun add(item: T) { - contents.add(item) - } - - fun plus(rhs: ArrayWrapper): ArrayWrapper { - val result = ArrayWrapper() - result.contents.addAll(contents) - result.contents.addAll(rhs.contents) - return result - } - - fun get(index: Int): T { - return contents.get(index) - } -} - -fun box(): String { - var v1 = ArrayWrapper() - val v2 = ArrayWrapper() - v1.add("foo") - val v3 = v1 - v2.add("bar") - v1 += v2 - return if (v1.contents.size() == 2 && v3.contents.size() == 1) "OK" else "fail" -} diff --git a/translator/testFiles/examples/cases/overloadUnaryOperator.jet b/translator/testFiles/examples/cases/overloadUnaryOperator.jet deleted file mode 100644 index 2cbe1a27f3a..00000000000 --- a/translator/testFiles/examples/cases/overloadUnaryOperator.jet +++ /dev/null @@ -1,31 +0,0 @@ -import java.util.* - -class ArrayWrapper() { - val contents = ArrayList() - - fun add(item: T) { - contents.add(item) - } - - fun minus(): ArrayWrapper { - val result = ArrayWrapper() - result.contents.addAll(contents) - var i = contents.size(); - for (a in contents) { - result.contents[--i] = a; - } - return result - } - - fun get(index: Int): T { - return contents.get(index) - } -} - -fun box(): String { - val v1 = ArrayWrapper() - v1.add("foo") - v1.add("bar") - val v2 = -v1 - return if (v2[0] == "bar" && v2[1] == "foo") "OK" else "fail" -} diff --git a/translator/testFiles/examples/cases/propertyDelegation.jet b/translator/testFiles/examples/cases/propertyDelegation.jet deleted file mode 100644 index 614c624f124..00000000000 --- a/translator/testFiles/examples/cases/propertyDelegation.jet +++ /dev/null @@ -1,33 +0,0 @@ -open class Base() { - val plain = 239 - public val read : Int - get() = 239 - - public var readwrite : Int = 0 - get() = $readwrite + 1 - set(n : Int) { - $readwrite = n - } -} - -trait Abstract {} - -class Derived1() : Base(), Abstract {} -class Derived2() : Abstract, Base() {} - -fun code(s : Base) : Int { - if (s.plain != 239) return 1 - if (s.read != 239) return 2 - s.readwrite = 238 - if (s.readwrite != 239) return 3 - return 0 -} - -fun test(s : Base) : Boolean = code(s) == 0 - -fun box() : String { - if (!test(Base())) return "Fail #1" - if (!test(Derived1())) return "Fail #2" - if (!test(Derived2())) return "Fail #3" - return "OK" -} \ No newline at end of file diff --git a/translator/testFiles/examples/cases/rightHandOverride.jet b/translator/testFiles/examples/cases/rightHandOverride.jet deleted file mode 100644 index e99e60bd863..00000000000 --- a/translator/testFiles/examples/cases/rightHandOverride.jet +++ /dev/null @@ -1,20 +0,0 @@ -// Changed when traits were introduced. May not make sense any more - -trait Left {} -open class Right() { - open fun f() = 42 -} - -class D() : Left, Right() { - override fun f() = 239 -} - -fun box() : String { - val r : Right = Right() - val d : D = D() - - if (r.f() != 42) return "Fail #1" - if (d.f() != 239) return "Fail #2" - - return "OK" -} \ No newline at end of file diff --git a/translator/testFiles/examples/cases/simplestClosure.jet b/translator/testFiles/examples/cases/simplestClosure.jet deleted file mode 100644 index 7a9f3b439cf..00000000000 --- a/translator/testFiles/examples/cases/simplestClosure.jet +++ /dev/null @@ -1,7 +0,0 @@ -fun box() : String { - return invoker( {"OK"} ) -} - -fun invoker(gen : () -> String) : String { - return gen() -} diff --git a/translator/testFiles/examples/cases/simplestClosureAndBoxing.jet b/translator/testFiles/examples/cases/simplestClosureAndBoxing.jet deleted file mode 100644 index 50f22fbeb8d..00000000000 --- a/translator/testFiles/examples/cases/simplestClosureAndBoxing.jet +++ /dev/null @@ -1,7 +0,0 @@ -fun box() : String { - return if (int_invoker( { 7 } ) == 7) "OK" else "fail" -} - -fun int_invoker(gen : () -> Int) : Int { - return gen() -} diff --git a/translator/testFiles/examples/out/.gitignore b/translator/testFiles/examples/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/examples/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/examples/sortedTests/unsupported/basicmethod.jet b/translator/testFiles/examples/sortedTests/unsupported/basicmethod.jet deleted file mode 100644 index 9920bc3b69d..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/basicmethod.jet +++ /dev/null @@ -1,21 +0,0 @@ -import java.util.ArrayList - -trait Tr { - fun extra() : String = "_" -} - -class N() : ArrayList(), Tr { - override fun add(el: Any) : Boolean { - super.add(el) - return super.add(el.toString() + super.extra() + el + extra()) - } - - override fun extra() : String = super.extra() + super.extra() -} - -fun box(): String { - val n = N() - n.add("239") - if (n.get(0) == "239" && n.get(1) == "239_239__") return "OK"; - return "fail"; -} \ No newline at end of file diff --git a/translator/testFiles/examples/sortedTests/unsupported/basicproperty.jet b/translator/testFiles/examples/sortedTests/unsupported/basicproperty.jet deleted file mode 100644 index ae1cfa5618b..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/basicproperty.jet +++ /dev/null @@ -1,22 +0,0 @@ -open class M() { - open var b: Int = 0 -} - -class N() : M() { - val a : Int - get() { - super.b = super.b + 1 - return super.b + 1 - } - override var b: Int = a + 1 - - val superb : Int - get() = super.b -} - -fun box(): String { - val n = N() - println("a: " + n.a + " b: " + n.b + " superb: " + n.superb) - if (n.b == 3 && n.a == 4 && n.superb == 3) return "OK"; - return "fail"; -} \ No newline at end of file diff --git a/translator/testFiles/examples/sortedTests/unsupported/classObject.jet b/translator/testFiles/examples/sortedTests/unsupported/classObject.jet deleted file mode 100644 index 76eff77c438..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/classObject.jet +++ /dev/null @@ -1,11 +0,0 @@ -class C() { - class object { - fun create() = C() - } -} - -fun box(): String { - val c = C.create() - return if (c is C) "OK" else "fail" -} - diff --git a/translator/testFiles/examples/sortedTests/unsupported/classObjectInterface.jet b/translator/testFiles/examples/sortedTests/unsupported/classObjectInterface.jet deleted file mode 100644 index 432bb37bee0..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/classObjectInterface.jet +++ /dev/null @@ -1,9 +0,0 @@ -class C() { - fun getInstance(): Runnable = C - - class object: Runnable { - override fun run(): Unit { } - } -} - -fun foo() = C().getInstance() diff --git a/translator/testFiles/examples/sortedTests/unsupported/classObjectMethod.jet b/translator/testFiles/examples/sortedTests/unsupported/classObjectMethod.jet deleted file mode 100644 index d7d70a86d96..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/classObjectMethod.jet +++ /dev/null @@ -1,13 +0,0 @@ -abstract open class Default { - abstract fun defaultValue(): Int -} - -class MyInt() { - class object : Default { - override fun defaultValue(): Int = 610 - } -} - -fun toDefault(t: T) where class object T: Default = T.defaultValue() - -fun box(): String = if (toDefault(MyInt()) == 610) "OK" else "fail" diff --git a/translator/testFiles/examples/sortedTests/unsupported/enclosed.jet b/translator/testFiles/examples/sortedTests/unsupported/enclosed.jet deleted file mode 100644 index 705e0b602c2..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/enclosed.jet +++ /dev/null @@ -1,42 +0,0 @@ -trait BK { - fun x() : Int = 50 -} - -trait K : BK { - override fun x() : Int = super.x() * 2 -} - -open class M() { - open fun x() : Int = 10 - - open var y = 500 -} - -open class N() : M(), K { - - override fun x() : Int = 20 - - override var y = 200 - - open class C() : K { - fun test1() = x() - fun test2() = super@N.x() - fun test3() = super@N.x() - fun test4() = super.x() - fun test5() = y - fun test6() : Int { - super@N.y += 200 - return super@N.y - } - } -} - -fun box(): String { - if (N().C().test1() != 100) return "test1 fail"; - if (N().C().test2() != 10) return "test2 fail"; - if (N().C().test3() != 100) return "test3 fail"; - if (N().C().test4() != 100) return "test4 fail"; - if (N().C().test5() != 200) return "test5 fail"; - if (N().C().test6() != 700) return "test6 fail"; - return "OK"; -} \ No newline at end of file diff --git a/translator/testFiles/examples/sortedTests/unsupported/forwardTypeParameter.jet b/translator/testFiles/examples/sortedTests/unsupported/forwardTypeParameter.jet deleted file mode 100644 index 2e78cd3ae9c..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/forwardTypeParameter.jet +++ /dev/null @@ -1,12 +0,0 @@ -class Foo() { } -class Bar() { } - -fun isInstance(obj: Any?) = obj is T - -fun isInstance2(obj: Any?) = isInstance(obj) - -fun box(): String { - if (! isInstance2(Foo())) return "fail 1" - if (isInstance2(Foo())) return "fail 2" - return "OK" -} diff --git a/translator/testFiles/examples/sortedTests/unsupported/inheritance.jet b/translator/testFiles/examples/sortedTests/unsupported/inheritance.jet deleted file mode 100644 index 0bfdb4e497f..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/inheritance.jet +++ /dev/null @@ -1,41 +0,0 @@ -// Changed when traits were introduced. May not make sense any more - -open class X(val x : Int) {} -trait Y { - abstract val y : Int -} - -class YImpl(override val y : Int) : Y {} - -class Point(x : Int, yy : Int) : X(x) , Y { - override val y : Int = yy -} - -trait Abstract {} - -class P1(x : Int, yy : Y) : Abstract, X(x), Y by yy {} -class P2(x : Int, yy : Y) : X(x), Abstract, Y by yy {} -class P3(x : Int, yy : Y) : X(x), Y by yy, Abstract {} -class P4(x : Int, yy : Y) : Y by yy, Abstract, X(x) {} - -fun box() : String { - if (X(239).x != 239) return "FAIL #1" - if (YImpl(239).y != 239) return "FAIL #2" - - val p = Point(240, -1) - if (p.x + p.y != 239) return "FAIL #3" - - val y = YImpl(-1) - val p1 = P1(240, y) - if (p1.x + p1.y != 239) return "FAIL #4" - val p2 = P2(240, y) - if (p2.x + p2.y != 239) return "FAIL #5" - - val p3 = P3(240, y) - if (p3.x + p3.y != 239) return "FAIL #6" - - val p4 = P4(240, y) - if (p4.x + p4.y != 239) return "FAIL #7" - - return "OK" -} \ No newline at end of file diff --git a/translator/testFiles/examples/sortedTests/unsupported/inheritedInnerClass.jet b/translator/testFiles/examples/sortedTests/unsupported/inheritedInnerClass.jet deleted file mode 100644 index 4717bea55a8..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/inheritedInnerClass.jet +++ /dev/null @@ -1,14 +0,0 @@ -class Outer() { - open class InnerBase() { - } - - class InnerDerived(): InnerBase() { - } - - public val foo: InnerBase? = InnerDerived() -} - -fun box() : String { - val o = Outer() - return if (o.foo === null) "fail" else "OK" -} diff --git a/translator/testFiles/examples/sortedTests/unsupported/initializerBlockDImpl.jet b/translator/testFiles/examples/sortedTests/unsupported/initializerBlockDImpl.jet deleted file mode 100644 index aa3d227c80f..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/initializerBlockDImpl.jet +++ /dev/null @@ -1,20 +0,0 @@ -import java.util.* -import java.io.* - -class World() { - public val items: ArrayList = ArrayList - - class Item() { - { - items.add(this) - } - } - - val foo = Item() -} - -fun box() : String { - val w = World() - if (w.items.size() != 1) return "fail" - return "OK" -} diff --git a/translator/testFiles/examples/sortedTests/unsupported/innerClass.jet b/translator/testFiles/examples/sortedTests/unsupported/innerClass.jet deleted file mode 100644 index df43f61e8bc..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/innerClass.jet +++ /dev/null @@ -1,19 +0,0 @@ -class Outer(val foo: StringBuilder) { - class Inner() { - fun len() : Int { - return foo.length() - } - } - - fun test() : Inner { - return Inner() - } -} - -fun box() : String { - val sb = StringBuilder("xyzzy") - val o = Outer(sb) - val i = o.test() - val l = i.len() - return if (l != 5) "fail" else "OK" -} diff --git a/translator/testFiles/examples/sortedTests/unsupported/propertyInInitializer.jet b/translator/testFiles/examples/sortedTests/unsupported/propertyInInitializer.jet deleted file mode 100644 index f6e84b15afd..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/propertyInInitializer.jet +++ /dev/null @@ -1,16 +0,0 @@ -class Outer() { - val s = "xyzzy" - - open class InnerBase(public val name: String) { - } - - class InnerDerived(): InnerBase(s) { - } - - val x = InnerDerived() -} - -fun box() : String { - val o = Outer() - return if (o.x.name != "xyzzy") "fail" else "OK" -} diff --git a/translator/testFiles/examples/sortedTests/unsupported/simpleBox.jet b/translator/testFiles/examples/sortedTests/unsupported/simpleBox.jet deleted file mode 100644 index be95d012d51..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/simpleBox.jet +++ /dev/null @@ -1,8 +0,0 @@ -class Box(t: T) { - var value = t -} - -fun box(): String { - val box: Box = Box(1) - return if (box.value == 1) "OK" else "fail" -} diff --git a/translator/testFiles/examples/sortedTests/unsupported/traitproperty.jet b/translator/testFiles/examples/sortedTests/unsupported/traitproperty.jet deleted file mode 100644 index 715d8d73d8b..00000000000 --- a/translator/testFiles/examples/sortedTests/unsupported/traitproperty.jet +++ /dev/null @@ -1,29 +0,0 @@ -trait M { - var backingB : Int - var b : Int - get() = backingB - set(value: Int) { - backingB = value - } -} - -class N() : M { - override var backingB : Int = 0 - - val a : Int - get() { - super.b = super.b + 1 - return super.b + 1 - } - override var b: Int = a + 1 - - val superb : Int - get() = super.b -} - -fun box(): String { - val n = N() - println("a: " + n.a + " b: " + n.b + " superb: " + n.superb) - if (n.b == 3 && n.a == 4 && n.superb == 3) return "OK"; - return "fail"; -} \ No newline at end of file diff --git a/translator/testFiles/examples/sortedTests/usesJava/exceptionConstructor.jet b/translator/testFiles/examples/sortedTests/usesJava/exceptionConstructor.jet deleted file mode 100644 index ab6117e266e..00000000000 --- a/translator/testFiles/examples/sortedTests/usesJava/exceptionConstructor.jet +++ /dev/null @@ -1,7 +0,0 @@ -class GameError(msg: String): Exception(msg) { -} - -fun box(): String { - val e = GameError("foo") - return if (e.getMessage() == "foo") "OK" else "fail" -} diff --git a/translator/testFiles/expression/conditional/cases/ifAsExpressionWithThrow.kt b/translator/testFiles/expression/conditional/cases/ifAsExpressionWithThrow.kt deleted file mode 100644 index f73f96b80dd..00000000000 --- a/translator/testFiles/expression/conditional/cases/ifAsExpressionWithThrow.kt +++ /dev/null @@ -1,3 +0,0 @@ -package foo - -fun box() = if (true) throw Exception() else false \ No newline at end of file diff --git a/translator/testFiles/expression/conditional/out/.gitignore b/translator/testFiles/expression/conditional/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/expression/conditional/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/expression/for/cases/forIteratesOverArray.kt b/translator/testFiles/expression/for/cases/forIteratesOverArray.kt deleted file mode 100644 index 0b0cad9557b..00000000000 --- a/translator/testFiles/expression/for/cases/forIteratesOverArray.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - -val a1 = Array(10) - -fun box() : Boolean { - var c = 0 - var d = 0 - a1[3] = 3 - a1[5] = 5 - - for (var a : Int? in a1) { - if (a != null) { - c += 1; - } else { - d += 1 - } - } - return (c == 2) && (d == 8) -} \ No newline at end of file diff --git a/translator/testFiles/expression/for/cases/forOnEmptyArray.kt b/translator/testFiles/expression/for/cases/forOnEmptyArray.kt deleted file mode 100644 index 951265396c3..00000000000 --- a/translator/testFiles/expression/for/cases/forOnEmptyArray.kt +++ /dev/null @@ -1,10 +0,0 @@ -package foo - -val a1 = Array(0) - -fun box() : Boolean { - for (a in a1) { - return false; - } - return true; -} \ No newline at end of file diff --git a/translator/testFiles/expression/for/out/.gitignore b/translator/testFiles/expression/for/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/expression/for/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/KT-921.kt b/translator/testFiles/expression/function/cases/KT-921.kt deleted file mode 100644 index 7c41a0fc0c0..00000000000 --- a/translator/testFiles/expression/function/cases/KT-921.kt +++ /dev/null @@ -1,67 +0,0 @@ -import java.util.* - -class Lifetime() { - val attached = ArrayList< Function0 >() - - public fun attach(action : ()->Unit) - { - attached.add(action) - } - - fun close() - { - for(x in attached) x() - attached.clear() - } -} - -public class Viewable() -{ - val items = ArrayList() - - fun add(item:T) - { - items.add(item) - } - - fun remove(item:T) - { - items.remove(item) - } - - fun view(lifetime: Lifetime, viewer: (itemLifetime:Lifetime, item:T) -> Unit) - { - for(item in items) - viewer(lifetime, item) - } -} - -fun lifetime(body: (Lifetime)->Unit) -{ - val l = Lifetime() - body(l) - l.close() -} - -fun Dump(items:ArrayList) -{ - for(item in items) - print(item.toString() + ", ") - println() -} - -fun main(args:Array) -{ - val v = Viewable() - val x = ArrayList() - v.add(1) - v.add(2) - lifetime( - { - v.view(it, {(itemLifetime, item)-> - x.add(item) - Dump(x) - itemLifetime.attach { x.remove(item as Any); Dump(x) } - }) - }) -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/adderClosure.kt b/translator/testFiles/expression/function/cases/adderClosure.kt deleted file mode 100644 index d7c053cbb87..00000000000 --- a/translator/testFiles/expression/function/cases/adderClosure.kt +++ /dev/null @@ -1,9 +0,0 @@ -package foo - -fun box() : Boolean { - var sum = 0 - val adder = {(a: Int) -> sum += a } - adder(3) - adder(2) - return sum == 5 -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/closureWithParameter.kt b/translator/testFiles/expression/function/cases/closureWithParameter.kt deleted file mode 100644 index 31c8e3f07c0..00000000000 --- a/translator/testFiles/expression/function/cases/closureWithParameter.kt +++ /dev/null @@ -1,9 +0,0 @@ -package foo - -fun box() : String { - return apply( "OK", {(arg: String) -> arg } ) -} - -fun apply(arg : String, f : (p:String) -> String) : String { - return f(arg) -} diff --git a/translator/testFiles/expression/function/cases/closureWithParameterAndBoxing.jet b/translator/testFiles/expression/function/cases/closureWithParameterAndBoxing.jet deleted file mode 100644 index e5602935931..00000000000 --- a/translator/testFiles/expression/function/cases/closureWithParameterAndBoxing.jet +++ /dev/null @@ -1,9 +0,0 @@ -package foo - -fun box() : String { - return if (apply( 5, {(arg: Int) -> arg + 13 } ) == 18) "OK" else "fail" -} - -fun apply(arg : Int, f : (p:Int) -> Int) : Int { - return f(arg) -} diff --git a/translator/testFiles/expression/function/cases/defaultParameters.kt b/translator/testFiles/expression/function/cases/defaultParameters.kt deleted file mode 100644 index 73945d0780a..00000000000 --- a/translator/testFiles/expression/function/cases/defaultParameters.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - - -fun f(a : Int = 2, b : Int = 3) = a + b - -fun box() : Boolean -{ - if (f(1,2) != 3) return false; - if (f(1,3) != 4) return false; - if (f(3) != 6) return false; - if (f() != 5) return false; - - return true; -} - diff --git a/translator/testFiles/expression/function/cases/enclosingThis.kt b/translator/testFiles/expression/function/cases/enclosingThis.kt deleted file mode 100644 index d227b3a2cc9..00000000000 --- a/translator/testFiles/expression/function/cases/enclosingThis.kt +++ /dev/null @@ -1,12 +0,0 @@ -class Point(val x:Int, val y:Int) { - fun mul() : (scalar:Int)->Point { - return { (scalar:Int):Point -> Point(x * scalar, y * scalar) } - } -} - -val m = Point(2, 3).mul() : (scalar:Int)->Point - -fun box() : String { - val answer = m(5) - return if (answer.x == 10 && answer.y == 15) "OK" else "FAIL" -} diff --git a/translator/testFiles/expression/function/cases/expressionAsFunction.kt b/translator/testFiles/expression/function/cases/expressionAsFunction.kt deleted file mode 100644 index a2f0685ae29..00000000000 --- a/translator/testFiles/expression/function/cases/expressionAsFunction.kt +++ /dev/null @@ -1,42 +0,0 @@ -package foo - -import java.util.*; - -val d = {(a : Int) -> a + 1} -val p = {(a : Int) -> a * 3} - -val list = ArrayList>(); - -fun chain(start : Int) : Int { - var res = start; - for (func in list) { - res = (func)(res); - } - return res; -} - -fun box() : Boolean { - if (chain(0) != 0) { - return false; - } - list.add(d); - if (list.get(0)(0) != 1) { - return false; - } - list.add(p); - if (list.get(1)(10) != 30) { - return false; - } - if (chain(0) != 3) { - return false; - } - list.add({it * it}); - list.add({it - 100}); - if (chain(2) != -19) { - return false; - } - if (({(a : Int) -> a * a}(3)) != 9) { - return false; - } - return true; -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/functionInsideFunction.kt b/translator/testFiles/expression/function/cases/functionInsideFunction.kt deleted file mode 100644 index fcb2a69895f..00000000000 --- a/translator/testFiles/expression/function/cases/functionInsideFunction.kt +++ /dev/null @@ -1,19 +0,0 @@ -package foo - - -fun box() : Boolean{ - fun f() = 3 - - return (((f() + f()) == 6) && (b() == 24)) -} - - -fun b() : Int { - - fun a() : Int { - fun c() = 4 - return c() * 3 - } - val a = 2 - return a() * a -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/functionLiteral.kt b/translator/testFiles/expression/function/cases/functionLiteral.kt deleted file mode 100644 index e27b2e273f9..00000000000 --- a/translator/testFiles/expression/function/cases/functionLiteral.kt +++ /dev/null @@ -1,8 +0,0 @@ -package foo - -fun box() : Boolean { - var sum = 0 - val addFive = {(a: Int) -> a + 5 } - sum = addFive(sum) - return sum == 5 -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/functionLiteralAsLastParameter.kt b/translator/testFiles/expression/function/cases/functionLiteralAsLastParameter.kt deleted file mode 100644 index 6be5be64eb6..00000000000 --- a/translator/testFiles/expression/function/cases/functionLiteralAsLastParameter.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -fun f(a: (Int) -> Int) = a(1) - -fun box() : Boolean { - - if (f() { - it + 2 - } != 3) return false - - if (f() {(a : Int) -> a * 300} != 300) return false; - - return true -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/functionLiteralAsParameter.kt b/translator/testFiles/expression/function/cases/functionLiteralAsParameter.kt deleted file mode 100644 index 3fb7b7ae0e4..00000000000 --- a/translator/testFiles/expression/function/cases/functionLiteralAsParameter.kt +++ /dev/null @@ -1,10 +0,0 @@ -package foo - -fun apply(f : (Int) -> Int, t : Int) : Int { - return f(t) -} - - -fun box() : Boolean { - return apply({(a: Int) -> a + 5 }, 3) == 8 -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/functionUsedBeforeDeclaration.kt b/translator/testFiles/expression/function/cases/functionUsedBeforeDeclaration.kt deleted file mode 100644 index a093c854230..00000000000 --- a/translator/testFiles/expression/function/cases/functionUsedBeforeDeclaration.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - - -fun box() : Boolean -{ - return f() -} - -fun f() : Boolean { - return true -} - - diff --git a/translator/testFiles/expression/function/cases/functionWithTwoParametersCall.kt b/translator/testFiles/expression/function/cases/functionWithTwoParametersCall.kt deleted file mode 100644 index 4c82f64892f..00000000000 --- a/translator/testFiles/expression/function/cases/functionWithTwoParametersCall.kt +++ /dev/null @@ -1,9 +0,0 @@ -package foo - -fun sum(param1 : Int, param2 : Int) : Int { - return param1 + param2; -} - -fun box() : Boolean { - return (sum(1, 5) == 6) -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/implicitItParameter.kt b/translator/testFiles/expression/function/cases/implicitItParameter.kt deleted file mode 100644 index ecfbeb19844..00000000000 --- a/translator/testFiles/expression/function/cases/implicitItParameter.kt +++ /dev/null @@ -1,12 +0,0 @@ -package foo - -fun test(f : (Int) -> Boolean, p : Int) = f(p) - -fun box() : Boolean { - if (!test({it + 1 == 2}, 1)) return false; - - if (!test({it > 1}, 3)) return false; - - return (test({((it < 1) == false)}, 1)) - -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/loopClosure.kt b/translator/testFiles/expression/function/cases/loopClosure.kt deleted file mode 100644 index 1cf3f038528..00000000000 --- a/translator/testFiles/expression/function/cases/loopClosure.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -var b = 0 - -fun loop(var times : Int) { - while(times > 0) { - val u = {(value : Int) -> - b = b + 1 - } - u(times--) - } -} - -fun box() : Boolean { - loop(5) - return b == 5 -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/namedArguments.kt b/translator/testFiles/expression/function/cases/namedArguments.kt deleted file mode 100644 index 5511e10825f..00000000000 --- a/translator/testFiles/expression/function/cases/namedArguments.kt +++ /dev/null @@ -1,16 +0,0 @@ -package foo - -fun test(x: Int, y: Int) = y - x - -fun box() : Boolean { - if (test(1,2) != 1) { - return false; - } - if (test(x=1, y=2) != 1) { - return false; - } - if (test(y=2, x=1) != 1) { - return false; - } - return true -} \ No newline at end of file diff --git a/translator/testFiles/expression/function/cases/vararg.kt b/translator/testFiles/expression/function/cases/vararg.kt deleted file mode 100644 index d3ab09ec173..00000000000 --- a/translator/testFiles/expression/function/cases/vararg.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -fun testSize(expectedSize : Int, vararg i : Int) : Boolean { - return (i.size == expectedSize) -} - -fun testSum(expectedSum : Int, vararg i : Int) : Boolean { - var sum = 0 - for (j in i) { - sum += j - } - - return (expectedSum == sum) -} - -fun box() = testSize(0) && testSum(0) && testSize(3, 1, 1, 1) && testSum(3, 1, 1, 1) && testSize(6, 1, 1, 1, 2, 3, 4) && - testSum(30, 10, 20, 0) \ No newline at end of file diff --git a/translator/testFiles/expression/function/out/.gitignore b/translator/testFiles/expression/function/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/expression/function/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/expression/misc/cases/intRange.kt b/translator/testFiles/expression/misc/cases/intRange.kt deleted file mode 100644 index 73d578db692..00000000000 --- a/translator/testFiles/expression/misc/cases/intRange.kt +++ /dev/null @@ -1,112 +0,0 @@ -package foo - -import js.* - -class RangeIterator(val start : Int, var count : Int, val reversed : Boolean) { - - var i = start - - fun next() : Int { - --count - if (reversed) { - i-- - return i + 1 - } else { - i++ - return i - 1 - } - } - - - fun hasNext() = (count > 0); -} - -class NumberRange(val start : Int, val size : Int, val reversed : Boolean) { - - val end : Int - get() = if (reversed) start - size + 1 else start + size - 1 - - fun contains(number : Int) : Boolean { - if (reversed) { - return (number <= start) && (number > start - size); - } else { - return (number >= start) && (number < start + size); - } - } - - fun iterator() = RangeIterator(start, size, reversed); -} - - - -fun box() = testRange() && testReversedRange(); - -fun testRange() : Boolean { - - val oneToFive = NumberRange(1, 4, false); - if (oneToFive.contains(5)) return false; - if (oneToFive.contains(0)) return false; - if (oneToFive.contains(-100)) return false; - if (oneToFive.contains(10)) return false; - if (!oneToFive.contains(1)) return false; - if (!oneToFive.contains(2)) return false; - if (!oneToFive.contains(3)) return false; - if (!oneToFive.contains(4)) return false; - if (!(oneToFive.start == 1)) return false; - if (!(oneToFive.size == 4)) return false; - if (!(oneToFive.end == 4)) return false; - - var sum = 0; - for (i in oneToFive) { - sum += i; - } - for (i in oneToFive) { - print(i) - } - - if (sum != 10) return false; - - return true; - -} - -fun testReversedRange() : Boolean { - - println("Testing reversed range."); - - val tenToFive = NumberRange(10, 5, true); - - if (tenToFive.contains(5)) return false; - if (tenToFive.contains(11)) return false; - if (tenToFive.contains(-100)) return false; - if (tenToFive.contains(1000)) return false; - if (!tenToFive.contains(6)) return false; - if (!tenToFive.contains(7)) return false; - if (!tenToFive.contains(8)) return false; - if (!tenToFive.contains(9)) return false; - if (!tenToFive.contains(10)) return false; - - if (!(tenToFive.start == 10)) return false; - if (!(tenToFive.size == 5)) return false; - if (!(tenToFive.end == 6)) return false; - - for (i in tenToFive) { - println(i) - } - - - var sum = 0; - for (i in tenToFive) { - sum += i; - } - - if (sum != 40) { - return false; - } - - return true; -} - -fun main(args : Array) { - println(box()) -} \ No newline at end of file diff --git a/translator/testFiles/expression/misc/cases/jquery.kt b/translator/testFiles/expression/misc/cases/jquery.kt deleted file mode 100644 index 4b4c94c8273..00000000000 --- a/translator/testFiles/expression/misc/cases/jquery.kt +++ /dev/null @@ -1,8 +0,0 @@ -package foo - -import jquery.*; - -fun box() : String { - val aa = jq("a").attr("a"); - return "OK" -} \ No newline at end of file diff --git a/translator/testFiles/expression/misc/cases/localProperty.jet b/translator/testFiles/expression/misc/cases/localProperty.jet deleted file mode 100644 index 2f69f45afba..00000000000 --- a/translator/testFiles/expression/misc/cases/localProperty.jet +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -val y = 3 - -fun f(a:Int) : Int { - val x = 42 - val y = 50 - - return y -} - -fun box() : Int -{ - return f(y) -} diff --git a/translator/testFiles/expression/misc/cases/safecallComputesExpressionOnlyOnce.kt b/translator/testFiles/expression/misc/cases/safecallComputesExpressionOnlyOnce.kt deleted file mode 100644 index e48f4d2da46..00000000000 --- a/translator/testFiles/expression/misc/cases/safecallComputesExpressionOnlyOnce.kt +++ /dev/null @@ -1,14 +0,0 @@ -package foo - -var i = 0 - -fun test() : Int? = i++ - -fun box() : Boolean { - if (i != 0) return false - test()?.plus(1) - if (i != 1) return false - test()?.minus(2) - if (i != 2) return false - return true -} \ No newline at end of file diff --git a/translator/testFiles/expression/misc/out/.gitignore b/translator/testFiles/expression/misc/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/expression/misc/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/expression/string/cases/intInTemplate.kt b/translator/testFiles/expression/string/cases/intInTemplate.kt deleted file mode 100644 index 2fa031bd831..00000000000 --- a/translator/testFiles/expression/string/cases/intInTemplate.kt +++ /dev/null @@ -1,7 +0,0 @@ -package foo - -fun box() : String { - var number = 3 - return ("my age is $number"); -} - diff --git a/translator/testFiles/expression/string/cases/multipleExpressionsInTemplate.kt b/translator/testFiles/expression/string/cases/multipleExpressionsInTemplate.kt deleted file mode 100644 index cede8ae7ef9..00000000000 --- a/translator/testFiles/expression/string/cases/multipleExpressionsInTemplate.kt +++ /dev/null @@ -1,8 +0,0 @@ -package foo - -fun box() : String { - var right = 2 - var left = 3 - return ("left = $left\nright = $right\nsum = ${left + right}\n"); -} - diff --git a/translator/testFiles/expression/string/cases/objectToStringCallInTemplate.kt b/translator/testFiles/expression/string/cases/objectToStringCallInTemplate.kt deleted file mode 100644 index 7eab5902391..00000000000 --- a/translator/testFiles/expression/string/cases/objectToStringCallInTemplate.kt +++ /dev/null @@ -1,18 +0,0 @@ -package foo - -class A(var i : Int) { - fun toString() = "a$i" -} - -fun box() : Boolean { - var p = A(2); - var n = A(1); - if ("$p$n" != "a2a1") { - return false; - } - if ("${A(10)}" != "a10") { - return false; - } - return true; -} - diff --git a/translator/testFiles/expression/string/cases/stringAssignment.kt b/translator/testFiles/expression/string/cases/stringAssignment.kt deleted file mode 100644 index 9f3c327965f..00000000000 --- a/translator/testFiles/expression/string/cases/stringAssignment.kt +++ /dev/null @@ -1,10 +0,0 @@ -package foo - -fun box() : Boolean { - - val a = "bar"; - var b = "foo"; - b = a; - return (b == "bar"); -} - diff --git a/translator/testFiles/expression/string/cases/stringConstant.kt b/translator/testFiles/expression/string/cases/stringConstant.kt deleted file mode 100644 index 9961104c902..00000000000 --- a/translator/testFiles/expression/string/cases/stringConstant.kt +++ /dev/null @@ -1,8 +0,0 @@ -package foo - -fun box() : Boolean { - - val a = "String"; - return true; -} - diff --git a/translator/testFiles/expression/string/cases/stringInTemplate.kt b/translator/testFiles/expression/string/cases/stringInTemplate.kt deleted file mode 100644 index 5a021f9aec2..00000000000 --- a/translator/testFiles/expression/string/cases/stringInTemplate.kt +++ /dev/null @@ -1,7 +0,0 @@ -package foo - -fun box() : String { - var name = "Hello" - return ("o${name}o"); -} - diff --git a/translator/testFiles/expression/string/out/.gitignore b/translator/testFiles/expression/string/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/expression/string/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/extensionFunction/cases/extensionFunctionOnExpression.kt b/translator/testFiles/extensionFunction/cases/extensionFunctionOnExpression.kt deleted file mode 100644 index 7b3c4b004da..00000000000 --- a/translator/testFiles/extensionFunction/cases/extensionFunctionOnExpression.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - -fun Int.same() : Int { - return this -} - -fun Int.quadruple() : Int { - return same() * 4; -} - -fun box(): Boolean { - return ((3 + 4).quadruple() == 28) -} diff --git a/translator/testFiles/extensionFunction/cases/extensionInsideFunctionLiteral.kt b/translator/testFiles/extensionFunction/cases/extensionInsideFunctionLiteral.kt deleted file mode 100644 index 9d69e2fd859..00000000000 --- a/translator/testFiles/extensionFunction/cases/extensionInsideFunctionLiteral.kt +++ /dev/null @@ -1,22 +0,0 @@ -package foo - -class M() { - var m = 0 - - fun eval() { - var d = { - var c = {Int.() -> this + 3} - m += 3.c() - } - d(); - } -} - -fun box() : Boolean { - var a = M() - if (a.m != 0) return false; - a.eval() - if (a.m != 6) return false; - - return true; -} \ No newline at end of file diff --git a/translator/testFiles/extensionFunction/cases/extensionLiteralPassedToFunction.kt b/translator/testFiles/extensionFunction/cases/extensionLiteralPassedToFunction.kt deleted file mode 100644 index 62bd16300a2..00000000000 --- a/translator/testFiles/extensionFunction/cases/extensionLiteralPassedToFunction.kt +++ /dev/null @@ -1,7 +0,0 @@ -package foo - -fun apply(i : Int, f : Int.(Int) -> Int) = i.f(1); - -fun box() : Boolean { - return (apply(1, {i -> i + this})) == 2 -} \ No newline at end of file diff --git a/translator/testFiles/extensionFunction/cases/extensionUsedInsideClass.kt b/translator/testFiles/extensionFunction/cases/extensionUsedInsideClass.kt deleted file mode 100644 index 7e345e3ad93..00000000000 --- a/translator/testFiles/extensionFunction/cases/extensionUsedInsideClass.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -class A(var a : Int) { - fun eval() = f(); -} - -fun A.f() : Int { - a = 3 - return 10 -} - -fun box(): Boolean { - val a = A(4) - return (a.eval() == 10) && (a.a == 3) -} diff --git a/translator/testFiles/extensionFunction/cases/extensionWithImplicitReceiver.kt b/translator/testFiles/extensionFunction/cases/extensionWithImplicitReceiver.kt deleted file mode 100644 index ccab0e9f2f5..00000000000 --- a/translator/testFiles/extensionFunction/cases/extensionWithImplicitReceiver.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - -fun Int.same() : Int { - return this -} - -fun Int.quadruple() : Int { - return same() * 4; -} - -fun box(): Boolean { - return (3.quadruple() == 12) -} \ No newline at end of file diff --git a/translator/testFiles/extensionFunction/cases/generic.kt b/translator/testFiles/extensionFunction/cases/generic.kt deleted file mode 100644 index d13147d5d22..00000000000 --- a/translator/testFiles/extensionFunction/cases/generic.kt +++ /dev/null @@ -1,24 +0,0 @@ -package foo - -import java.util.* - -fun ArrayList.findAll(predicate: (T) -> Boolean): ArrayList { - val result = ArrayList() - for(val t in this) { - if (predicate(t)) result.add(t) - } - return result -} - - -fun box(): String { - val list: ArrayList = ArrayList() - - list.add(2) - list.add(3) - list.add(5) - - - val m: ArrayList = list.findAll({(name: Int) -> name < 4}) - return if (m.size() == 2) "OK" else "fail" -} diff --git a/translator/testFiles/extensionFunction/cases/intExtension.kt b/translator/testFiles/extensionFunction/cases/intExtension.kt deleted file mode 100644 index 884014c87aa..00000000000 --- a/translator/testFiles/extensionFunction/cases/intExtension.kt +++ /dev/null @@ -1,9 +0,0 @@ -package foo - -fun Int.quadruple() : Int { - return this * 4; -} - -fun box(): Boolean { - return (3.quadruple() == 12) -} diff --git a/translator/testFiles/extensionFunction/cases/virtualExtension.kt b/translator/testFiles/extensionFunction/cases/virtualExtension.kt deleted file mode 100644 index 383c0191f5f..00000000000 --- a/translator/testFiles/extensionFunction/cases/virtualExtension.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -class A(var a : Int) { - - fun Int.modify() : Int { - return this * 3; - } - - fun eval() = a.modify(); -} - -fun box(): Boolean { - val a = A(4) - return (a.eval() == 12) -} diff --git a/translator/testFiles/extensionFunction/cases/virtualExtensionOverride.kt b/translator/testFiles/extensionFunction/cases/virtualExtensionOverride.kt deleted file mode 100644 index 78646fb4b38..00000000000 --- a/translator/testFiles/extensionFunction/cases/virtualExtensionOverride.kt +++ /dev/null @@ -1,20 +0,0 @@ -package foo - -open class A(var a : Int) { - - open fun Int.modify() : Int { - return this * 3; - } - - fun eval() = a.modify(); -} - -class B(a : Int) : A(a) { - override fun Int.modify() : Int { - return this - 2; - } -} - -fun box(): Boolean { - return (A(4).eval() == 12) && (A(2).eval() == 6) && (B(3).eval() == 1) -} diff --git a/translator/testFiles/extensionFunction/out/.gitignore b/translator/testFiles/extensionFunction/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/extensionFunction/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/extensionProperty/cases/absExtension.kt b/translator/testFiles/extensionProperty/cases/absExtension.kt deleted file mode 100644 index d0399758498..00000000000 --- a/translator/testFiles/extensionProperty/cases/absExtension.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo; - -val Double.abs : Double - get() = if (this > 0) this else -this - -fun box() : Boolean { - if (4.0.abs != 4.0) return false; - if ((-5.2).abs != 5.2) return false; - - return true; -} diff --git a/translator/testFiles/extensionProperty/cases/propertyWithGetterAndSetter.kt b/translator/testFiles/extensionProperty/cases/propertyWithGetterAndSetter.kt deleted file mode 100644 index aba51251279..00000000000 --- a/translator/testFiles/extensionProperty/cases/propertyWithGetterAndSetter.kt +++ /dev/null @@ -1,23 +0,0 @@ -package foo - -class Test() { - var a = 0 -} - -var Test.b : Int - get() = a * 3 - set(c : Int) { - a = c - 1 - } - -fun box() : Boolean { - val c = Test() - if (c.a != 0) return false; - if (c.b != 0) return false; - c.a = 3; - if (c.b != 9) return false; - c.b = 10; - if (c.a != 9) return false; - if (c.b != 27) return false; - return true; -} \ No newline at end of file diff --git a/translator/testFiles/extensionProperty/cases/simplePropertyWithGetter.kt b/translator/testFiles/extensionProperty/cases/simplePropertyWithGetter.kt deleted file mode 100644 index f073c5ce546..00000000000 --- a/translator/testFiles/extensionProperty/cases/simplePropertyWithGetter.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -val String.size : Int - get() = length - -val Int.quadruple : Int - get() = this * 4 - -fun box() : Boolean -{ - if ("1".size != 1) return false; - if ("11".size != 2) return false; - if (("121" + "123").size != 6) return false; - if (1.quadruple != 4) return false; - if (0.quadruple != 0) return false; - return true; -} \ No newline at end of file diff --git a/translator/testFiles/extensionProperty/out/.gitignore b/translator/testFiles/extensionProperty/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/extensionProperty/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/inheritance/cases/baseClassDefinedAfterDerived.kt b/translator/testFiles/inheritance/cases/baseClassDefinedAfterDerived.kt deleted file mode 100644 index 53a23fdc56e..00000000000 --- a/translator/testFiles/inheritance/cases/baseClassDefinedAfterDerived.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - - -class A() : B() { - -} - -open class B() { - - val a = 3 -} - -fun box() = (A().a == 3) \ No newline at end of file diff --git a/translator/testFiles/inheritance/cases/complexInitializationOrder.kt b/translator/testFiles/inheritance/cases/complexInitializationOrder.kt deleted file mode 100644 index 9004131ad03..00000000000 --- a/translator/testFiles/inheritance/cases/complexInitializationOrder.kt +++ /dev/null @@ -1,37 +0,0 @@ -package foo - -open class A() { - - var order = "" - { - order = order + "A" - } -} - -open class B() : A() { - { - order = order + "B" - } -} - -class C() : B() { - { - order = order + "C" - } -} - -class D() : B() { - { - order = order + "D" - } -} - -class E() : A() { - { - order = order + "E" - } -} - -fun box() : Boolean { - return (C().order == "ABC") && (D().order == "ABD") && (E().order == "AE") -} \ No newline at end of file diff --git a/translator/testFiles/inheritance/cases/definitionOrder.kt b/translator/testFiles/inheritance/cases/definitionOrder.kt deleted file mode 100644 index 12e3f7b045c..00000000000 --- a/translator/testFiles/inheritance/cases/definitionOrder.kt +++ /dev/null @@ -1,37 +0,0 @@ -package foo - -class C() : B() { - { - order = order + "C" - } -} - -class D() : B() { - { - order = order + "D" - } -} - -class E() : A() { - { - order = order + "E" - } -} - -open class B() : A() { - { - order = order + "B" - } -} - -open class A() { - - var order = "" - { - order = order + "A" - } -} - -fun box() : Boolean { - return (C().order == "ABC") && (D().order == "ABD") && (E().order == "AE") -} \ No newline at end of file diff --git a/translator/testFiles/inheritance/cases/initializationOrder.kt b/translator/testFiles/inheritance/cases/initializationOrder.kt deleted file mode 100644 index faf44b8ab6e..00000000000 --- a/translator/testFiles/inheritance/cases/initializationOrder.kt +++ /dev/null @@ -1,26 +0,0 @@ -package foo - -open class A() { - - var order = "" - { - order = order + "A" - } -} - -open class B() : A() { - { - order = order + "B" - } - -} - -class C() : B() { - { - order = order + "C" - } -} - -fun box() : Boolean { - return (C().order == "ABC") && (B().order == "AB") && (A().order == "A") -} \ No newline at end of file diff --git a/translator/testFiles/inheritance/cases/initializersOfBasicClassExecute.kt b/translator/testFiles/inheritance/cases/initializersOfBasicClassExecute.kt deleted file mode 100644 index 52176e10fbe..00000000000 --- a/translator/testFiles/inheritance/cases/initializersOfBasicClassExecute.kt +++ /dev/null @@ -1,13 +0,0 @@ -package foo - -open class A() { - var a = 3; -} - -class B() : A() { - -} - -fun box() : Int { - return (B().a) -} diff --git a/translator/testFiles/inheritance/cases/methodOverride.kt b/translator/testFiles/inheritance/cases/methodOverride.kt deleted file mode 100644 index 62feff89b9b..00000000000 --- a/translator/testFiles/inheritance/cases/methodOverride.kt +++ /dev/null @@ -1,15 +0,0 @@ -package foo - -open class C() { - open fun f(): Any = "C f" -} - -class D() : C() { - override fun f(): String = "D f" -} - -fun box(): Boolean { - val d : C = D() - if(d.f() != "D f") return false - return true -} \ No newline at end of file diff --git a/translator/testFiles/inheritance/cases/valuePassedToAncestorConstructor.kt b/translator/testFiles/inheritance/cases/valuePassedToAncestorConstructor.kt deleted file mode 100644 index 97795d7210f..00000000000 --- a/translator/testFiles/inheritance/cases/valuePassedToAncestorConstructor.kt +++ /dev/null @@ -1,12 +0,0 @@ -package foo - -open class C(a : Int) { - val b = a -} - -class D(c : Int) : C(c + 2) { -} - -fun box(): Boolean { - return (D(0).b == 2) -} \ No newline at end of file diff --git a/translator/testFiles/inheritance/out/.gitignore b/translator/testFiles/inheritance/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/inheritance/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/cases/access.kt b/translator/testFiles/java/arrayList/cases/access.kt deleted file mode 100644 index 58c151430c2..00000000000 --- a/translator/testFiles/java/arrayList/cases/access.kt +++ /dev/null @@ -1,10 +0,0 @@ -package foo - - import java.util.ArrayList; - - fun box() : Boolean { - val a = ArrayList(); - a.add(1) - a.add(2) - return (a.size() == 2) && (a.get(1) == 2) && (a.get(0) == 1); - } \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/cases/arrayAccess.kt b/translator/testFiles/java/arrayList/cases/arrayAccess.kt deleted file mode 100644 index b47cfa6e040..00000000000 --- a/translator/testFiles/java/arrayList/cases/arrayAccess.kt +++ /dev/null @@ -1,11 +0,0 @@ -package foo - -import java.util.ArrayList; - -fun box() : Boolean { - val a = ArrayList(); - a.add(1) - a.add(2) - a[1] = 100 - return (a.size() == 2) && (a[1] == 100) && (a[0] == 1); -} \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/cases/emptyList.kt b/translator/testFiles/java/arrayList/cases/emptyList.kt deleted file mode 100644 index ec624c39ad9..00000000000 --- a/translator/testFiles/java/arrayList/cases/emptyList.kt +++ /dev/null @@ -1,8 +0,0 @@ -package foo - -import java.util.ArrayList; - -fun box() : Boolean { - val a = ArrayList(); - return a.size() == 0; -} \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/cases/indexOOB.kt b/translator/testFiles/java/arrayList/cases/indexOOB.kt deleted file mode 100644 index 52d1f6936a7..00000000000 --- a/translator/testFiles/java/arrayList/cases/indexOOB.kt +++ /dev/null @@ -1,12 +0,0 @@ -package foo - -import java.util.ArrayList; - -fun box() : Boolean { - val arr = ArrayList(); - var i = 0; - while (i++ < 10) { - arr.add(i); - } - return (arr[10] == 11) -} \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/cases/isEmpty.kt b/translator/testFiles/java/arrayList/cases/isEmpty.kt deleted file mode 100644 index 7f9c7283f87..00000000000 --- a/translator/testFiles/java/arrayList/cases/isEmpty.kt +++ /dev/null @@ -1,9 +0,0 @@ -package foo - -import java.util.ArrayList; - -fun box() : Boolean { - val a = ArrayList(); - a.add(3) - return !(a.isEmpty()) && (ArrayList().isEmpty()); -} \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/cases/iterate.kt b/translator/testFiles/java/arrayList/cases/iterate.kt deleted file mode 100644 index 74da14b2f0a..00000000000 --- a/translator/testFiles/java/arrayList/cases/iterate.kt +++ /dev/null @@ -1,16 +0,0 @@ -package foo - -import java.util.ArrayList; - -fun box() : Boolean { - var i = 0 - val arr = ArrayList(); - while (i++ < 10) { - arr.add(i); - } - var sum = 0 - for (a in arr) { - sum += a; - } - return (sum == 55) && (arr.size() == 10) -} \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/cases/max.kt b/translator/testFiles/java/arrayList/cases/max.kt deleted file mode 100644 index 50098e82059..00000000000 --- a/translator/testFiles/java/arrayList/cases/max.kt +++ /dev/null @@ -1,8 +0,0 @@ -package foo - -import java.util.Collection; -import java.util.Comparator. - -fun max(col :Collection, ) { - -} \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/cases/remove.kt b/translator/testFiles/java/arrayList/cases/remove.kt deleted file mode 100644 index 20095823895..00000000000 --- a/translator/testFiles/java/arrayList/cases/remove.kt +++ /dev/null @@ -1,17 +0,0 @@ -package foo - -import java.util.ArrayList; - -fun box() : Boolean { - var i = 0 - val arr = ArrayList(); - while (i++ < 10) { - arr.add(i); - } - arr.remove(2) - var sum = 0 - for (a in arr) { - sum += a; - } - return ((sum == 52) && (arr[1] == 2) && (arr[2] == 4) && (arr[3] == 5) && (arr[4] == 6) && (arr[8] == 10)) -} \ No newline at end of file diff --git a/translator/testFiles/java/arrayList/out/.gitignore b/translator/testFiles/java/arrayList/out/.gitignore deleted file mode 100644 index 86d0cb2726c..00000000000 --- a/translator/testFiles/java/arrayList/out/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/translator/testFiles/kotlinLib/cases/array.js b/translator/testFiles/kotlinLib/cases/array.js deleted file mode 100644 index 0d2083c480c..00000000000 --- a/translator/testFiles/kotlinLib/cases/array.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -function test() { - var a = Kotlin.arrayFromFun(3, function () { - return 3 - }); - return (a[0] == 3) && (a[2] == 3) && (a[1] == 3); -} \ No newline at end of file diff --git a/translator/testFiles/kotlinLib/cases/commaExpression.js b/translator/testFiles/kotlinLib/cases/commaExpression.js deleted file mode 100644 index f3990bf315d..00000000000 --- a/translator/testFiles/kotlinLib/cases/commaExpression.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -a = 0 -f = (t = a, t1 = t, a = ++t1, t) - -test = function () { - return (f == 0) && (a == 1) -} \ No newline at end of file diff --git a/translator/testFiles/kotlinLib/cases/hashMap.js b/translator/testFiles/kotlinLib/cases/hashMap.js deleted file mode 100644 index 5b195c7600d..00000000000 --- a/translator/testFiles/kotlinLib/cases/hashMap.js +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var map = new Kotlin.HashMap() - -map.put(3, 4) -map.put(6, 3) - -function test() { - if (map.containsKey(4) || map.containsKey(5)) return false; - if (map.containsKey({}) || map.containsKey(11)) return false; - if (!map.containsKey(3) || !map.containsKey(6)) return false; - var obj = map.get(3); - if (obj !== 4) return false; - obj = map.get(6); - if (obj !== 3) return false; - if (map.size() !== 2) return false; - map.put(2, 3); - if (map.size() !== 3) return false; - if (!map.containsKey(2) || !map.containsKey(3) || !map.containsKey(6)) return false; - if (!map.containsValue(4) || !map.containsValue(3)) return false; - map.put(2, 1000); - if (map.size() !== 3) return false; - if (map.get(2)!== 1000) return false; - - - return true; -} \ No newline at end of file diff --git a/translator/testFiles/kotlinLib/cases/isAncestorType.js b/translator/testFiles/kotlinLib/cases/isAncestorType.js deleted file mode 100644 index 255b5891326..00000000000 --- a/translator/testFiles/kotlinLib/cases/isAncestorType.js +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var A = Kotlin.Class.create(); -var B = Kotlin.Class.create(A); -var b = new B; - -test = function() { - return (Kotlin.isType(b, A) && Kotlin.isType(b, B)); -} \ No newline at end of file diff --git a/translator/testFiles/kotlinLib/cases/isComplexTest.js b/translator/testFiles/kotlinLib/cases/isComplexTest.js deleted file mode 100644 index 92a4a2f29ff..00000000000 --- a/translator/testFiles/kotlinLib/cases/isComplexTest.js +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var A = Kotlin.Class.create(); -var B = Kotlin.Class.create(A); -var b = new B; -var C = Kotlin.Class.create(B); -var c = new C; -var E = Kotlin.Class.create(A) -var e = new E; - -test1 = function() { - b2 = b - return (Kotlin.isType(b, A) && Kotlin.isType(b, B)); -} - -test2 = function() { - return (Kotlin.isType(c, C) && Kotlin.isType(c, B) && Kotlin.isType(c, A) && (!Kotlin.isType(c, E))); -} - -test3 = function() { - return Kotlin.isType(e, E) && !Kotlin.isType(e, B) && !Kotlin.isType(e, C) && Kotlin.isType(e, A) -} - -test = function() { - return test1() && test2() && test3() -} \ No newline at end of file diff --git a/translator/testFiles/kotlinLib/cases/isNotOtherType.js b/translator/testFiles/kotlinLib/cases/isNotOtherType.js deleted file mode 100644 index b33ad3afab2..00000000000 --- a/translator/testFiles/kotlinLib/cases/isNotOtherType.js +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var A = Kotlin.Class.create(); -var B = Kotlin.Class.create(A); -var C = Kotlin.Class.create(); -var c = new C; - -test = function() { - return ((!isType(c, A)) && !isType(c, B)); -} \ No newline at end of file diff --git a/translator/testFiles/kotlinLib/cases/isSameType.js b/translator/testFiles/kotlinLib/cases/isSameType.js deleted file mode 100644 index cb333db25c5..00000000000 --- a/translator/testFiles/kotlinLib/cases/isSameType.js +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -var A = Kotlin.Class.create(); -var a = new A; - -test = function() { - return Kotlin.isType(a, A); -} \ No newline at end of file diff --git a/translator/testFiles/kotlinLib/cases/namespace.js b/translator/testFiles/kotlinLib/cases/namespace.js deleted file mode 100644 index eeb677033eb..00000000000 --- a/translator/testFiles/kotlinLib/cases/namespace.js +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -foo = Kotlin.Namespace.create({initialize:function(){ -} -, box:function(){ - return !false; -} -}); - -function test() { - return foo.box() -} diff --git a/translator/testFiles/kotlinLib/cases/namespaceWithClasses.js b/translator/testFiles/kotlinLib/cases/namespaceWithClasses.js deleted file mode 100644 index 0571b39e660..00000000000 --- a/translator/testFiles/kotlinLib/cases/namespaceWithClasses.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -{ - classes = function(){ - var A = Kotlin.Class.create({initialize:function(){ - this.$order = ''; - { - this.set_order(this.get_order() + 'A'); - } - } - , set_order:function(tmp$0){ - this.$order = tmp$0; - } - , get_order:function(){ - return this.$order; - } - }); - var B = Kotlin.Class.create(A, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'B'); - } - } - }); - var C = Kotlin.Class.create(B, {initialize:function(){ - this.super_init(); - { - this.set_order(this.get_order() + 'C'); - } - } - }); - return {A:A, B:B, C:C}; - } - (); - foo = Kotlin.Namespace.create(classes, {initialize:function(){ - } - , box:function(){ - return (new foo.C).get_order() === 'ABC' && (new foo.B).get_order() === 'AB' && (new foo.A).get_order() === 'A'; - } - }); -} - -function test() { - return foo.box() -} diff --git a/translator/testFiles/kotlinLib/cases/trait.js b/translator/testFiles/kotlinLib/cases/trait.js deleted file mode 100644 index 628dbbd52f2..00000000000 --- a/translator/testFiles/kotlinLib/cases/trait.js +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2000-2012 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -foo = {}; -(function(foo){ - foo.Test = Kotlin.Trait.create({addFoo:function(s){ - return s + 'FOO'; - } - }); - foo.ExtendedTest = Kotlin.Trait.create(foo.Test, {hooray:function(){ - return 'hooray'; - } - }); -} -(foo)); diff --git a/translator/testFiles/kotlin_lib.js b/translator/testFiles/kotlin_lib.js deleted file mode 100644 index 2d155d5a78c..00000000000 --- a/translator/testFiles/kotlin_lib.js +++ /dev/null @@ -1,1079 +0,0 @@ -/** - * Copyright 2010 Tim Down. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* Prototype JavaScript framework, version 1.6.1 - * (c) 2005-2009 Sam Stephenson - * - * Prototype is freely distributable under the terms of an MIT-style license. - * For details, see the Prototype web site: http://www.prototypejs.org/ - * - *--------------------------------------------------------------------------*/ -(function () { - - function $A(iterable) { - if (!iterable) return []; - if ('toArray' in Object(iterable)) return iterable.toArray(); - var length = iterable.length || 0, results = new Array(length); - while (length--) results[length] = iterable[length]; - return results; - } - - (function () { - - - function extend(destination, source) { - for (var property in source) - destination[property] = source[property]; - return destination; - } - - - function keys(object) { - if (Type(object) !== OBJECT_TYPE) { - throw new TypeError(); - } - var results = []; - for (var property in object) { - if (object.hasOwnProperty(property)) { - results.push(property); - } - } - return results; - } - - function values(object) { - var results = []; - for (var property in object) - results.push(object[property]); - return results; - } - - extend(Object, { - extend:extend, - keys:Object.keys || keys, - values:values - }); - })(); - - - Object.extend(Function.prototype, (function () { - var slice = Array.prototype.slice; - - function update(array, args) { - var arrayLength = array.length, length = args.length; - while (length--) array[arrayLength + length] = args[length]; - return array; - } - - function merge(array, args) { - array = slice.call(array, 0); - return update(array, args); - } - - function argumentNames() { - var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1] - .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '') - .replace(/\s+/g, '').split(','); - return names.length == 1 && !names[0] ? [] : names; - } - - function bind(context) { - if (arguments.length < 2 && Object.isUndefined(arguments[0])) return this; - var __method = this, args = slice.call(arguments, 1); - return function () { - var a = merge(args, arguments); - return __method.apply(context, a); - } - } - - function bindAsEventListener(context) { - var __method = this, args = slice.call(arguments, 1); - return function (event) { - var a = update([event || window.event], args); - return __method.apply(context, a); - } - } - - function wrap(wrapper) { - var __method = this; - return function () { - var a = update([__method.bind(this)], arguments); - return wrapper.apply(this, a); - } - } - - return { - argumentNames:argumentNames, - bind:bind, - bindAsEventListener:bindAsEventListener, - wrap:wrap - } - })()); - - var isType = function (object, klass) { - current = object.get_class(); - while (current !== klass) { - if (current === null) { - return false; - } - current = current.superclass; - } - return true; - }; - - var emptyFunction = function () { - }; - - var Class = (function () { - - function subclass() { - } - ; - function create() { - var parent = null, properties = $A(arguments); - if (typeof (properties[0]) == "function") { - parent = properties.shift(); - } - - function klass() { - this.initializing = klass; - this.initialize.apply(this, arguments); - } - - Object.extend(klass, Class.Methods); - klass.superclass = parent; - klass.subclasses = []; - - if (parent) { - subclass.prototype = parent.prototype; - klass.prototype = new subclass; - parent.subclasses.push(klass); - } - - klass.addMethods( - { - get_class:function () { - return klass; - } - }); - - if (parent != null) { - klass.addMethods( - { - super_init:function () { - this.initializing = this.initializing.superclass; - this.initializing.prototype.initialize.apply(this, arguments) - } - }); - } - - for (var i = 0, length = properties.length; i < length; i++) - klass.addMethods(properties[i]); - - if (!klass.prototype.initialize) { - klass.prototype.initialize = emptyFunction; - } - - klass.prototype.constructor = klass; - return klass; - } - - function addMethods(source) { - var ancestor = this.superclass && this.superclass.prototype, - properties = Object.keys(source); - - - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i], value = source[property]; - if (ancestor && (typeof (value) == "function") && - value.argumentNames()[0] == "$super") { - var method = value; - value = (function (m) { - return function () { - return ancestor[m].apply(this, arguments); - }; - })(property).wrap(method); - - } - this.prototype[property] = value; - } - - return this; - } - - return { - create:create, - Methods:{ - addMethods:addMethods - } - }; - })(); - - var Trait = (function () { - - function add(object, source) { - var properties = Object.keys(source); - for (var i = 0, length = properties.length; i < length; i++) { - var property = properties[i]; - var value = source[property]; - object[property] = value; - } - return this; - } - - function create() { - - result = {} - for (var i = 0, length = arguments.length; i < length; i++) { - add(result, arguments[i]); - } - return result; - } - - return { - create:create - }; - })(); - - - var Namespace = (function () { - - function create() { - return Trait.create.apply(Trait, arguments); - } - - return { - create:create - }; - })(); - - var object = (function () { - function create() { - var singletonClass = Class.create.apply(Class, arguments); - return new singletonClass; - } - return { - create:create - }; - })(); - - Kotlin = {}; - Kotlin.Class = Class; - Kotlin.Namespace = Namespace; - Kotlin.Trait = Trait; - Kotlin.isType = isType; - Kotlin.object = object; - - Kotlin.equals = function (obj1, obj2) { - if (typeof obj1 == "object") { - if (obj1.equals != undefined) { - return obj1.equals(obj2); - } - } - return (obj1 === obj2); - }; - - Kotlin.Exceptions = {} - Kotlin.Exception = Kotlin.Class.create(); - Kotlin.Exceptions.IndexOutOfBounds = {} - - - Kotlin.ArrayList = Class.create({ - initialize:function () { - this.array = []; - this.$size = 0; - }, - get:function (index) { - if ((index < 0) || (index >= this.$size)) { - throw Kotlin.Exceptions.IndexOutOfBounds; - } - return (this.array)[index]; - }, - set:function (index, value) { - if ((index < 0) || (index >= this.$size)) { - throw Kotlin.Exceptions.IndexOutOfBounds; - } - (this.array)[index] = value; - }, - size:function () { - return this.$size; - }, - iterator:function () { - return new Kotlin.ArrayIterator(this); - }, - isEmpty:function () { - return (this.$size == 0); - }, - add:function (element) { - this.array[this.$size++] = element; - }, - addAll:function (collection) { - var it = collection.iterator(); - while (it.hasNext()) { - this.add(it.next()); - } - }, - remove:function (index) { - for (var i = index; i < this.$size - 1; ++i) { - this.array[i] = this.array[i + 1]; - } - this.$size--; - }, - clear:function () { - this.array = []; - this.$size = 0; - }, - contains:function (obj) { - for (var i = 0; i < this.$size; ++i) { - if (Kotlin.equals(this.array[i], obj)) { - return true; - } - } - return false; - } - }); - - - Kotlin.parseInt = - function (str) { - return parseInt(str); - } - ; - - Kotlin.System = function () { - var output = ""; - - var print = function (obj) { - if (obj !== undefined) { - if (obj == null || typeof obj != "object") { - output += obj; - } - else { - output += obj.toString(); - } - } - }; - var println = function (obj) { - this.print(obj); - output += "\n"; - }; - - return { - out:function () { - return { - print:print, - println:println - }; - }, - output:function () { - return output; - }, - flush:function () { - output = ""; - } - }; - }(); - - Kotlin.println = function (s) { - Kotlin.System.out().println(s); - } - - Kotlin.print = function (s) { - Kotlin.System.out().print(s); - } - - Kotlin.AbstractFunctionInvokationError = Class.create(); - - Kotlin.Iterator = Class.create({ - initialize:function () { - }, - next:function () { - throw new Kotlin.AbstractFunctionInvokationError(); - }, - hasNext:function () { - throw new Kotlin.AbstractFunctionInvokationError(); - } - }); - - Kotlin.ArrayIterator = Class.create(Kotlin.Iterator, { - initialize:function (array) { - this.array = array; - this.index = 0; - }, - next:function () { - return this.array.get(this.index++); - }, - hasNext:function () { - return (this.array.size() > this.index); - }, - get_hasNext:function () { - return this.hasNext(); - } - }); - - Kotlin.RangeIterator = Kotlin.Class.create(Kotlin.Iterator, { - initialize:function (start, count, reversed) { - this.$start = start; - this.$count = count; - this.$reversed = reversed; - this.$i = this.get_start(); - }, get_start:function () { - return this.$start; - }, get_count:function () { - return this.$count; - }, set_count:function (tmp$0) { - this.$count = tmp$0; - }, get_reversed:function () { - return this.$reversed; - }, get_i:function () { - return this.$i; - }, set_i:function (tmp$0) { - this.$i = tmp$0; - }, next:function () { - this.set_count(this.get_count() - 1); - if (this.get_reversed()) { - this.set_i(this.get_i() - 1); - return this.get_i() + 1; - } - else { - this.set_i(this.get_i() + 1); - return this.get_i() - 1; - } - }, hasNext:function () { - return this.get_count() > 0; - }, get_hasNext:function () { - return this.hasNext(); - } - }); - - Kotlin.NumberRange = Kotlin.Class.create({initialize:function (start, size, reversed) { - this.$start = start; - this.$size = size; - this.$reversed = reversed; - }, get_start:function () { - return this.$start; - }, get_size:function () { - return this.$size; - }, get_reversed:function () { - return this.$reversed; - }, get_end:function () { - return this.get_reversed() ? this.get_start() - this.get_size() + 1 : this.get_start() + this.get_size() - 1; - }, contains:function (number) { - if (this.get_reversed()) { - return number <= this.get_start() && number > this.get_start() - this.get_size(); - } - else { - return number >= this.get_start() && number < this.get_start() + this.get_size(); - } - }, iterator:function () { - return new Kotlin.RangeIterator(this.get_start(), this.get_size(), this.get_reversed()); - } - }); - - Kotlin.Comparator = Kotlin.Class.create( - { - initialize:function () { - }, - compare:function (el1, el2) { - throw new Kotlin.AbstractFunctionInvokationError(); - } - } - ); - - Kotlin.comparator = function(f) { - var result = new Kotlin.Comparator; - result.compare = function(el1, el2) { - return f(el1, el2); - }; - return result; - }; - - Kotlin.collectionsMax = function (col, comp) { - var it = col.iterator(); - if (col.isEmpty()) { - //TODO: which exception? - throw Kotlin.Exception(); - } - var max = it.next(); - while (it.hasNext()) { - var el = it.next(); - if (comp.compare(max, el) < 0) { - max = el; - } - } - return max; - }; - - Kotlin.StringBuilder = Kotlin.Class.create( - { - initialize:function () { - this.string = ""; - }, - append:function (obj) { - this.string = this.string + obj.toString(); - }, - toString:function () { - return this.string; - } - } - ); - - Kotlin.splitString = function(str, regex) { - return str.split(regex); - }; - - Kotlin.nullArray = function (size) { - var res = []; - var i = size; - while (i > 0) { - res[--i] = null; - } - return res; - }; - - Kotlin.arrayFromFun = function (size, initFun) { - var res = []; - var i = size; - while (i > 0) { - res[--i] = initFun(i); - } - return res; - }; - - Kotlin.arrayIndices = function (arr) { - return new Kotlin.NumberRange(0, arr.length); - }; - - var intrinsicArrayIterator = Kotlin.Class.create( - Kotlin.Iterator, - { - initialize:function (arr) { - this.arr = arr; - this.len = arr.length; - this.i = 0; - }, - hasNext:function () { - return (this.i < this.len); - }, - next:function () { - return this.arr[this.i++]; - }, - get_hasNext:function () { - return this.hasNext() - } - } - ); - - Kotlin.arrayIterator = function (arr) { - return new intrinsicArrayIterator(arr); - }; - - Kotlin.toString = function (obj) { - return obj.toString(); - }; - - Kotlin.jsonFromTuples = function (pairArr) { - var i = pairArr.length; - var res = {}; - while (i > 0) { - --i; - res[pairArr[i][0]] = pairArr[i][1]; - } - return res; - }; - - Kotlin.jsonSet = function (obj, attrName, value) { - obj[attrName] = value; - }; - - Kotlin.jsonGet = function (obj, attrName) { - return obj[attrName]; - }; - - - Kotlin.sure = function(obj) { - return obj; - }; - - (function () { - var FUNCTION = "function"; - - var arrayRemoveAt = (typeof Array.prototype.splice == FUNCTION) ? - function (arr, idx) { - arr.splice(idx, 1); - } : - - function (arr, idx) { - var itemsAfterDeleted, i, len; - if (idx === arr.length - 1) { - arr.length = idx; - } - else { - itemsAfterDeleted = arr.slice(idx + 1); - arr.length = idx; - for (i = 0, len = itemsAfterDeleted.length; i < len; ++i) { - arr[idx + i] = itemsAfterDeleted[i]; - } - } - }; - - function hashObject(obj) { - var hashCode; - if (typeof obj == "string") { - return obj; - } else if (typeof obj.hashCode == FUNCTION) { - // Check the hashCode method really has returned a string - hashCode = obj.hashCode(); - return (typeof hashCode == "string") ? hashCode : hashObject(hashCode); - } else if (typeof obj.toString == FUNCTION) { - return obj.toString(); - } - else { - try { - return String(obj); - } catch (ex) { - // For host objects (such as ActiveObjects in IE) that have no toString() method and throw an error when - // passed to String() - return Object.prototype.toString.call(obj); - } - } - } - - function equals_fixedValueHasEquals(fixedValue, variableValue) { - return fixedValue.equals(variableValue); - } - - function equals_fixedValueNoEquals(fixedValue, variableValue) { - return (typeof variableValue.equals == FUNCTION) ? - variableValue.equals(fixedValue) : (fixedValue === variableValue); - } - - function createKeyValCheck(kvStr) { - return function (kv) { - if (kv === null) { - throw new Error("null is not a valid " + kvStr); - } else if (typeof kv == "undefined") { - throw new Error(kvStr + " must not be undefined"); - } - }; - } - - var checkKey = createKeyValCheck("key"), checkValue = createKeyValCheck("value"); - - /*----------------------------------------------------------------------------------------------------------------*/ - - function Bucket(hash, firstKey, firstValue, equalityFunction) { - this[0] = hash; - this.entries = []; - this.addEntry(firstKey, firstValue); - - if (equalityFunction !== null) { - this.getEqualityFunction = function () { - return equalityFunction; - }; - } - } - - var EXISTENCE = 0, ENTRY = 1, ENTRY_INDEX_AND_VALUE = 2; - - function createBucketSearcher(mode) { - return function (key) { - var i = this.entries.length, entry, equals = this.getEqualityFunction(key); - while (i--) { - entry = this.entries[i]; - if (equals(key, entry[0])) { - switch (mode) { - case EXISTENCE: - return true; - case ENTRY: - return entry; - case ENTRY_INDEX_AND_VALUE: - return [ i, entry[1] ]; - } - } - } - return false; - }; - } - - function createBucketLister(entryProperty) { - return function (aggregatedArr) { - var startIndex = aggregatedArr.length; - for (var i = 0, len = this.entries.length; i < len; ++i) { - aggregatedArr[startIndex + i] = this.entries[i][entryProperty]; - } - }; - } - - Bucket.prototype = { - getEqualityFunction:function (searchValue) { - return (typeof searchValue.equals == FUNCTION) ? equals_fixedValueHasEquals : equals_fixedValueNoEquals; - }, - - getEntryForKey:createBucketSearcher(ENTRY), - - getEntryAndIndexForKey:createBucketSearcher(ENTRY_INDEX_AND_VALUE), - - removeEntryForKey:function (key) { - var result = this.getEntryAndIndexForKey(key); - if (result) { - arrayRemoveAt(this.entries, result[0]); - return result[1]; - } - return null; - }, - - addEntry:function (key, value) { - this.entries[this.entries.length] = [key, value]; - }, - - keys:createBucketLister(0), - - values:createBucketLister(1), - - getEntries:function (entries) { - var startIndex = entries.length; - for (var i = 0, len = this.entries.length; i < len; ++i) { - // Clone the entry stored in the bucket before adding to array - entries[startIndex + i] = this.entries[i].slice(0); - } - }, - - containsKey:createBucketSearcher(EXISTENCE), - - containsValue:function (value) { - var i = this.entries.length; - while (i--) { - if (value === this.entries[i][1]) { - return true; - } - } - return false; - } - }; - - /*----------------------------------------------------------------------------------------------------------------*/ - - // Supporting functions for searching hashtable buckets - - function searchBuckets(buckets, hash) { - var i = buckets.length, bucket; - while (i--) { - bucket = buckets[i]; - if (hash === bucket[0]) { - return i; - } - } - return null; - } - - function getBucketForHash(bucketsByHash, hash) { - var bucket = bucketsByHash[hash]; - - // Check that this is a genuine bucket and not something inherited from the bucketsByHash's prototype - return ( bucket && (bucket instanceof Bucket) ) ? bucket : null; - } - - /*----------------------------------------------------------------------------------------------------------------*/ - - var Hashtable = function (hashingFunctionParam, equalityFunctionParam) { - var that = this; - var buckets = []; - var bucketsByHash = {}; - - var hashingFunction = (typeof hashingFunctionParam == FUNCTION) ? hashingFunctionParam : hashObject; - var equalityFunction = (typeof equalityFunctionParam == FUNCTION) ? equalityFunctionParam : null; - - this.put = function (key, value) { - checkKey(key); - checkValue(value); - var hash = hashingFunction(key), bucket, bucketEntry, oldValue = null; - - // Check if a bucket exists for the bucket key - bucket = getBucketForHash(bucketsByHash, hash); - if (bucket) { - // Check this bucket to see if it already contains this key - bucketEntry = bucket.getEntryForKey(key); - if (bucketEntry) { - // This bucket entry is the current mapping of key to value, so replace old value and we're done. - oldValue = bucketEntry[1]; - bucketEntry[1] = value; - } - else { - // The bucket does not contain an entry for this key, so add one - bucket.addEntry(key, value); - } - } - else { - // No bucket exists for the key, so create one and put our key/value mapping in - bucket = new Bucket(hash, key, value, equalityFunction); - buckets[buckets.length] = bucket; - bucketsByHash[hash] = bucket; - } - return oldValue; - }; - - this.get = function (key) { - checkKey(key); - - var hash = hashingFunction(key); - - // Check if a bucket exists for the bucket key - var bucket = getBucketForHash(bucketsByHash, hash); - if (bucket) { - // Check this bucket to see if it contains this key - var bucketEntry = bucket.getEntryForKey(key); - if (bucketEntry) { - // This bucket entry is the current mapping of key to value, so return the value. - return bucketEntry[1]; - } - } - return null; - }; - - this.containsKey = function (key) { - checkKey(key); - var bucketKey = hashingFunction(key); - - // Check if a bucket exists for the bucket key - var bucket = getBucketForHash(bucketsByHash, bucketKey); - - return bucket ? bucket.containsKey(key) : false; - }; - - this.containsValue = function (value) { - checkValue(value); - var i = buckets.length; - while (i--) { - if (buckets[i].containsValue(value)) { - return true; - } - } - return false; - }; - - this.clear = function () { - buckets.length = 0; - bucketsByHash = {}; - }; - - this.isEmpty = function () { - return !buckets.length; - }; - - var createBucketAggregator = function (bucketFuncName) { - return function () { - var aggregated = [], i = buckets.length; - while (i--) { - buckets[i][bucketFuncName](aggregated); - } - return aggregated; - }; - }; - - this.keys = createBucketAggregator("keys"); - this.values = createBucketAggregator("values"); - this.entries = createBucketAggregator("getEntries"); - - this.remove = function (key) { - checkKey(key); - - var hash = hashingFunction(key), bucketIndex, oldValue = null; - - // Check if a bucket exists for the bucket key - var bucket = getBucketForHash(bucketsByHash, hash); - - if (bucket) { - // Remove entry from this bucket for this key - oldValue = bucket.removeEntryForKey(key); - if (oldValue !== null) { - // Entry was removed, so check if bucket is empty - if (!bucket.entries.length) { - // Bucket is empty, so remove it from the bucket collections - bucketIndex = searchBuckets(buckets, hash); - arrayRemoveAt(buckets, bucketIndex); - delete bucketsByHash[hash]; - } - } - } - return oldValue; - }; - - this.size = function () { - var total = 0, i = buckets.length; - while (i--) { - total += buckets[i].entries.length; - } - return total; - }; - - this.each = function (callback) { - var entries = that.entries(), i = entries.length, entry; - while (i--) { - entry = entries[i]; - callback(entry[0], entry[1]); - } - }; - - - this.putAll = function (hashtable, conflictCallback) { - var entries = hashtable.entries(); - var entry, key, value, thisValue, i = entries.length; - var hasConflictCallback = (typeof conflictCallback == FUNCTION); - while (i--) { - entry = entries[i]; - key = entry[0]; - value = entry[1]; - - // Check for a conflict. The default behaviour is to overwrite the value for an existing key - if (hasConflictCallback && (thisValue = that.get(key))) { - value = conflictCallback(key, thisValue, value); - } - that.put(key, value); - } - }; - - this.clone = function () { - var clone = new Hashtable(hashingFunctionParam, equalityFunctionParam); - clone.putAll(that); - return clone; - }; - - this.keySet = function () { - var res = new Kotlin.HashSet(); - var keys = this.keys(); - var i = keys.length; - while (i--) { - res.add(keys[i]); - } - return res; - } - }; - - Kotlin.HashTable = Hashtable; - })(); - - Kotlin.HashMap = Kotlin.Class.create( - { - initialize:function () { - Kotlin.HashTable.call(this); - } - } - ); - - - - - (function () { - function HashSet(hashingFunction, equalityFunction) { - var hashTable = new Kotlin.HashTable(hashingFunction, equalityFunction); - - this.add = function (o) { - hashTable.put(o, true); - }; - - this.addAll = function (arr) { - var i = arr.length; - while (i--) { - hashTable.put(arr[i], true); - } - }; - - this.values = function () { - return hashTable.keys(); - }; - - this.iterator = function () { - var list = new Kotlin.ArrayList(); - var values = this.values(); - var i = values.length; - while (i--) { - list.add(values[i]); - } - return list.iterator(); - }; - - this.remove = function (o) { - return hashTable.remove(o) ? o : null; - }; - - this.contains = function (o) { - return hashTable.containsKey(o); - }; - - this.clear = function () { - hashTable.clear(); - }; - - this.size = function () { - return hashTable.size(); - }; - - this.isEmpty = function () { - return hashTable.isEmpty(); - }; - - this.clone = function () { - var h = new HashSet(hashingFunction, equalityFunction); - h.addAll(hashTable.keys()); - return h; - }; - - this.intersection = function (hashSet) { - var intersection = new HashSet(hashingFunction, equalityFunction); - var values = hashSet.values(), i = values.length, val; - while (i--) { - val = values[i]; - if (hashTable.containsKey(val)) { - intersection.add(val); - } - } - return intersection; - }; - - this.union = function (hashSet) { - var union = this.clone(); - var values = hashSet.values(), i = values.length, val; - while (i--) { - val = values[i]; - if (!hashTable.containsKey(val)) { - union.add(val); - } - } - return union; - }; - - this.isSubsetOf = function (hashSet) { - var values = hashTable.keys(), i = values.length; - while (i--) { - if (!hashSet.contains(values[i])) { - return false; - } - } - return true; - }; - } - - Kotlin.HashSet = Kotlin.Class.create( - { - initialize:function () { - HashSet.call(this); - } - } - ) - }()); - -})(); diff --git a/translator/testFiles/libImplementations/jQuery.js b/translator/testFiles/libImplementations/jQuery.js deleted file mode 100644 index 3c9ea9e5649..00000000000 --- a/translator/testFiles/libImplementations/jQuery.js +++ /dev/null @@ -1,9300 +0,0 @@ -/*! - * jQuery JavaScript Library v1.7 - * http://jquery.com/ - * - * Copyright 2011, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Thu Nov 3 16:18:21 2011 -0400 - */ -(function( window, undefined ) { - -// Use the correct document accordingly with window argument (sandbox) -var document = window.document, - navigator = window.navigator, - location = window.location; -var jQuery = (function() { - -// Define a local copy of jQuery -var jQuery = function( selector, context ) { - // The jQuery object is actually just the init constructor 'enhanced' - return new jQuery.fn.init( selector, context, rootjQuery ); - }, - - // Map over jQuery in case of overwrite - _jQuery = window.jQuery, - - // Map over the $ in case of overwrite - _$ = window.$, - - // A central reference to the root jQuery(document) - rootjQuery, - - // A simple way to check for HTML strings or ID strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/, - - // Check if a string has a non-whitespace character in it - rnotwhite = /\S/, - - // Used for trimming whitespace - trimLeft = /^\s+/, - trimRight = /\s+$/, - - // Check for digits - rdigit = /\d/, - - // Match a standalone tag - rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, - - // JSON RegExp - rvalidchars = /^[\],:{}\s]*$/, - rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, - rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, - rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, - - // Useragent RegExp - rwebkit = /(webkit)[ \/]([\w.]+)/, - ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, - rmsie = /(msie) ([\w.]+)/, - rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, - - // Matches dashed string for camelizing - rdashAlpha = /-([a-z]|[0-9])/ig, - rmsPrefix = /^-ms-/, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return ( letter + "" ).toUpperCase(); - }, - - // Keep a UserAgent string for use with jQuery.browser - userAgent = navigator.userAgent, - - // For matching the engine and version of the browser - browserMatch, - - // The deferred used on DOM ready - readyList, - - // The ready event handler - DOMContentLoaded, - - // Save a reference to some core methods - toString = Object.prototype.toString, - hasOwn = Object.prototype.hasOwnProperty, - push = Array.prototype.push, - slice = Array.prototype.slice, - trim = String.prototype.trim, - indexOf = Array.prototype.indexOf, - - // [[Class]] -> type pairs - class2type = {}; - -jQuery.fn = jQuery.prototype = { - constructor: jQuery, - init: function( selector, context, rootjQuery ) { - var match, elem, ret, doc; - - // Handle $(""), $(null), or $(undefined) - if ( !selector ) { - return this; - } - - // Handle $(DOMElement) - if ( selector.nodeType ) { - this.context = this[0] = selector; - this.length = 1; - return this; - } - - // The body element only exists once, optimize finding it - if ( selector === "body" && !context && document.body ) { - this.context = document; - this[0] = document.body; - this.selector = selector; - this.length = 1; - return this; - } - - // Handle HTML strings - if ( typeof selector === "string" ) { - // Are we dealing with HTML string or an ID? - if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { - // Assume that strings that start and end with <> are HTML and skip the regex check - match = [ null, selector, null ]; - - } else { - match = quickExpr.exec( selector ); - } - - // Verify a match, and that no context was specified for #id - if ( match && (match[1] || !context) ) { - - // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; - doc = ( context ? context.ownerDocument || context : document ); - - // If a single string is passed in and it's a single tag - // just do a createElement and skip the rest - ret = rsingleTag.exec( selector ); - - if ( ret ) { - if ( jQuery.isPlainObject( context ) ) { - selector = [ document.createElement( ret[1] ) ]; - jQuery.fn.attr.call( selector, context, true ); - - } else { - selector = [ doc.createElement( ret[1] ) ]; - } - - } else { - ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); - selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes; - } - - return jQuery.merge( this, selector ); - - // HANDLE: $("#id") - } else { - elem = document.getElementById( match[2] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[2] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[0] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return rootjQuery.ready( selector ); - } - - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - - return jQuery.makeArray( selector, this ); - }, - - // Start with an empty selector - selector: "", - - // The current version of jQuery being used - jquery: "1.7", - - // The default length of a jQuery object is 0 - length: 0, - - // The number of elements contained in the matched element set - size: function() { - return this.length; - }, - - toArray: function() { - return slice.call( this, 0 ); - }, - - // Get the Nth element in the matched element set OR - // Get the whole matched element set as a clean array - get: function( num ) { - return num == null ? - - // Return a 'clean' array - this.toArray() : - - // Return just the object - ( num < 0 ? this[ this.length + num ] : this[ num ] ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems, name, selector ) { - // Build a new jQuery matched element set - var ret = this.constructor(); - - if ( jQuery.isArray( elems ) ) { - push.apply( ret, elems ); - - } else { - jQuery.merge( ret, elems ); - } - - // Add the old object onto the stack (as a reference) - ret.prevObject = this; - - ret.context = this.context; - - if ( name === "find" ) { - ret.selector = this.selector + ( this.selector ? " " : "" ) + selector; - } else if ( name ) { - ret.selector = this.selector + "." + name + "(" + selector + ")"; - } - - // Return the newly-formed element set - return ret; - }, - - // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); - }, - - ready: function( fn ) { - // Attach the listeners - jQuery.bindReady(); - - // Add the callback - readyList.add( fn ); - - return this; - }, - - eq: function( i ) { - return i === -1 ? - this.slice( i ) : - this.slice( i, +i + 1 ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ), - "slice", slice.call(arguments).join(",") ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { - return callback.call( elem, i, elem ); - })); - }, - - end: function() { - return this.prevObject || this.constructor(null); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: [].sort, - splice: [].splice -}; - -// Give the init function the jQuery prototype for later instantiation -jQuery.fn.init.prototype = jQuery.fn; - -jQuery.extend = jQuery.fn.extend = function() { - var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - target = arguments[1] || {}; - // skip the boolean and the target - i = 2; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( length === i ) { - target = this; - --i; - } - - for ( ; i < length; i++ ) { - // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( target === copy ) { - continue; - } - - // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; - - } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend({ - noConflict: function( deep ) { - if ( window.$ === jQuery ) { - window.$ = _$; - } - - if ( deep && window.jQuery === jQuery ) { - window.jQuery = _jQuery; - } - - return jQuery; - }, - - // Is the DOM ready to be used? Set to true once it occurs. - isReady: false, - - // A counter to track how many items to wait for before - // the ready event fires. See #6781 - readyWait: 1, - - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - - // Handle when the DOM is ready - ready: function( wait ) { - // Either a released hold or an DOMready/load event and not yet ready - if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( !document.body ) { - return setTimeout( jQuery.ready, 1 ); - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // If there are functions bound, to execute - readyList.fireWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.trigger ) { - jQuery( document ).trigger( "ready" ).unbind( "ready" ); - } - } - }, - - bindReady: function() { - if ( readyList ) { - return; - } - - readyList = jQuery.Callbacks( "once memory" ); - - // Catch cases where $(document).ready() is called after the - // browser event has already occurred. - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - return setTimeout( jQuery.ready, 1 ); - } - - // Mozilla, Opera and webkit nightlies currently support this event - if ( document.addEventListener ) { - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", jQuery.ready, false ); - - // If IE event model is used - } else if ( document.attachEvent ) { - // ensure firing before onload, - // maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", DOMContentLoaded ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", jQuery.ready ); - - // If IE and not a frame - // continually check to see if the document is ready - var toplevel = false; - - try { - toplevel = window.frameElement == null; - } catch(e) {} - - if ( document.documentElement.doScroll && toplevel ) { - doScrollCheck(); - } - } - }, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type(obj) === "array"; - }, - - // A crude way of determining if an object is a window - isWindow: function( obj ) { - return obj && typeof obj === "object" && "setInterval" in obj; - }, - - isNumeric: function( obj ) { - return obj != null && rdigit.test( obj ) && !isNaN( obj ); - }, - - type: function( obj ) { - return obj == null ? - String( obj ) : - class2type[ toString.call(obj) ] || "object"; - }, - - isPlainObject: function( obj ) { - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call(obj, "constructor") && - !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { - return false; - } - } catch ( e ) { - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - - var key; - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - isEmptyObject: function( obj ) { - for ( var name in obj ) { - return false; - } - return true; - }, - - error: function( msg ) { - throw msg; - }, - - parseJSON: function( data ) { - if ( typeof data !== "string" || !data ) { - return null; - } - - // Make sure leading/trailing whitespace is removed (IE can't handle it) - data = jQuery.trim( data ); - - // Attempt to parse using the native JSON parser first - if ( window.JSON && window.JSON.parse ) { - return window.JSON.parse( data ); - } - - // Make sure the incoming data is actual JSON - // Logic borrowed from http://json.org/json2.js - if ( rvalidchars.test( data.replace( rvalidescape, "@" ) - .replace( rvalidtokens, "]" ) - .replace( rvalidbraces, "")) ) { - - return ( new Function( "return " + data ) )(); - - } - jQuery.error( "Invalid JSON: " + data ); - }, - - // Cross-browser xml parsing - parseXML: function( data ) { - var xml, tmp; - try { - if ( window.DOMParser ) { // Standard - tmp = new DOMParser(); - xml = tmp.parseFromString( data , "text/xml" ); - } else { // IE - xml = new ActiveXObject( "Microsoft.XMLDOM" ); - xml.async = "false"; - xml.loadXML( data ); - } - } catch( e ) { - xml = undefined; - } - if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { - jQuery.error( "Invalid XML: " + data ); - } - return xml; - }, - - noop: function() {}, - - // Evaluates a script in a global context - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && rnotwhite.test( data ) ) { - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); - }, - - // args is for internal usage only - each: function( object, callback, args ) { - var name, i = 0, - length = object.length, - isObj = length === undefined || jQuery.isFunction( object ); - - if ( args ) { - if ( isObj ) { - for ( name in object ) { - if ( callback.apply( object[ name ], args ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.apply( object[ i++ ], args ) === false ) { - break; - } - } - } - - // A special, fast, case for the most common use of each - } else { - if ( isObj ) { - for ( name in object ) { - if ( callback.call( object[ name ], name, object[ name ] ) === false ) { - break; - } - } - } else { - for ( ; i < length; ) { - if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) { - break; - } - } - } - } - - return object; - }, - - // Use native String.trim function wherever possible - trim: trim ? - function( text ) { - return text == null ? - "" : - trim.call( text ); - } : - - // Otherwise use our own trimming functionality - function( text ) { - return text == null ? - "" : - text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); - }, - - // results is for internal usage only - makeArray: function( array, results ) { - var ret = results || []; - - if ( array != null ) { - // The window, strings (and functions) also have 'length' - // The extra typeof function check is to prevent crashes - // in Safari 2 (See: #3039) - // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 - var type = jQuery.type( array ); - - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { - push.call( ret, array ); - } else { - jQuery.merge( ret, array ); - } - } - - return ret; - }, - - inArray: function( elem, array, i ) { - var len; - - if ( array ) { - if ( indexOf ) { - return indexOf.call( array, elem, i ); - } - - len = array.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - // Skip accessing in sparse arrays - if ( i in array && array[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var i = first.length, - j = 0; - - if ( typeof second.length === "number" ) { - for ( var l = second.length; j < l; j++ ) { - first[ i++ ] = second[ j ]; - } - - } else { - while ( second[j] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, inv ) { - var ret = [], retVal; - inv = !!inv; - - // Go through the array, only saving the items - // that pass the validator function - for ( var i = 0, length = elems.length; i < length; i++ ) { - retVal = !!callback( elems[ i ], i ); - if ( inv !== retVal ) { - ret.push( elems[ i ] ); - } - } - - return ret; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var value, key, ret = [], - i = 0, - length = elems.length, - // jquery objects are treated as arrays - isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ; - - // Go through the array, translating each of the items to their - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - - // Go through every key on the object, - } else { - for ( key in elems ) { - value = callback( elems[ key ], key, arg ); - - if ( value != null ) { - ret[ ret.length ] = value; - } - } - } - - // Flatten any nested arrays - return ret.concat.apply( [], ret ); - }, - - // A global GUID counter for objects - guid: 1, - - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - if ( typeof context === "string" ) { - var tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - var args = slice.call( arguments, 2 ), - proxy = function() { - return fn.apply( context, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; - - return proxy; - }, - - // Mutifunctional method to get and set values to a collection - // The value/s can optionally be executed if it's a function - access: function( elems, key, value, exec, fn, pass ) { - var length = elems.length; - - // Setting many attributes - if ( typeof key === "object" ) { - for ( var k in key ) { - jQuery.access( elems, k, key[k], exec, fn, value ); - } - return elems; - } - - // Setting one attribute - if ( value !== undefined ) { - // Optionally, function values get executed if exec is true - exec = !pass && exec && jQuery.isFunction(value); - - for ( var i = 0; i < length; i++ ) { - fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); - } - - return elems; - } - - // Getting an attribute - return length ? fn( elems[0], key ) : undefined; - }, - - now: function() { - return ( new Date() ).getTime(); - }, - - // Use of jQuery.browser is frowned upon. - // More details: http://docs.jquery.com/Utilities/jQuery.browser - uaMatch: function( ua ) { - ua = ua.toLowerCase(); - - var match = rwebkit.exec( ua ) || - ropera.exec( ua ) || - rmsie.exec( ua ) || - ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || - []; - - return { browser: match[1] || "", version: match[2] || "0" }; - }, - - sub: function() { - function jQuerySub( selector, context ) { - return new jQuerySub.fn.init( selector, context ); - } - jQuery.extend( true, jQuerySub, this ); - jQuerySub.superclass = this; - jQuerySub.fn = jQuerySub.prototype = this(); - jQuerySub.fn.constructor = jQuerySub; - jQuerySub.sub = this.sub; - jQuerySub.fn.init = function init( selector, context ) { - if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) { - context = jQuerySub( context ); - } - - return jQuery.fn.init.call( this, selector, context, rootjQuerySub ); - }; - jQuerySub.fn.init.prototype = jQuerySub.fn; - var rootjQuerySub = jQuerySub(document); - return jQuerySub; - }, - - browser: {} -}); - -// Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); - -browserMatch = jQuery.uaMatch( userAgent ); -if ( browserMatch.browser ) { - jQuery.browser[ browserMatch.browser ] = true; - jQuery.browser.version = browserMatch.version; -} - -// Deprecated, use jQuery.browser.webkit instead -if ( jQuery.browser.webkit ) { - jQuery.browser.safari = true; -} - -// IE doesn't match non-breaking spaces with \s -if ( rnotwhite.test( "\xA0" ) ) { - trimLeft = /^[\s\xA0]+/; - trimRight = /[\s\xA0]+$/; -} - -// All jQuery objects should point back to these -rootjQuery = jQuery(document); - -// Cleanup functions for the document ready method -if ( document.addEventListener ) { - DOMContentLoaded = function() { - document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); - jQuery.ready(); - }; - -} else if ( document.attachEvent ) { - DOMContentLoaded = function() { - // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). - if ( document.readyState === "complete" ) { - document.detachEvent( "onreadystatechange", DOMContentLoaded ); - jQuery.ready(); - } - }; -} - -// The DOM ready check for Internet Explorer -function doScrollCheck() { - if ( jQuery.isReady ) { - return; - } - - try { - // If IE is used, use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - document.documentElement.doScroll("left"); - } catch(e) { - setTimeout( doScrollCheck, 1 ); - return; - } - - // and execute any waiting functions - jQuery.ready(); -} - -// Expose jQuery as an AMD module, but only for AMD loaders that -// understand the issues with loading multiple versions of jQuery -// in a page that all might call define(). The loader will indicate -// they have special allowances for multiple jQuery versions by -// specifying define.amd.jQuery = true. Register as a named module, -// since jQuery can be concatenated with other files that may use define, -// but not use a proper concatenation script that understands anonymous -// AMD modules. A named AMD is safest and most robust way to register. -// Lowercase jquery is used because AMD module names are derived from -// file names, and jQuery is normally delivered in a lowercase file name. -if ( typeof define === "function" && define.amd && define.amd.jQuery ) { - define( "jquery", [], function () { return jQuery; } ); -} - -return jQuery; - -})(); - - -// String to Object flags format cache -var flagsCache = {}; - -// Convert String-formatted flags into Object-formatted ones and store in cache -function createFlags( flags ) { - var object = flagsCache[ flags ] = {}, - i, length; - flags = flags.split( /\s+/ ); - for ( i = 0, length = flags.length; i < length; i++ ) { - object[ flags[i] ] = true; - } - return object; -} - -/* - * Create a callback list using the following parameters: - * - * flags: an optional list of space-separated flags that will change how - * the callback list behaves - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible flags: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( flags ) { - - // Convert flags from String-formatted to Object-formatted - // (we check in cache first) - flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {}; - - var // Actual callback list - list = [], - // Stack of fire calls for repeatable lists - stack = [], - // Last fire value (for non-forgettable lists) - memory, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, - // Add one or several callbacks to the list - add = function( args ) { - var i, - length, - elem, - type, - actual; - for ( i = 0, length = args.length; i < length; i++ ) { - elem = args[ i ]; - type = jQuery.type( elem ); - if ( type === "array" ) { - // Inspect recursively - add( elem ); - } else if ( type === "function" ) { - // Add if not in unique mode and callback is not in - if ( !flags.unique || !self.has( elem ) ) { - list.push( elem ); - } - } - } - }, - // Fire callbacks - fire = function( context, args ) { - args = args || []; - memory = !flags.memory || [ context, args ]; - firing = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) { - memory = true; // Mark as halted - break; - } - } - firing = false; - if ( list ) { - if ( !flags.once ) { - if ( stack && stack.length ) { - memory = stack.shift(); - self.fireWith( memory[ 0 ], memory[ 1 ] ); - } - } else if ( memory === true ) { - self.disable(); - } else { - list = []; - } - } - }, - // Actual Callbacks object - self = { - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - var length = list.length; - add( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away, unless previous - // firing was halted (stopOnFalse) - } else if ( memory && memory !== true ) { - firingStart = length; - fire( memory[ 0 ], memory[ 1 ] ); - } - } - return this; - }, - // Remove a callback from the list - remove: function() { - if ( list ) { - var args = arguments, - argIndex = 0, - argLength = args.length; - for ( ; argIndex < argLength ; argIndex++ ) { - for ( var i = 0; i < list.length; i++ ) { - if ( args[ argIndex ] === list[ i ] ) { - // Handle firingIndex and firingLength - if ( firing ) { - if ( i <= firingLength ) { - firingLength--; - if ( i <= firingIndex ) { - firingIndex--; - } - } - } - // Remove the element - list.splice( i--, 1 ); - // If we have some unicity property then - // we only need to do this once - if ( flags.unique ) { - break; - } - } - } - } - } - return this; - }, - // Control if a given callback is in the list - has: function( fn ) { - if ( list ) { - var i = 0, - length = list.length; - for ( ; i < length; i++ ) { - if ( fn === list[ i ] ) { - return true; - } - } - } - return false; - }, - // Remove all callbacks from the list - empty: function() { - list = []; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory || memory === true ) { - self.disable(); - } - return this; - }, - // Is it locked? - locked: function() { - return !stack; - }, - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( stack ) { - if ( firing ) { - if ( !flags.once ) { - stack.push( [ context, args ] ); - } - } else if ( !( flags.once && memory ) ) { - fire( context, args ); - } - } - return this; - }, - // Call all the callbacks with the given arguments - fire: function() { - self.fireWith( this, arguments ); - return this; - }, - // To know if the callbacks have already been called at least once - fired: function() { - return !!memory; - } - }; - - return self; -}; - - - - -var // Static reference to slice - sliceDeferred = [].slice; - -jQuery.extend({ - - Deferred: function( func ) { - var doneList = jQuery.Callbacks( "once memory" ), - failList = jQuery.Callbacks( "once memory" ), - progressList = jQuery.Callbacks( "memory" ), - state = "pending", - lists = { - resolve: doneList, - reject: failList, - notify: progressList - }, - promise = { - done: doneList.add, - fail: failList.add, - progress: progressList.add, - - state: function() { - return state; - }, - - // Deprecated - isResolved: doneList.fired, - isRejected: failList.fired, - - then: function( doneCallbacks, failCallbacks, progressCallbacks ) { - deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks ); - return this; - }, - always: function() { - return deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments ); - }, - pipe: function( fnDone, fnFail, fnProgress ) { - return jQuery.Deferred(function( newDefer ) { - jQuery.each( { - done: [ fnDone, "resolve" ], - fail: [ fnFail, "reject" ], - progress: [ fnProgress, "notify" ] - }, function( handler, data ) { - var fn = data[ 0 ], - action = data[ 1 ], - returned; - if ( jQuery.isFunction( fn ) ) { - deferred[ handler ](function() { - returned = fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify ); - } else { - newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] ); - } - }); - } else { - deferred[ handler ]( newDefer[ action ] ); - } - }); - }).promise(); - }, - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - if ( obj == null ) { - obj = promise; - } else { - for ( var key in promise ) { - obj[ key ] = promise[ key ]; - } - } - return obj; - } - }, - deferred = promise.promise({}), - key; - - for ( key in lists ) { - deferred[ key ] = lists[ key ].fire; - deferred[ key + "With" ] = lists[ key ].fireWith; - } - - // Handle state - deferred.done( function() { - state = "resolved"; - }, failList.disable, progressList.lock ).fail( function() { - state = "rejected"; - }, doneList.disable, progressList.lock ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( firstParam ) { - var args = sliceDeferred.call( arguments, 0 ), - i = 0, - length = args.length, - pValues = new Array( length ), - count = length, - pCount = length, - deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ? - firstParam : - jQuery.Deferred(), - promise = deferred.promise(); - function resolveFunc( i ) { - return function( value ) { - args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - if ( !( --count ) ) { - deferred.resolveWith( deferred, args ); - } - }; - } - function progressFunc( i ) { - return function( value ) { - pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value; - deferred.notifyWith( promise, pValues ); - }; - } - if ( length > 1 ) { - for ( ; i < length; i++ ) { - if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) { - args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) ); - } else { - --count; - } - } - if ( !count ) { - deferred.resolveWith( deferred, args ); - } - } else if ( deferred !== firstParam ) { - deferred.resolveWith( deferred, length ? [ firstParam ] : [] ); - } - return promise; - } -}); - - - - -jQuery.support = (function() { - - var div = document.createElement( "div" ), - documentElement = document.documentElement, - all, - a, - select, - opt, - input, - marginDiv, - support, - fragment, - body, - testElementParent, - testElement, - testElementStyle, - tds, - events, - eventName, - i, - isSupported; - - // Preliminary tests - div.setAttribute("className", "t"); - div.innerHTML = "
a

"; - - - all = div.getElementsByTagName( "*" ); - a = div.getElementsByTagName( "a" )[ 0 ]; - - // Can't get basic test support - if ( !all || !all.length || !a ) { - return {}; - } - - // First batch of supports tests - select = document.createElement( "select" ); - opt = select.appendChild( document.createElement("option") ); - input = div.getElementsByTagName( "input" )[ 0 ]; - - support = { - // IE strips leading whitespace when .innerHTML is used - leadingWhitespace: ( div.firstChild.nodeType === 3 ), - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - tbody: !div.getElementsByTagName( "tbody" ).length, - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - htmlSerialize: !!div.getElementsByTagName( "link" ).length, - - // Get the style information from getAttribute - // (IE uses .cssText instead) - style: /top/.test( a.getAttribute("style") ), - - // Make sure that URLs aren't manipulated - // (IE normalizes it by default) - hrefNormalized: ( a.getAttribute( "href" ) === "/a" ), - - // Make sure that element opacity exists - // (IE uses filter instead) - // Use a regex to work around a WebKit issue. See #5145 - opacity: /^0.55/.test( a.style.opacity ), - - // Verify style float existence - // (IE uses styleFloat instead of cssFloat) - cssFloat: !!a.style.cssFloat, - - // Make sure unknown elements (like HTML5 elems) are handled appropriately - unknownElems: !!div.getElementsByTagName( "nav" ).length, - - // Make sure that if no value is specified for a checkbox - // that it defaults to "on". - // (WebKit defaults to "" instead) - checkOn: ( input.value === "on" ), - - // Make sure that a selected-by-default option has a working selected property. - // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) - optSelected: opt.selected, - - // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) - getSetAttribute: div.className !== "t", - - // Tests for enctype support on a form(#6743) - enctype: !!document.createElement("form").enctype, - - // Will be defined later - submitBubbles: true, - changeBubbles: true, - focusinBubbles: false, - deleteExpando: true, - noCloneEvent: true, - inlineBlockNeedsLayout: false, - shrinkWrapBlocks: false, - reliableMarginRight: true - }; - - // Make sure checked status is properly cloned - input.checked = true; - support.noCloneChecked = input.cloneNode( true ).checked; - - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) - select.disabled = true; - support.optDisabled = !opt.disabled; - - // Test to see if it's possible to delete an expando from an element - // Fails in Internet Explorer - try { - delete div.test; - } catch( e ) { - support.deleteExpando = false; - } - - if ( !div.addEventListener && div.attachEvent && div.fireEvent ) { - div.attachEvent( "onclick", function() { - // Cloning a node shouldn't copy over any - // bound event handlers (IE does this) - support.noCloneEvent = false; - }); - div.cloneNode( true ).fireEvent( "onclick" ); - } - - // Check if a radio maintains its value - // after being appended to the DOM - input = document.createElement("input"); - input.value = "t"; - input.setAttribute("type", "radio"); - support.radioValue = input.value === "t"; - - input.setAttribute("checked", "checked"); - div.appendChild( input ); - fragment = document.createDocumentFragment(); - fragment.appendChild( div.lastChild ); - - // WebKit doesn't clone checked state correctly in fragments - support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked; - - div.innerHTML = ""; - - // Figure out if the W3C box model works as expected - div.style.width = div.style.paddingLeft = "1px"; - - // We don't want to do body-related feature tests on frameset - // documents, which lack a body. So we use - // document.getElementsByTagName("body")[0], which is undefined in - // frameset documents, while document.body isn’t. (7398) - body = document.getElementsByTagName("body")[ 0 ]; - // We use our own, invisible, body unless the body is already present - // in which case we use a div (#9239) - testElement = document.createElement( body ? "div" : "body" ); - testElementStyle = { - visibility: "hidden", - width: 0, - height: 0, - border: 0, - margin: 0, - background: "none" - }; - if ( body ) { - jQuery.extend( testElementStyle, { - position: "absolute", - left: "-999px", - top: "-999px" - }); - } - for ( i in testElementStyle ) { - testElement.style[ i ] = testElementStyle[ i ]; - } - testElement.appendChild( div ); - testElementParent = body || documentElement; - testElementParent.insertBefore( testElement, testElementParent.firstChild ); - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - support.appendChecked = input.checked; - - support.boxModel = div.offsetWidth === 2; - - if ( "zoom" in div.style ) { - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - // (IE < 8 does this) - div.style.display = "inline"; - div.style.zoom = 1; - support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 ); - - // Check if elements with layout shrink-wrap their children - // (IE 6 does this) - div.style.display = ""; - div.innerHTML = "
"; - support.shrinkWrapBlocks = ( div.offsetWidth !== 2 ); - } - - div.innerHTML = "
t
"; - tds = div.getElementsByTagName( "td" ); - - // Check if table cells still have offsetWidth/Height when they are set - // to display:none and there are still other visible table cells in a - // table row; if so, offsetWidth/Height are not reliable for use when - // determining if an element has been hidden directly using - // display:none (it is still safe to use offsets if a parent element is - // hidden; don safety goggles and see bug #4512 for more information). - // (only IE 8 fails this test) - isSupported = ( tds[ 0 ].offsetHeight === 0 ); - - tds[ 0 ].style.display = ""; - tds[ 1 ].style.display = "none"; - - // Check if empty table cells still have offsetWidth/Height - // (IE < 8 fail this test) - support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 ); - div.innerHTML = ""; - - // Check if div with explicit width and no margin-right incorrectly - // gets computed margin-right based on width of container. For more - // info see bug #3333 - // Fails in WebKit before Feb 2011 nightlies - // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right - if ( document.defaultView && document.defaultView.getComputedStyle ) { - marginDiv = document.createElement( "div" ); - marginDiv.style.width = "0"; - marginDiv.style.marginRight = "0"; - div.appendChild( marginDiv ); - support.reliableMarginRight = - ( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0; - } - - // Technique from Juriy Zaytsev - // http://perfectionkills.com/detecting-event-support-without-browser-sniffing/ - // We only care about the case where non-standard event systems - // are used, namely in IE. Short-circuiting here helps us to - // avoid an eval call (in setAttribute) which can cause CSP - // to go haywire. See: https://developer.mozilla.org/en/Security/CSP - if ( div.attachEvent ) { - for( i in { - submit: 1, - change: 1, - focusin: 1 - } ) { - eventName = "on" + i; - isSupported = ( eventName in div ); - if ( !isSupported ) { - div.setAttribute( eventName, "return;" ); - isSupported = ( typeof div[ eventName ] === "function" ); - } - support[ i + "Bubbles" ] = isSupported; - } - } - - // Run fixed position tests at doc ready to avoid a crash - // related to the invisible body in IE8 - jQuery(function() { - var container, outer, inner, table, td, offsetSupport, - conMarginTop = 1, - ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;", - vb = "visibility:hidden;border:0;", - style = "style='" + ptlm + "border:5px solid #000;padding:0;'", - html = "
" + - "" + - "
"; - - // Reconstruct a container - body = document.getElementsByTagName("body")[0]; - if ( !body ) { - // Return for frameset docs that don't have a body - // These tests cannot be done - return; - } - - container = document.createElement("div"); - container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px"; - body.insertBefore( container, body.firstChild ); - - // Construct a test element - testElement = document.createElement("div"); - testElement.style.cssText = ptlm + vb; - - testElement.innerHTML = html; - container.appendChild( testElement ); - outer = testElement.firstChild; - inner = outer.firstChild; - td = outer.nextSibling.firstChild.firstChild; - - offsetSupport = { - doesNotAddBorder: ( inner.offsetTop !== 5 ), - doesAddBorderForTableAndCells: ( td.offsetTop === 5 ) - }; - - inner.style.position = "fixed"; - inner.style.top = "20px"; - - // safari subtracts parent border width here which is 5px - offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 ); - inner.style.position = inner.style.top = ""; - - outer.style.overflow = "hidden"; - outer.style.position = "relative"; - - offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 ); - offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop ); - - body.removeChild( container ); - testElement = container = null; - - jQuery.extend( support, offsetSupport ); - }); - - testElement.innerHTML = ""; - testElementParent.removeChild( testElement ); - - // Null connected elements to avoid leaks in IE - testElement = fragment = select = opt = body = marginDiv = div = input = null; - - return support; -})(); - -// Keep track of boxModel -jQuery.boxModel = jQuery.support.boxModel; - - - - -var rbrace = /^(?:\{.*\}|\[.*\])$/, - rmultiDash = /([A-Z])/g; - -jQuery.extend({ - cache: {}, - - // Please use with caution - uuid: 0, - - // Unique for each copy of jQuery on the page - // Non-digits removed to match rinlinejQuery - expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), - - // The following elements throw uncatchable exceptions if you - // attempt to add expando properties to them. - noData: { - "embed": true, - // Ban all objects except for Flash (which handle expandos) - "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", - "applet": true - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var privateCache, thisCache, ret, - internalKey = jQuery.expando, - getByName = typeof name === "string", - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando, - isEvents = name === "events"; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) { - return; - } - - if ( !id ) { - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - elem[ jQuery.expando ] = id = ++jQuery.uuid; - } else { - id = jQuery.expando; - } - } - - if ( !cache[ id ] ) { - cache[ id ] = {}; - - // Avoids exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - if ( !isNode ) { - cache[ id ].toJSON = jQuery.noop; - } - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - privateCache = thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Users should not attempt to inspect the internal events object using jQuery.data, - // it is undocumented and subject to change. But does anyone listen? No. - if ( isEvents && !thisCache[ name ] ) { - return privateCache.events; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( getByName ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; - }, - - removeData: function( elem, name, pvt /* Internal Use Only */ ) { - if ( !jQuery.acceptData( elem ) ) { - return; - } - - var thisCache, i, l, - - // Reference to internal data cache key - internalKey = jQuery.expando, - - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - - // See jQuery.data for more information - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support space separated names - if ( jQuery.isArray( name ) ) { - name = name; - } else if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split( " " ); - } - } - - for ( i = 0, l = name.length; i < l; i++ ) { - delete thisCache[ name[i] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject(cache[ id ]) ) { - return; - } - } - - // Browsers that fail expando deletion also refuse to delete expandos on - // the window, but it will allow it on all other JS objects; other browsers - // don't care - // Ensure that `cache` is not a window object #10080 - if ( jQuery.support.deleteExpando || !cache.setInterval ) { - delete cache[ id ]; - } else { - cache[ id ] = null; - } - - // We destroyed the cache and need to eliminate the expando on the node to avoid - // false lookups in the cache for entries that no longer exist - if ( isNode ) { - // IE does not allow us to delete expando properties from nodes, - // nor does it have a removeAttribute function on Document nodes; - // we must handle all of these cases - if ( jQuery.support.deleteExpando ) { - delete elem[ jQuery.expando ]; - } else if ( elem.removeAttribute ) { - elem.removeAttribute( jQuery.expando ); - } else { - elem[ jQuery.expando ] = null; - } - } - }, - - // For internal use only. - _data: function( elem, name, data ) { - return jQuery.data( elem, name, data, true ); - }, - - // A method for determining if a DOM node can handle the data expando - acceptData: function( elem ) { - if ( elem.nodeName ) { - var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; - - if ( match ) { - return !(match === true || elem.getAttribute("classid") !== match); - } - } - - return true; - } -}); - -jQuery.fn.extend({ - data: function( key, value ) { - var parts, attr, name, - data = null; - - if ( typeof key === "undefined" ) { - if ( this.length ) { - data = jQuery.data( this[0] ); - - if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) { - attr = this[0].attributes; - for ( var i = 0, l = attr.length; i < l; i++ ) { - name = attr[i].name; - - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.substring(5) ); - - dataAttr( this[0], name, data[ name ] ); - } - } - jQuery._data( this[0], "parsedAttrs", true ); - } - } - - return data; - - } else if ( typeof key === "object" ) { - return this.each(function() { - jQuery.data( this, key ); - }); - } - - parts = key.split("."); - parts[1] = parts[1] ? "." + parts[1] : ""; - - if ( value === undefined ) { - data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); - - // Try to fetch any internally stored data first - if ( data === undefined && this.length ) { - data = jQuery.data( this[0], key ); - data = dataAttr( this[0], key, data ); - } - - return data === undefined && parts[1] ? - this.data( parts[0] ) : - data; - - } else { - return this.each(function() { - var $this = jQuery( this ), - args = [ parts[0], value ]; - - $this.triggerHandler( "setData" + parts[1] + "!", args ); - jQuery.data( this, key, value ); - $this.triggerHandler( "changeData" + parts[1] + "!", args ); - }); - } - }, - - removeData: function( key ) { - return this.each(function() { - jQuery.removeData( this, key ); - }); - } -}); - -function dataAttr( elem, key, data ) { - // If nothing was found internally, try to fetch any - // data from the HTML5 data-* attribute - if ( data === undefined && elem.nodeType === 1 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); - - data = elem.getAttribute( name ); - - if ( typeof data === "string" ) { - try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - jQuery.isNumeric( data ) ? parseFloat( data ) : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - for ( var name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - - - - -function handleQueueMarkDefer( elem, type, src ) { - var deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - defer = jQuery._data( elem, deferDataKey ); - if ( defer && - ( src === "queue" || !jQuery._data(elem, queueDataKey) ) && - ( src === "mark" || !jQuery._data(elem, markDataKey) ) ) { - // Give room for hard-coded callbacks to fire first - // and eventually mark/queue something else on the element - setTimeout( function() { - if ( !jQuery._data( elem, queueDataKey ) && - !jQuery._data( elem, markDataKey ) ) { - jQuery.removeData( elem, deferDataKey, true ); - defer.fire(); - } - }, 0 ); - } -} - -jQuery.extend({ - - _mark: function( elem, type ) { - if ( elem ) { - type = ( type || "fx" ) + "mark"; - jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 ); - } - }, - - _unmark: function( force, elem, type ) { - if ( force !== true ) { - type = elem; - elem = force; - force = false; - } - if ( elem ) { - type = type || "fx"; - var key = type + "mark", - count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 ); - if ( count ) { - jQuery._data( elem, key, count ); - } else { - jQuery.removeData( elem, key, true ); - handleQueueMarkDefer( elem, type, "mark" ); - } - } - }, - - queue: function( elem, type, data ) { - var q; - if ( elem ) { - type = ( type || "fx" ) + "queue"; - q = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !q || jQuery.isArray(data) ) { - q = jQuery._data( elem, type, jQuery.makeArray(data) ); - } else { - q.push( data ); - } - } - return q || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - fn = queue.shift(), - hooks = {}; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - } - - if ( fn ) { - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - jQuery._data( elem, type + ".run", hooks ); - fn.call( elem, function() { - jQuery.dequeue( elem, type ); - }, hooks ); - } - - if ( !queue.length ) { - jQuery.removeData( elem, type + "queue " + type + ".run", true ); - handleQueueMarkDefer( elem, type, "queue" ); - } - } -}); - -jQuery.fn.extend({ - queue: function( type, data ) { - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - } - - if ( data === undefined ) { - return jQuery.queue( this[0], type ); - } - return this.each(function() { - var queue = jQuery.queue( this, type, data ); - - if ( type === "fx" && queue[0] !== "inprogress" ) { - jQuery.dequeue( this, type ); - } - }); - }, - dequeue: function( type ) { - return this.each(function() { - jQuery.dequeue( this, type ); - }); - }, - // Based off of the plugin by Clint Helfers, with permission. - // http://blindsignals.com/index.php/2009/07/jquery-delay/ - delay: function( time, type ) { - time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; - type = type || "fx"; - - return this.queue( type, function( next, hooks ) { - var timeout = setTimeout( next, time ); - hooks.stop = function() { - clearTimeout( timeout ); - }; - }); - }, - clearQueue: function( type ) { - return this.queue( type || "fx", [] ); - }, - // Get a promise resolved when queues of a certain type - // are emptied (fx is the type by default) - promise: function( type, object ) { - if ( typeof type !== "string" ) { - object = type; - type = undefined; - } - type = type || "fx"; - var defer = jQuery.Deferred(), - elements = this, - i = elements.length, - count = 1, - deferDataKey = type + "defer", - queueDataKey = type + "queue", - markDataKey = type + "mark", - tmp; - function resolve() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - } - while( i-- ) { - if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) || - ( jQuery.data( elements[ i ], queueDataKey, undefined, true ) || - jQuery.data( elements[ i ], markDataKey, undefined, true ) ) && - jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) { - count++; - tmp.add( resolve ); - } - } - resolve(); - return defer.promise(); - } -}); - - - - -var rclass = /[\n\t\r]/g, - rspace = /\s+/, - rreturn = /\r/g, - rtype = /^(?:button|input)$/i, - rfocusable = /^(?:button|input|object|select|textarea)$/i, - rclickable = /^a(?:rea)?$/i, - rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i, - getSetAttribute = jQuery.support.getSetAttribute, - nodeHook, boolHook, fixSpecified; - -jQuery.fn.extend({ - attr: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.attr ); - }, - - removeAttr: function( name ) { - return this.each(function() { - jQuery.removeAttr( this, name ); - }); - }, - - prop: function( name, value ) { - return jQuery.access( this, name, value, true, jQuery.prop ); - }, - - removeProp: function( name ) { - name = jQuery.propFix[ name ] || name; - return this.each(function() { - // try/catch handles cases where IE balks (such as removing a property on window) - try { - this[ name ] = undefined; - delete this[ name ]; - } catch( e ) {} - }); - }, - - addClass: function( value ) { - var classNames, i, l, elem, - setClass, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).addClass( value.call(this, j, this.className) ); - }); - } - - if ( value && typeof value === "string" ) { - classNames = value.split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 ) { - if ( !elem.className && classNames.length === 1 ) { - elem.className = value; - - } else { - setClass = " " + elem.className + " "; - - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) { - setClass += classNames[ c ] + " "; - } - } - elem.className = jQuery.trim( setClass ); - } - } - } - } - - return this; - }, - - removeClass: function( value ) { - var classNames, i, l, elem, className, c, cl; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( j ) { - jQuery( this ).removeClass( value.call(this, j, this.className) ); - }); - } - - if ( (value && typeof value === "string") || value === undefined ) { - classNames = ( value || "" ).split( rspace ); - - for ( i = 0, l = this.length; i < l; i++ ) { - elem = this[ i ]; - - if ( elem.nodeType === 1 && elem.className ) { - if ( value ) { - className = (" " + elem.className + " ").replace( rclass, " " ); - for ( c = 0, cl = classNames.length; c < cl; c++ ) { - className = className.replace(" " + classNames[ c ] + " ", " "); - } - elem.className = jQuery.trim( className ); - - } else { - elem.className = ""; - } - } - } - } - - return this; - }, - - toggleClass: function( value, stateVal ) { - var type = typeof value, - isBool = typeof stateVal === "boolean"; - - if ( jQuery.isFunction( value ) ) { - return this.each(function( i ) { - jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); - }); - } - - return this.each(function() { - if ( type === "string" ) { - // toggle individual class names - var className, - i = 0, - self = jQuery( this ), - state = stateVal, - classNames = value.split( rspace ); - - while ( (className = classNames[ i++ ]) ) { - // check each className given, space seperated list - state = isBool ? state : !self.hasClass( className ); - self[ state ? "addClass" : "removeClass" ]( className ); - } - - } else if ( type === "undefined" || type === "boolean" ) { - if ( this.className ) { - // store className if set - jQuery._data( this, "__className__", this.className ); - } - - // toggle whole className - this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; - } - }); - }, - - hasClass: function( selector ) { - var className = " " + selector + " ", - i = 0, - l = this.length; - for ( ; i < l; i++ ) { - if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { - return true; - } - } - - return false; - }, - - val: function( value ) { - var hooks, ret, isFunction, - elem = this[0]; - - if ( !arguments.length ) { - if ( elem ) { - hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ]; - - if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { - return ret; - } - - ret = elem.value; - - return typeof ret === "string" ? - // handle most common string cases - ret.replace(rreturn, "") : - // handle cases where value is null/undef or number - ret == null ? "" : ret; - } - - return undefined; - } - - isFunction = jQuery.isFunction( value ); - - return this.each(function( i ) { - var self = jQuery(this), val; - - if ( this.nodeType !== 1 ) { - return; - } - - if ( isFunction ) { - val = value.call( this, i, self.val() ); - } else { - val = value; - } - - // Treat null/undefined as ""; convert numbers to string - if ( val == null ) { - val = ""; - } else if ( typeof val === "number" ) { - val += ""; - } else if ( jQuery.isArray( val ) ) { - val = jQuery.map(val, function ( value ) { - return value == null ? "" : value + ""; - }); - } - - hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ]; - - // If set returns undefined, fall back to normal setting - if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { - this.value = val; - } - }); - } -}); - -jQuery.extend({ - valHooks: { - option: { - get: function( elem ) { - // attributes.value is undefined in Blackberry 4.7 but - // uses .value. See #6932 - var val = elem.attributes.value; - return !val || val.specified ? elem.value : elem.text; - } - }, - select: { - get: function( elem ) { - var value, i, max, option, - index = elem.selectedIndex, - values = [], - options = elem.options, - one = elem.type === "select-one"; - - // Nothing was selected - if ( index < 0 ) { - return null; - } - - // Loop through all the selected options - i = one ? index : 0; - max = one ? index + 1 : options.length; - for ( ; i < max; i++ ) { - option = options[ i ]; - - // Don't return options that are disabled or in a disabled optgroup - if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && - (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { - - // Get the specific value for the option - value = jQuery( option ).val(); - - // We don't need an array for one selects - if ( one ) { - return value; - } - - // Multi-Selects return an array - values.push( value ); - } - } - - // Fixes Bug #2551 -- select.val() broken in IE after form.reset() - if ( one && !values.length && options.length ) { - return jQuery( options[ index ] ).val(); - } - - return values; - }, - - set: function( elem, value ) { - var values = jQuery.makeArray( value ); - - jQuery(elem).find("option").each(function() { - this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; - }); - - if ( !values.length ) { - elem.selectedIndex = -1; - } - return values; - } - } - }, - - attrFn: { - val: true, - css: true, - html: true, - text: true, - data: true, - width: true, - height: true, - offset: true - }, - - attr: function( elem, name, value, pass ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set attributes on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return undefined; - } - - if ( pass && name in jQuery.attrFn ) { - return jQuery( elem )[ name ]( value ); - } - - // Fallback to prop when attributes are not supported - if ( !("getAttribute" in elem) ) { - return jQuery.prop( elem, name, value ); - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - // All attributes are lowercase - // Grab necessary hook if one is defined - if ( notxml ) { - name = name.toLowerCase(); - hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook ); - } - - if ( value !== undefined ) { - - if ( value === null ) { - jQuery.removeAttr( elem, name ); - return undefined; - - } else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - elem.setAttribute( name, "" + value ); - return value; - } - - } else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - - ret = elem.getAttribute( name ); - - // Non-existent attributes return null, we normalize to undefined - return ret === null ? - undefined : - ret; - } - }, - - removeAttr: function( elem, value ) { - var propName, attrNames, name, l, - i = 0; - - if ( elem.nodeType === 1 ) { - attrNames = ( value || "" ).split( rspace ); - l = attrNames.length; - - for ( ; i < l; i++ ) { - name = attrNames[ i ].toLowerCase(); - propName = jQuery.propFix[ name ] || name; - - // See #9699 for explanation of this approach (setting first, then removal) - jQuery.attr( elem, name, "" ); - elem.removeAttribute( getSetAttribute ? name : propName ); - - // Set corresponding property to false for boolean attributes - if ( rboolean.test( name ) && propName in elem ) { - elem[ propName ] = false; - } - } - } - }, - - attrHooks: { - type: { - set: function( elem, value ) { - // We can't allow the type property to be changed (since it causes problems in IE) - if ( rtype.test( elem.nodeName ) && elem.parentNode ) { - jQuery.error( "type property can't be changed" ); - } else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to it's default in case type is set after value - // This is for element creation - var val = elem.value; - elem.setAttribute( "type", value ); - if ( val ) { - elem.value = val; - } - return value; - } - } - }, - // Use the value property for back compat - // Use the nodeHook for button elements in IE6/7 (#1954) - value: { - get: function( elem, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.get( elem, name ); - } - return name in elem ? - elem.value : - null; - }, - set: function( elem, value, name ) { - if ( nodeHook && jQuery.nodeName( elem, "button" ) ) { - return nodeHook.set( elem, value, name ); - } - // Does not return so that setAttribute is also used - elem.value = value; - } - } - }, - - propFix: { - tabindex: "tabIndex", - readonly: "readOnly", - "for": "htmlFor", - "class": "className", - maxlength: "maxLength", - cellspacing: "cellSpacing", - cellpadding: "cellPadding", - rowspan: "rowSpan", - colspan: "colSpan", - usemap: "useMap", - frameborder: "frameBorder", - contenteditable: "contentEditable" - }, - - prop: function( elem, name, value ) { - var ret, hooks, notxml, - nType = elem.nodeType; - - // don't get/set properties on text, comment and attribute nodes - if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { - return undefined; - } - - notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); - - if ( notxml ) { - // Fix name and attach hooks - name = jQuery.propFix[ name ] || name; - hooks = jQuery.propHooks[ name ]; - } - - if ( value !== undefined ) { - if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { - return ret; - - } else { - return ( elem[ name ] = value ); - } - - } else { - if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { - return ret; - - } else { - return elem[ name ]; - } - } - }, - - propHooks: { - tabIndex: { - get: function( elem ) { - // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set - // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ - var attributeNode = elem.getAttributeNode("tabindex"); - - return attributeNode && attributeNode.specified ? - parseInt( attributeNode.value, 10 ) : - rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? - 0 : - undefined; - } - } - } -}); - -// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional) -jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex; - -// Hook for boolean attributes -boolHook = { - get: function( elem, name ) { - // Align boolean attributes with corresponding properties - // Fall back to attribute presence where some booleans are not supported - var attrNode, - property = jQuery.prop( elem, name ); - return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ? - name.toLowerCase() : - undefined; - }, - set: function( elem, value, name ) { - var propName; - if ( value === false ) { - // Remove boolean attributes when set to false - jQuery.removeAttr( elem, name ); - } else { - // value is true since we know at this point it's type boolean and not false - // Set boolean attributes to the same name and set the DOM property - propName = jQuery.propFix[ name ] || name; - if ( propName in elem ) { - // Only set the IDL specifically if it already exists on the element - elem[ propName ] = true; - } - - elem.setAttribute( name, name.toLowerCase() ); - } - return name; - } -}; - -// IE6/7 do not support getting/setting some attributes with get/setAttribute -if ( !getSetAttribute ) { - - fixSpecified = { - name: true, - id: true - }; - - // Use this for any attribute in IE6/7 - // This fixes almost every IE6/7 issue - nodeHook = jQuery.valHooks.button = { - get: function( elem, name ) { - var ret; - ret = elem.getAttributeNode( name ); - return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ? - ret.nodeValue : - undefined; - }, - set: function( elem, value, name ) { - // Set the existing or create a new attribute node - var ret = elem.getAttributeNode( name ); - if ( !ret ) { - ret = document.createAttribute( name ); - elem.setAttributeNode( ret ); - } - return ( ret.nodeValue = value + "" ); - } - }; - - // Apply the nodeHook to tabindex - jQuery.attrHooks.tabindex.set = nodeHook.set; - - // Set width and height to auto instead of 0 on empty string( Bug #8150 ) - // This is for removals - jQuery.each([ "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - set: function( elem, value ) { - if ( value === "" ) { - elem.setAttribute( name, "auto" ); - return value; - } - } - }); - }); - - // Set contenteditable to false on removals(#10429) - // Setting to empty string throws an error as an invalid value - jQuery.attrHooks.contenteditable = { - get: nodeHook.get, - set: function( elem, value, name ) { - if ( value === "" ) { - value = "false"; - } - nodeHook.set( elem, value, name ); - } - }; -} - - -// Some attributes require a special call on IE -if ( !jQuery.support.hrefNormalized ) { - jQuery.each([ "href", "src", "width", "height" ], function( i, name ) { - jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], { - get: function( elem ) { - var ret = elem.getAttribute( name, 2 ); - return ret === null ? undefined : ret; - } - }); - }); -} - -if ( !jQuery.support.style ) { - jQuery.attrHooks.style = { - get: function( elem ) { - // Return undefined in the case of empty string - // Normalize to lowercase since IE uppercases css property names - return elem.style.cssText.toLowerCase() || undefined; - }, - set: function( elem, value ) { - return ( elem.style.cssText = "" + value ); - } - }; -} - -// Safari mis-reports the default selected property of an option -// Accessing the parent's selectedIndex property fixes it -if ( !jQuery.support.optSelected ) { - jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, { - get: function( elem ) { - var parent = elem.parentNode; - - if ( parent ) { - parent.selectedIndex; - - // Make sure that it also works with optgroups, see #5701 - if ( parent.parentNode ) { - parent.parentNode.selectedIndex; - } - } - return null; - } - }); -} - -// IE6/7 call enctype encoding -if ( !jQuery.support.enctype ) { - jQuery.propFix.enctype = "encoding"; -} - -// Radios and checkboxes getter/setter -if ( !jQuery.support.checkOn ) { - jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = { - get: function( elem ) { - // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified - return elem.getAttribute("value") === null ? "on" : elem.value; - } - }; - }); -} -jQuery.each([ "radio", "checkbox" ], function() { - jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], { - set: function( elem, value ) { - if ( jQuery.isArray( value ) ) { - return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); - } - } - }); -}); - - - - -var rnamespaces = /\.(.*)$/, - rformElems = /^(?:textarea|input|select)$/i, - rperiod = /\./g, - rspaces = / /g, - rescape = /[^\w\s.|`]/g, - rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/, - rhoverHack = /\bhover(\.\S+)?/, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|contextmenu)|click/, - rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/, - quickParse = function( selector ) { - var quick = rquickIs.exec( selector ); - if ( quick ) { - // 0 1 2 3 - // [ _, tag, id, class ] - quick[1] = ( quick[1] || "" ).toLowerCase(); - quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" ); - } - return quick; - }, - quickIs = function( elem, m ) { - return ( - (!m[1] || elem.nodeName.toLowerCase() === m[1]) && - (!m[2] || elem.id === m[2]) && - (!m[3] || m[3].test( elem.className )) - ); - }, - hoverHack = function( events ) { - return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" ); - }; - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - add: function( elem, types, handler, data, selector ) { - - var elemData, eventHandle, events, - t, tns, type, namespaces, handleObj, - handleObjIn, quick, handlers, special; - - // Don't attach events to noData or text/comment nodes (allow plain objects tho) - if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - } - - // Make sure that the handler has a unique ID, used to find/remove it later - if ( !handler.guid ) { - handler.guid = jQuery.guid++; - } - - // Init the element's event structure and main handler, if this is the first - events = elemData.events; - if ( !events ) { - elemData.events = events = {}; - } - eventHandle = elemData.handle; - if ( !eventHandle ) { - elemData.handle = eventHandle = function( e ) { - // Discard the second event of a jQuery.event.trigger() and - // when an event is called after a page has unloaded - return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - // jQuery(...).bind("mouseover mouseout", fn); - types = hoverHack(types).split( " " ); - for ( t = 0; t < types.length; t++ ) { - - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = ( tns[2] || "" ).split( "." ).sort(); - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend({ - type: type, - origType: tns[1], - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - namespace: namespaces.join(".") - }, handleObjIn ); - - // Delegated event; pre-analyze selector so it's processed quickly on event dispatch - if ( selector ) { - handleObj.quick = quickParse( selector ); - if ( !handleObj.quick && jQuery.expr.match.POS.test( selector ) ) { - handleObj.isPositional = true; - } - } - - // Init the event handler queue if we're the first - handlers = events[ type ]; - if ( !handlers ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - global: {}, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector ) { - - var elemData = jQuery.hasData( elem ) && jQuery._data( elem ), - t, tns, type, namespaces, origCount, - j, events, special, handle, eventType, handleObj; - - if ( !elemData || !(events = elemData.events) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = hoverHack( types || "" ).split(" "); - for ( t = 0; t < types.length; t++ ) { - tns = rtypenamespace.exec( types[t] ) || []; - type = tns[1]; - namespaces = tns[2]; - - // Unbind all events (on this namespace, if provided) for the element - if ( !type ) { - namespaces = namespaces? "." + namespaces : ""; - for ( j in events ) { - jQuery.event.remove( elem, j + namespaces, handler, selector ); - } - return; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector? special.delegateType : special.bindType ) || type; - eventType = events[ type ] || []; - origCount = eventType.length; - namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - - // Only need to loop for special events or selective removal - if ( handler || namespaces || selector || special.remove ) { - for ( j = 0; j < eventType.length; j++ ) { - handleObj = eventType[ j ]; - - if ( !handler || handler.guid === handleObj.guid ) { - if ( !namespaces || namespaces.test( handleObj.namespace ) ) { - if ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) { - eventType.splice( j--, 1 ); - - if ( handleObj.selector ) { - eventType.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - } - } - } else { - // Removing all events - eventType.length = 0; - } - - // Remove generic event handler if we removed something and no more handlers exist - // (avoids potential for endless recursion during removal of special event handlers) - if ( eventType.length === 0 && origCount !== eventType.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - handle = elemData.handle; - if ( handle ) { - handle.elem = null; - } - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery.removeData( elem, [ "events", "handle" ], true ); - } - }, - - // Events that are safe to short-circuit if no handlers are attached. - // Native DOM events should not be added, they may have inline handlers. - customEvent: { - "getData": true, - "setData": true, - "changeData": true - }, - - trigger: function( event, data, elem, onlyHandlers ) { - // Don't do events on text and comment nodes - if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) { - return; - } - - // Event object or event type - var type = event.type || event, - namespaces = [], - cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType; - - if ( type.indexOf( "!" ) >= 0 ) { - // Exclusive events trigger only for the exact event (no namespaces) - type = type.slice(0, -1); - exclusive = true; - } - - if ( type.indexOf( "." ) >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - - if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) { - // No jQuery handlers for this event type, and it can't have inline handlers - return; - } - - // Caller can pass in an Event, Object, or just an event type string - event = typeof event === "object" ? - // jQuery.Event object - event[ jQuery.expando ] ? event : - // Object literal - new jQuery.Event( type, event ) : - // Just the event type (string) - new jQuery.Event( type ); - - event.type = type; - event.isTrigger = true; - event.exclusive = exclusive; - event.namespace = namespaces.join( "." ); - event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null; - ontype = type.indexOf( ":" ) < 0 ? "on" + type : ""; - - // triggerHandler() and global events don't bubble or run the default action - if ( onlyHandlers || !elem ) { - event.preventDefault(); - } - - // Handle a global trigger - if ( !elem ) { - - // TODO: Stop taunting the data cache; remove global events and always attach to document - cache = jQuery.cache; - for ( i in cache ) { - if ( cache[ i ].events && cache[ i ].events[ type ] ) { - jQuery.event.trigger( event, data, cache[ i ].handle.elem, true ); - } - } - return; - } - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data != null ? jQuery.makeArray( data ) : []; - data.unshift( event ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - eventPath = [[ elem, special.bindType || type ]]; - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - old = null; - for ( cur = elem.parentNode; cur; cur = cur.parentNode ) { - eventPath.push([ cur, bubbleType ]); - old = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( old && old === elem.ownerDocument ) { - eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]); - } - } - - // Fire handlers on the event path - for ( i = 0; i < eventPath.length; i++ ) { - - cur = eventPath[i][0]; - event.type = eventPath[i][1]; - - handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - handle = ontype && cur[ ontype ]; - if ( handle && jQuery.acceptData( cur ) ) { - handle.apply( cur, data ); - } - - if ( event.isPropagationStopped() ) { - break; - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) && - !(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - // IE<9 dies on focus/blur to hidden element (#1486) - if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - old = elem[ ontype ]; - - if ( old ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( old ) { - elem[ ontype ] = old; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event || window.event ); - - var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []), - delegateCount = handlers.delegateCount, - args = [].slice.call( arguments, 0 ), - run_all = !event.exclusive && !event.namespace, - specialHandle = ( jQuery.event.special[ event.type ] || {} ).handle, - handlerQueue = [], - i, j, cur, ret, selMatch, matched, matches, handleObj, sel, hit, related; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; - event.delegateTarget = this; - - // Determine handlers that should run if there are delegated events - // Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861) - if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) { - - for ( cur = event.target; cur != this; cur = cur.parentNode || this ) { - selMatch = {}; - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - sel = handleObj.selector; - hit = selMatch[ sel ]; - - if ( handleObj.isPositional ) { - // Since .is() does not work for positionals; see http://jsfiddle.net/eJ4yd/3/ - hit = ( hit || (selMatch[ sel ] = jQuery( sel )) ).index( cur ) >= 0; - } else if ( hit === undefined ) { - hit = selMatch[ sel ] = ( handleObj.quick ? quickIs( cur, handleObj.quick ) : jQuery( cur ).is( sel ) ); - } - if ( hit ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push({ elem: cur, matches: matches }); - } - } - } - - // Add the remaining (directly-bound) handlers - if ( handlers.length > delegateCount ) { - handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) }); - } - - // Run delegates first; they may want to stop propagation beneath us - for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) { - matched = handlerQueue[ i ]; - event.currentTarget = matched.elem; - - for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) { - handleObj = matched.matches[ j ]; - - // Triggered event must either 1) be non-exclusive and have no namespace, or - // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). - if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) { - - event.data = handleObj.data; - event.handleObj = handleObj; - - ret = ( specialHandle || handleObj.handler ).apply( matched.elem, args ); - - if ( ret !== undefined ) { - event.result = ret; - if ( ret === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - return event.result; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - // *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 *** - props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), - - fixHooks: {}, - - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; - } - - return event; - } - }, - - mouseHooks: { - props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement wheelDelta".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button, - fromElement = original.fromElement; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, - originalEvent = event, - fixHook = jQuery.event.fixHooks[ event.type ] || {}, - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = jQuery.Event( originalEvent ); - - for ( i = copy.length; i; ) { - prop = copy[ --i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Fix target property, if necessary (#1925, IE 6/7/8 & Safari2) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Target should not be a text node (#504, Safari) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8) - if ( event.metaKey === undefined ) { - event.metaKey = event.ctrlKey; - } - - return fixHook.filter? fixHook.filter( event, originalEvent ) : event; - }, - - special: { - ready: { - // Make sure the ready event is setup - setup: jQuery.bindReady - }, - - focus: { - delegateType: "focusin", - noBubble: true - }, - blur: { - delegateType: "focusout", - noBubble: true - }, - - beforeunload: { - setup: function( data, namespaces, eventHandle ) { - // We only want to do this special case on windows - if ( jQuery.isWindow( this ) ) { - this.onbeforeunload = eventHandle; - } - }, - - teardown: function( namespaces, eventHandle ) { - if ( this.onbeforeunload === eventHandle ) { - this.onbeforeunload = null; - } - } - } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -// Some plugins are using, but it's undocumented/deprecated and will be removed. -// The 1.7 special event interface should provide all the hooks needed now. -jQuery.event.handle = jQuery.event.dispatch; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); - } - } : - function( elem, type, handle ) { - if ( elem.detachEvent ) { - elem.detachEvent( "on" + type, handle ); - } - }; - -jQuery.Event = function( src, props ) { - // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false || - src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); - - // Mark it as fixed - this[ jQuery.expando ] = true; -}; - -function returnFalse() { - return false; -} -function returnTrue() { - return true; -} - -// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html -jQuery.Event.prototype = { - preventDefault: function() { - this.isDefaultPrevented = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - - // if preventDefault exists run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // otherwise set the returnValue property of the original event to false (IE) - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - this.isPropagationStopped = returnTrue; - - var e = this.originalEvent; - if ( !e ) { - return; - } - // if stopPropagation exists run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - // otherwise set the cancelBubble property of the original event to true (IE) - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - this.isImmediatePropagationStopped = returnTrue; - this.stopPropagation(); - }, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -jQuery.each({ - mouseenter: "mouseover", - mouseleave: "mouseout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = jQuery.event.special[ fix ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var target = this, - related = event.relatedTarget, - handleObj = event.handleObj, - selector = handleObj.selector, - oldType, ret; - - // For a real mouseover/out, always call the handler; for - // mousenter/leave call the handler if related is outside the target. - // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || handleObj.origType === event.type || (related !== target && !jQuery.contains( target, related )) ) { - oldType = event.type; - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = oldType; - } - return ret; - } - }; -}); - -// IE submit delegation -if ( !jQuery.support.submitBubbles ) { - - jQuery.event.special.submit = { - setup: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; - if ( form && !form._submit_attached ) { - jQuery.event.add( form, "submit._submit", function( event ) { - // Form was submitted, bubble the event up the tree - if ( this.parentNode ) { - jQuery.event.simulate( "submit", this.parentNode, event, true ); - } - }); - form._submit_attached = true; - } - }); - // return undefined since we don't need an event listener - }, - - teardown: function() { - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !jQuery.support.changeBubbles ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._just_changed = true; - } - }); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._just_changed ) { - this._just_changed = false; - jQuery.event.simulate( "change", this, event, true ); - } - }); - } - return false; - } - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated ) { - jQuery.event.simulate( "change", this.parentNode, event, true ); - } - }); - elem._change_attached = true; - } - }); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return rformElems.test( this.nodeName ); - } - }; -} - -// Create "bubbling" focus and blur events -if ( !jQuery.support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // Attach a single capturing handler while someone wants focusin/focusout - var attaches = 0, - handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - if ( attaches++ === 0 ) { - document.addEventListener( orig, handler, true ); - } - }, - teardown: function() { - if ( --attaches === 0 ) { - document.removeEventListener( orig, handler, true ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); - }, - one: function( types, selector, data, fn ) { - return this.on.call( this, types, selector, data, fn, 1 ); - }, - off: function( types, selector, fn ) { - if ( types && types.preventDefault && types.handleObj ) { - // ( event ) dispatched jQuery.Event - var handleObj = types.handleObj; - jQuery( types.delegateTarget ).off( - handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type, - handleObj.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - // ( types-object [, selector] ) - for ( var type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - return this.each(function() { - jQuery.event.remove( this, types, fn, selector ); - }); - }, - - bind: function( types, data, fn ) { - return this.on( types, null, data, fn ); - }, - unbind: function( types, fn ) { - return this.off( types, null, fn ); - }, - - live: function( types, data, fn ) { - jQuery( this.context ).on( types, this.selector, data, fn ); - return this; - }, - die: function( types, fn ) { - jQuery( this.context ).off( types, this.selector || "**", fn ); - return this; - }, - - delegate: function( selector, types, data, fn ) { - return this.on( types, selector, data, fn ); - }, - undelegate: function( selector, types, fn ) { - // ( namespace ) or ( selector, types [, fn] ) - return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn ); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - if ( this[0] ) { - return jQuery.event.trigger( type, data, this[0], true ); - } - }, - - toggle: function( fn ) { - // Save reference to arguments for access in closure - var args = arguments, - guid = fn.guid || jQuery.guid++, - i = 0, - toggler = function( event ) { - // Figure out which function to execute - var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; - jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); - - // Make sure that clicks stop - event.preventDefault(); - - // and execute the function - return args[ lastToggle ].apply( this, arguments ) || false; - }; - - // link all the functions, so any of them can unbind this click handler - toggler.guid = guid; - while ( i < args.length ) { - args[ i++ ].guid = guid; - } - - return this.click( toggler ); - }, - - hover: function( fnOver, fnOut ) { - return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); - } -}); - -jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + - "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + - "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { - - // Handle event binding - jQuery.fn[ name ] = function( data, fn ) { - if ( fn == null ) { - fn = data; - data = null; - } - - return arguments.length > 0 ? - this.bind( name, data, fn ) : - this.trigger( name ); - }; - - if ( jQuery.attrFn ) { - jQuery.attrFn[ name ] = true; - } - - if ( rkeyEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks; - } - - if ( rmouseEvent.test( name ) ) { - jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks; - } -}); - - - -/*! - * Sizzle CSS Selector Engine - * Copyright 2011, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){ - -var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - expando = "sizcache" + (Math.random() + '').replace('.', ''), - done = 0, - toString = Object.prototype.toString, - hasDuplicate = false, - baseHasDuplicate = true, - rBackslash = /\\/g, - rReturn = /\r\n/g, - rNonWord = /\W/; - -// Here we check if the JavaScript engine is using some sort of -// optimization where it does not always call our comparision -// function. If that is the case, discard the hasDuplicate value. -// Thus far that includes Google Chrome. -[0, 0].sort(function() { - baseHasDuplicate = false; - return 0; -}); - -var Sizzle = function( selector, context, results, seed ) { - results = results || []; - context = context || document; - - var origContext = context; - - if ( context.nodeType !== 1 && context.nodeType !== 9 ) { - return []; - } - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - var m, set, checkSet, extra, ret, cur, pop, i, - prune = true, - contextXML = Sizzle.isXML( context ), - parts = [], - soFar = selector; - - // Reset the position of the chunker regexp (start from head) - do { - chunker.exec( "" ); - m = chunker.exec( soFar ); - - if ( m ) { - soFar = m[3]; - - parts.push( m[1] ); - - if ( m[2] ) { - extra = m[3]; - break; - } - } - } while ( m ); - - if ( parts.length > 1 && origPOS.exec( selector ) ) { - - if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { - set = posProcess( parts[0] + parts[1], context, seed ); - - } else { - set = Expr.relative[ parts[0] ] ? - [ context ] : - Sizzle( parts.shift(), context ); - - while ( parts.length ) { - selector = parts.shift(); - - if ( Expr.relative[ selector ] ) { - selector += parts.shift(); - } - - set = posProcess( selector, set, seed ); - } - } - - } else { - // Take a shortcut and set the context if the root selector is an ID - // (but not if it'll be faster if the inner selector is an ID) - if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && - Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { - - ret = Sizzle.find( parts.shift(), context, contextXML ); - context = ret.expr ? - Sizzle.filter( ret.expr, ret.set )[0] : - ret.set[0]; - } - - if ( context ) { - ret = seed ? - { expr: parts.pop(), set: makeArray(seed) } : - Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); - - set = ret.expr ? - Sizzle.filter( ret.expr, ret.set ) : - ret.set; - - if ( parts.length > 0 ) { - checkSet = makeArray( set ); - - } else { - prune = false; - } - - while ( parts.length ) { - cur = parts.pop(); - pop = cur; - - if ( !Expr.relative[ cur ] ) { - cur = ""; - } else { - pop = parts.pop(); - } - - if ( pop == null ) { - pop = context; - } - - Expr.relative[ cur ]( checkSet, pop, contextXML ); - } - - } else { - checkSet = parts = []; - } - } - - if ( !checkSet ) { - checkSet = set; - } - - if ( !checkSet ) { - Sizzle.error( cur || selector ); - } - - if ( toString.call(checkSet) === "[object Array]" ) { - if ( !prune ) { - results.push.apply( results, checkSet ); - - } else if ( context && context.nodeType === 1 ) { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { - results.push( set[i] ); - } - } - - } else { - for ( i = 0; checkSet[i] != null; i++ ) { - if ( checkSet[i] && checkSet[i].nodeType === 1 ) { - results.push( set[i] ); - } - } - } - - } else { - makeArray( checkSet, results ); - } - - if ( extra ) { - Sizzle( extra, origContext, results, seed ); - Sizzle.uniqueSort( results ); - } - - return results; -}; - -Sizzle.uniqueSort = function( results ) { - if ( sortOrder ) { - hasDuplicate = baseHasDuplicate; - results.sort( sortOrder ); - - if ( hasDuplicate ) { - for ( var i = 1; i < results.length; i++ ) { - if ( results[i] === results[ i - 1 ] ) { - results.splice( i--, 1 ); - } - } - } - } - - return results; -}; - -Sizzle.matches = function( expr, set ) { - return Sizzle( expr, null, null, set ); -}; - -Sizzle.matchesSelector = function( node, expr ) { - return Sizzle( expr, null, null, [node] ).length > 0; -}; - -Sizzle.find = function( expr, context, isXML ) { - var set, i, len, match, type, left; - - if ( !expr ) { - return []; - } - - for ( i = 0, len = Expr.order.length; i < len; i++ ) { - type = Expr.order[i]; - - if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { - left = match[1]; - match.splice( 1, 1 ); - - if ( left.substr( left.length - 1 ) !== "\\" ) { - match[1] = (match[1] || "").replace( rBackslash, "" ); - set = Expr.find[ type ]( match, context, isXML ); - - if ( set != null ) { - expr = expr.replace( Expr.match[ type ], "" ); - break; - } - } - } - } - - if ( !set ) { - set = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( "*" ) : - []; - } - - return { set: set, expr: expr }; -}; - -Sizzle.filter = function( expr, set, inplace, not ) { - var match, anyFound, - type, found, item, filter, left, - i, pass, - old = expr, - result = [], - curLoop = set, - isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); - - while ( expr && set.length ) { - for ( type in Expr.filter ) { - if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { - filter = Expr.filter[ type ]; - left = match[1]; - - anyFound = false; - - match.splice(1,1); - - if ( left.substr( left.length - 1 ) === "\\" ) { - continue; - } - - if ( curLoop === result ) { - result = []; - } - - if ( Expr.preFilter[ type ] ) { - match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); - - if ( !match ) { - anyFound = found = true; - - } else if ( match === true ) { - continue; - } - } - - if ( match ) { - for ( i = 0; (item = curLoop[i]) != null; i++ ) { - if ( item ) { - found = filter( item, match, i, curLoop ); - pass = not ^ found; - - if ( inplace && found != null ) { - if ( pass ) { - anyFound = true; - - } else { - curLoop[i] = false; - } - - } else if ( pass ) { - result.push( item ); - anyFound = true; - } - } - } - } - - if ( found !== undefined ) { - if ( !inplace ) { - curLoop = result; - } - - expr = expr.replace( Expr.match[ type ], "" ); - - if ( !anyFound ) { - return []; - } - - break; - } - } - } - - // Improper expression - if ( expr === old ) { - if ( anyFound == null ) { - Sizzle.error( expr ); - - } else { - break; - } - } - - old = expr; - } - - return curLoop; -}; - -Sizzle.error = function( msg ) { - throw "Syntax error, unrecognized expression: " + msg; -}; - -/** - * Utility function for retreiving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -var getText = Sizzle.getText = function( elem ) { - var i, node, - nodeType = elem.nodeType, - ret = ""; - - if ( nodeType ) { - if ( nodeType === 1 ) { - // Use textContent || innerText for elements - if ( typeof elem.textContent === 'string' ) { - return elem.textContent; - } else if ( typeof elem.innerText === 'string' ) { - // Replace IE's carriage returns - return elem.innerText.replace( rReturn, '' ); - } else { - // Traverse it's children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - } else { - - // If no nodeType, this is expected to be an array - for ( i = 0; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - if ( node.nodeType !== 8 ) { - ret += getText( node ); - } - } - } - return ret; -}; - -var Expr = Sizzle.selectors = { - order: [ "ID", "NAME", "TAG" ], - - match: { - ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, - NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, - ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, - TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, - CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, - POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, - PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ - }, - - leftMatch: {}, - - attrMap: { - "class": "className", - "for": "htmlFor" - }, - - attrHandle: { - href: function( elem ) { - return elem.getAttribute( "href" ); - }, - type: function( elem ) { - return elem.getAttribute( "type" ); - } - }, - - relative: { - "+": function(checkSet, part){ - var isPartStr = typeof part === "string", - isTag = isPartStr && !rNonWord.test( part ), - isPartStrNotTag = isPartStr && !isTag; - - if ( isTag ) { - part = part.toLowerCase(); - } - - for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { - if ( (elem = checkSet[i]) ) { - while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} - - checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? - elem || false : - elem === part; - } - } - - if ( isPartStrNotTag ) { - Sizzle.filter( part, checkSet, true ); - } - }, - - ">": function( checkSet, part ) { - var elem, - isPartStr = typeof part === "string", - i = 0, - l = checkSet.length; - - if ( isPartStr && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - var parent = elem.parentNode; - checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; - } - } - - } else { - for ( ; i < l; i++ ) { - elem = checkSet[i]; - - if ( elem ) { - checkSet[i] = isPartStr ? - elem.parentNode : - elem.parentNode === part; - } - } - - if ( isPartStr ) { - Sizzle.filter( part, checkSet, true ); - } - } - }, - - "": function(checkSet, part, isXML){ - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); - }, - - "~": function( checkSet, part, isXML ) { - var nodeCheck, - doneName = done++, - checkFn = dirCheck; - - if ( typeof part === "string" && !rNonWord.test( part ) ) { - part = part.toLowerCase(); - nodeCheck = part; - checkFn = dirNodeCheck; - } - - checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); - } - }, - - find: { - ID: function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }, - - NAME: function( match, context ) { - if ( typeof context.getElementsByName !== "undefined" ) { - var ret = [], - results = context.getElementsByName( match[1] ); - - for ( var i = 0, l = results.length; i < l; i++ ) { - if ( results[i].getAttribute("name") === match[1] ) { - ret.push( results[i] ); - } - } - - return ret.length === 0 ? null : ret; - } - }, - - TAG: function( match, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( match[1] ); - } - } - }, - preFilter: { - CLASS: function( match, curLoop, inplace, result, not, isXML ) { - match = " " + match[1].replace( rBackslash, "" ) + " "; - - if ( isXML ) { - return match; - } - - for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { - if ( elem ) { - if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { - if ( !inplace ) { - result.push( elem ); - } - - } else if ( inplace ) { - curLoop[i] = false; - } - } - } - - return false; - }, - - ID: function( match ) { - return match[1].replace( rBackslash, "" ); - }, - - TAG: function( match, curLoop ) { - return match[1].replace( rBackslash, "" ).toLowerCase(); - }, - - CHILD: function( match ) { - if ( match[1] === "nth" ) { - if ( !match[2] ) { - Sizzle.error( match[0] ); - } - - match[2] = match[2].replace(/^\+|\s*/g, ''); - - // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' - var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( - match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || - !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); - - // calculate the numbers (first)n+(last) including if they are negative - match[2] = (test[1] + (test[2] || 1)) - 0; - match[3] = test[3] - 0; - } - else if ( match[2] ) { - Sizzle.error( match[0] ); - } - - // TODO: Move to normal caching system - match[0] = done++; - - return match; - }, - - ATTR: function( match, curLoop, inplace, result, not, isXML ) { - var name = match[1] = match[1].replace( rBackslash, "" ); - - if ( !isXML && Expr.attrMap[name] ) { - match[1] = Expr.attrMap[name]; - } - - // Handle if an un-quoted value was used - match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" ); - - if ( match[2] === "~=" ) { - match[4] = " " + match[4] + " "; - } - - return match; - }, - - PSEUDO: function( match, curLoop, inplace, result, not ) { - if ( match[1] === "not" ) { - // If we're dealing with a complex expression, or a simple one - if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { - match[3] = Sizzle(match[3], null, null, curLoop); - - } else { - var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); - - if ( !inplace ) { - result.push.apply( result, ret ); - } - - return false; - } - - } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { - return true; - } - - return match; - }, - - POS: function( match ) { - match.unshift( true ); - - return match; - } - }, - - filters: { - enabled: function( elem ) { - return elem.disabled === false && elem.type !== "hidden"; - }, - - disabled: function( elem ) { - return elem.disabled === true; - }, - - checked: function( elem ) { - return elem.checked === true; - }, - - selected: function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - parent: function( elem ) { - return !!elem.firstChild; - }, - - empty: function( elem ) { - return !elem.firstChild; - }, - - has: function( elem, i, match ) { - return !!Sizzle( match[3], elem ).length; - }, - - header: function( elem ) { - return (/h\d/i).test( elem.nodeName ); - }, - - text: function( elem ) { - var attr = elem.getAttribute( "type" ), type = elem.type; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null ); - }, - - radio: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type; - }, - - checkbox: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type; - }, - - file: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "file" === elem.type; - }, - - password: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "password" === elem.type; - }, - - submit: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "submit" === elem.type; - }, - - image: function( elem ) { - return elem.nodeName.toLowerCase() === "input" && "image" === elem.type; - }, - - reset: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && "reset" === elem.type; - }, - - button: function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && "button" === elem.type || name === "button"; - }, - - input: function( elem ) { - return (/input|select|textarea|button/i).test( elem.nodeName ); - }, - - focus: function( elem ) { - return elem === elem.ownerDocument.activeElement; - } - }, - setFilters: { - first: function( elem, i ) { - return i === 0; - }, - - last: function( elem, i, match, array ) { - return i === array.length - 1; - }, - - even: function( elem, i ) { - return i % 2 === 0; - }, - - odd: function( elem, i ) { - return i % 2 === 1; - }, - - lt: function( elem, i, match ) { - return i < match[3] - 0; - }, - - gt: function( elem, i, match ) { - return i > match[3] - 0; - }, - - nth: function( elem, i, match ) { - return match[3] - 0 === i; - }, - - eq: function( elem, i, match ) { - return match[3] - 0 === i; - } - }, - filter: { - PSEUDO: function( elem, match, i, array ) { - var name = match[1], - filter = Expr.filters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - - } else if ( name === "contains" ) { - return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0; - - } else if ( name === "not" ) { - var not = match[3]; - - for ( var j = 0, l = not.length; j < l; j++ ) { - if ( not[j] === elem ) { - return false; - } - } - - return true; - - } else { - Sizzle.error( name ); - } - }, - - CHILD: function( elem, match ) { - var first, last, - doneName, parent, cache, - count, diff, - type = match[1], - node = elem; - - switch ( type ) { - case "only": - case "first": - while ( (node = node.previousSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - if ( type === "first" ) { - return true; - } - - node = elem; - - case "last": - while ( (node = node.nextSibling) ) { - if ( node.nodeType === 1 ) { - return false; - } - } - - return true; - - case "nth": - first = match[2]; - last = match[3]; - - if ( first === 1 && last === 0 ) { - return true; - } - - doneName = match[0]; - parent = elem.parentNode; - - if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) { - count = 0; - - for ( node = parent.firstChild; node; node = node.nextSibling ) { - if ( node.nodeType === 1 ) { - node.nodeIndex = ++count; - } - } - - parent[ expando ] = doneName; - } - - diff = elem.nodeIndex - last; - - if ( first === 0 ) { - return diff === 0; - - } else { - return ( diff % first === 0 && diff / first >= 0 ); - } - } - }, - - ID: function( elem, match ) { - return elem.nodeType === 1 && elem.getAttribute("id") === match; - }, - - TAG: function( elem, match ) { - return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match; - }, - - CLASS: function( elem, match ) { - return (" " + (elem.className || elem.getAttribute("class")) + " ") - .indexOf( match ) > -1; - }, - - ATTR: function( elem, match ) { - var name = match[1], - result = Sizzle.attr ? - Sizzle.attr( elem, name ) : - Expr.attrHandle[ name ] ? - Expr.attrHandle[ name ]( elem ) : - elem[ name ] != null ? - elem[ name ] : - elem.getAttribute( name ), - value = result + "", - type = match[2], - check = match[4]; - - return result == null ? - type === "!=" : - !type && Sizzle.attr ? - result != null : - type === "=" ? - value === check : - type === "*=" ? - value.indexOf(check) >= 0 : - type === "~=" ? - (" " + value + " ").indexOf(check) >= 0 : - !check ? - value && result !== false : - type === "!=" ? - value !== check : - type === "^=" ? - value.indexOf(check) === 0 : - type === "$=" ? - value.substr(value.length - check.length) === check : - type === "|=" ? - value === check || value.substr(0, check.length + 1) === check + "-" : - false; - }, - - POS: function( elem, match, i, array ) { - var name = match[2], - filter = Expr.setFilters[ name ]; - - if ( filter ) { - return filter( elem, i, match, array ); - } - } - } -}; - -var origPOS = Expr.match.POS, - fescape = function(all, num){ - return "\\" + (num - 0 + 1); - }; - -for ( var type in Expr.match ) { - Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); - Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); -} - -var makeArray = function( array, results ) { - array = Array.prototype.slice.call( array, 0 ); - - if ( results ) { - results.push.apply( results, array ); - return results; - } - - return array; -}; - -// Perform a simple check to determine if the browser is capable of -// converting a NodeList to an array using builtin methods. -// Also verifies that the returned array holds DOM nodes -// (which is not the case in the Blackberry browser) -try { - Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; - -// Provide a fallback method if it does not work -} catch( e ) { - makeArray = function( array, results ) { - var i = 0, - ret = results || []; - - if ( toString.call(array) === "[object Array]" ) { - Array.prototype.push.apply( ret, array ); - - } else { - if ( typeof array.length === "number" ) { - for ( var l = array.length; i < l; i++ ) { - ret.push( array[i] ); - } - - } else { - for ( ; array[i]; i++ ) { - ret.push( array[i] ); - } - } - } - - return ret; - }; -} - -var sortOrder, siblingCheck; - -if ( document.documentElement.compareDocumentPosition ) { - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { - return a.compareDocumentPosition ? -1 : 1; - } - - return a.compareDocumentPosition(b) & 4 ? -1 : 1; - }; - -} else { - sortOrder = function( a, b ) { - // The nodes are identical, we can exit early - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Fallback to using sourceIndex (in IE) if it's available on both nodes - } else if ( a.sourceIndex && b.sourceIndex ) { - return a.sourceIndex - b.sourceIndex; - } - - var al, bl, - ap = [], - bp = [], - aup = a.parentNode, - bup = b.parentNode, - cur = aup; - - // If the nodes are siblings (or identical) we can do a quick check - if ( aup === bup ) { - return siblingCheck( a, b ); - - // If no parents were found then the nodes are disconnected - } else if ( !aup ) { - return -1; - - } else if ( !bup ) { - return 1; - } - - // Otherwise they're somewhere else in the tree so we need - // to build up a full list of the parentNodes for comparison - while ( cur ) { - ap.unshift( cur ); - cur = cur.parentNode; - } - - cur = bup; - - while ( cur ) { - bp.unshift( cur ); - cur = cur.parentNode; - } - - al = ap.length; - bl = bp.length; - - // Start walking down the tree looking for a discrepancy - for ( var i = 0; i < al && i < bl; i++ ) { - if ( ap[i] !== bp[i] ) { - return siblingCheck( ap[i], bp[i] ); - } - } - - // We ended someplace up the tree so do a sibling check - return i === al ? - siblingCheck( a, bp[i], -1 ) : - siblingCheck( ap[i], b, 1 ); - }; - - siblingCheck = function( a, b, ret ) { - if ( a === b ) { - return ret; - } - - var cur = a.nextSibling; - - while ( cur ) { - if ( cur === b ) { - return -1; - } - - cur = cur.nextSibling; - } - - return 1; - }; -} - -// Check to see if the browser returns elements by name when -// querying by getElementById (and provide a workaround) -(function(){ - // We're going to inject a fake input element with a specified name - var form = document.createElement("div"), - id = "script" + (new Date()).getTime(), - root = document.documentElement; - - form.innerHTML = ""; - - // Inject it into the root element, check its status, and remove it quickly - root.insertBefore( form, root.firstChild ); - - // The workaround has to do additional checks after a getElementById - // Which slows things down for other browsers (hence the branching) - if ( document.getElementById( id ) ) { - Expr.find.ID = function( match, context, isXML ) { - if ( typeof context.getElementById !== "undefined" && !isXML ) { - var m = context.getElementById(match[1]); - - return m ? - m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? - [m] : - undefined : - []; - } - }; - - Expr.filter.ID = function( elem, match ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); - - return elem.nodeType === 1 && node && node.nodeValue === match; - }; - } - - root.removeChild( form ); - - // release memory in IE - root = form = null; -})(); - -(function(){ - // Check to see if the browser returns only elements - // when doing getElementsByTagName("*") - - // Create a fake element - var div = document.createElement("div"); - div.appendChild( document.createComment("") ); - - // Make sure no comments are found - if ( div.getElementsByTagName("*").length > 0 ) { - Expr.find.TAG = function( match, context ) { - var results = context.getElementsByTagName( match[1] ); - - // Filter out possible comments - if ( match[1] === "*" ) { - var tmp = []; - - for ( var i = 0; results[i]; i++ ) { - if ( results[i].nodeType === 1 ) { - tmp.push( results[i] ); - } - } - - results = tmp; - } - - return results; - }; - } - - // Check to see if an attribute returns normalized href attributes - div.innerHTML = ""; - - if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && - div.firstChild.getAttribute("href") !== "#" ) { - - Expr.attrHandle.href = function( elem ) { - return elem.getAttribute( "href", 2 ); - }; - } - - // release memory in IE - div = null; -})(); - -if ( document.querySelectorAll ) { - (function(){ - var oldSizzle = Sizzle, - div = document.createElement("div"), - id = "__sizzle__"; - - div.innerHTML = "

"; - - // Safari can't handle uppercase or unicode characters when - // in quirks mode. - if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { - return; - } - - Sizzle = function( query, context, extra, seed ) { - context = context || document; - - // Only use querySelectorAll on non-XML documents - // (ID selectors don't work in non-HTML documents) - if ( !seed && !Sizzle.isXML(context) ) { - // See if we find a selector to speed up - var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query ); - - if ( match && (context.nodeType === 1 || context.nodeType === 9) ) { - // Speed-up: Sizzle("TAG") - if ( match[1] ) { - return makeArray( context.getElementsByTagName( query ), extra ); - - // Speed-up: Sizzle(".CLASS") - } else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) { - return makeArray( context.getElementsByClassName( match[2] ), extra ); - } - } - - if ( context.nodeType === 9 ) { - // Speed-up: Sizzle("body") - // The body element only exists once, optimize finding it - if ( query === "body" && context.body ) { - return makeArray( [ context.body ], extra ); - - // Speed-up: Sizzle("#ID") - } else if ( match && match[3] ) { - var elem = context.getElementById( match[3] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id === match[3] ) { - return makeArray( [ elem ], extra ); - } - - } else { - return makeArray( [], extra ); - } - } - - try { - return makeArray( context.querySelectorAll(query), extra ); - } catch(qsaError) {} - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - var oldContext = context, - old = context.getAttribute( "id" ), - nid = old || id, - hasParent = context.parentNode, - relativeHierarchySelector = /^\s*[+~]/.test( query ); - - if ( !old ) { - context.setAttribute( "id", nid ); - } else { - nid = nid.replace( /'/g, "\\$&" ); - } - if ( relativeHierarchySelector && hasParent ) { - context = context.parentNode; - } - - try { - if ( !relativeHierarchySelector || hasParent ) { - return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra ); - } - - } catch(pseudoError) { - } finally { - if ( !old ) { - oldContext.removeAttribute( "id" ); - } - } - } - } - - return oldSizzle(query, context, extra, seed); - }; - - for ( var prop in oldSizzle ) { - Sizzle[ prop ] = oldSizzle[ prop ]; - } - - // release memory in IE - div = null; - })(); -} - -(function(){ - var html = document.documentElement, - matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector; - - if ( matches ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9 fails this) - var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ), - pseudoWorks = false; - - try { - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( document.documentElement, "[test!='']:sizzle" ); - - } catch( pseudoError ) { - pseudoWorks = true; - } - - Sizzle.matchesSelector = function( node, expr ) { - // Make sure that attribute selectors are quoted - expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); - - if ( !Sizzle.isXML( node ) ) { - try { - if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { - var ret = matches.call( node, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || !disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9, so check for that - node.document && node.document.nodeType !== 11 ) { - return ret; - } - } - } catch(e) {} - } - - return Sizzle(expr, null, null, [node]).length > 0; - }; - } -})(); - -(function(){ - var div = document.createElement("div"); - - div.innerHTML = "
"; - - // Opera can't find a second classname (in 9.6) - // Also, make sure that getElementsByClassName actually exists - if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { - return; - } - - // Safari caches class attributes, doesn't catch changes (in 3.2) - div.lastChild.className = "e"; - - if ( div.getElementsByClassName("e").length === 1 ) { - return; - } - - Expr.order.splice(1, 0, "CLASS"); - Expr.find.CLASS = function( match, context, isXML ) { - if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { - return context.getElementsByClassName(match[1]); - } - }; - - // release memory in IE - div = null; -})(); - -function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 && !isXML ){ - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( elem.nodeName.toLowerCase() === cur ) { - match = elem; - break; - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { - for ( var i = 0, l = checkSet.length; i < l; i++ ) { - var elem = checkSet[i]; - - if ( elem ) { - var match = false; - - elem = elem[dir]; - - while ( elem ) { - if ( elem[ expando ] === doneName ) { - match = checkSet[elem.sizset]; - break; - } - - if ( elem.nodeType === 1 ) { - if ( !isXML ) { - elem[ expando ] = doneName; - elem.sizset = i; - } - - if ( typeof cur !== "string" ) { - if ( elem === cur ) { - match = true; - break; - } - - } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { - match = elem; - break; - } - } - - elem = elem[dir]; - } - - checkSet[i] = match; - } - } -} - -if ( document.documentElement.contains ) { - Sizzle.contains = function( a, b ) { - return a !== b && (a.contains ? a.contains(b) : true); - }; - -} else if ( document.documentElement.compareDocumentPosition ) { - Sizzle.contains = function( a, b ) { - return !!(a.compareDocumentPosition(b) & 16); - }; - -} else { - Sizzle.contains = function() { - return false; - }; -} - -Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -var posProcess = function( selector, context, seed ) { - var match, - tmpSet = [], - later = "", - root = context.nodeType ? [context] : context; - - // Position selectors must be done after the filter - // And so must :not(positional) so we move all PSEUDOs to the end - while ( (match = Expr.match.PSEUDO.exec( selector )) ) { - later += match[0]; - selector = selector.replace( Expr.match.PSEUDO, "" ); - } - - selector = Expr.relative[selector] ? selector + "*" : selector; - - for ( var i = 0, l = root.length; i < l; i++ ) { - Sizzle( selector, root[i], tmpSet, seed ); - } - - return Sizzle.filter( later, tmpSet ); -}; - -// EXPOSE -// Override sizzle attribute retrieval -Sizzle.attr = jQuery.attr; -Sizzle.selectors.attrMap = {}; -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.filters; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - -})(); - - -var runtil = /Until$/, - rparentsprev = /^(?:parents|prevUntil|prevAll)/, - // Note: This RegExp should be improved, or likely pulled from Sizzle - rmultiselector = /,/, - isSimple = /^.[^:#\[\.,]*$/, - slice = Array.prototype.slice, - POS = jQuery.expr.match.POS, - // methods guaranteed to produce a unique set when starting from a unique set - guaranteedUnique = { - children: true, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend({ - find: function( selector ) { - var self = this, - i, l; - - if ( typeof selector !== "string" ) { - return jQuery( selector ).filter(function() { - for ( i = 0, l = self.length; i < l; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - }); - } - - var ret = this.pushStack( "", "find", selector ), - length, n, r; - - for ( i = 0, l = this.length; i < l; i++ ) { - length = ret.length; - jQuery.find( selector, this[i], ret ); - - if ( i > 0 ) { - // Make sure that the results are unique - for ( n = length; n < ret.length; n++ ) { - for ( r = 0; r < length; r++ ) { - if ( ret[r] === ret[n] ) { - ret.splice(n--, 1); - break; - } - } - } - } - } - - return ret; - }, - - has: function( target ) { - var targets = jQuery( target ); - return this.filter(function() { - for ( var i = 0, l = targets.length; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { - return true; - } - } - }); - }, - - not: function( selector ) { - return this.pushStack( winnow(this, selector, false), "not", selector); - }, - - filter: function( selector ) { - return this.pushStack( winnow(this, selector, true), "filter", selector ); - }, - - is: function( selector ) { - return !!selector && ( - typeof selector === "string" ? - // If this is a positional selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - POS.test( selector ) ? - jQuery( selector, this.context ).index( this[0] ) >= 0 : - jQuery.filter( selector, this ).length > 0 : - this.filter( selector ).length > 0 ); - }, - - closest: function( selectors, context ) { - var ret = [], i, l, cur = this[0]; - - // Array (deprecated as of jQuery 1.7) - if ( jQuery.isArray( selectors ) ) { - var level = 1; - - while ( cur && cur.ownerDocument && cur !== context ) { - for ( i = 0; i < selectors.length; i++ ) { - - if ( jQuery( cur ).is( selectors[ i ] ) ) { - ret.push({ selector: selectors[ i ], elem: cur, level: level }); - } - } - - cur = cur.parentNode; - level++; - } - - return ret; - } - - // String - var pos = POS.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - for ( i = 0, l = this.length; i < l; i++ ) { - cur = this[i]; - - while ( cur ) { - if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { - ret.push( cur ); - break; - - } else { - cur = cur.parentNode; - if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) { - break; - } - } - } - } - - ret = ret.length > 1 ? jQuery.unique( ret ) : ret; - - return this.pushStack( ret, "closest", selectors ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[0], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[0] : elem, this ); - }, - - add: function( selector, context ) { - var set = typeof selector === "string" ? - jQuery( selector, context ) : - jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ), - all = jQuery.merge( this.get(), set ); - - return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? - all : - jQuery.unique( all ) ); - }, - - andSelf: function() { - return this.add( this.prevObject ); - } -}); - -// A painfully simple check to see if an element is disconnected -// from a document (should be improved, where feasible). -function isDisconnected( node ) { - return !node || !node.parentNode || node.parentNode.nodeType === 11; -} - -jQuery.each({ - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return jQuery.nth( elem, 2, "nextSibling" ); - }, - prev: function( elem ) { - return jQuery.nth( elem, 2, "previousSibling" ); - }, - nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return jQuery.sibling( elem.parentNode.firstChild, elem ); - }, - children: function( elem ) { - return jQuery.sibling( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.makeArray( elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ), - // The variable 'args' was introduced in - // https://github.com/jquery/jquery/commit/52a0238 - // to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed. - // http://code.google.com/p/v8/issues/detail?id=1050 - args = slice.call(arguments); - - if ( !runtil.test( name ) ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret; - - if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - - return this.pushStack( ret, name, args.join(",") ); - }; -}); - -jQuery.extend({ - filter: function( expr, elems, not ) { - if ( not ) { - expr = ":not(" + expr + ")"; - } - - return elems.length === 1 ? - jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : - jQuery.find.matches(expr, elems); - }, - - dir: function( elem, dir, until ) { - var matched = [], - cur = elem[ dir ]; - - while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { - if ( cur.nodeType === 1 ) { - matched.push( cur ); - } - cur = cur[dir]; - } - return matched; - }, - - nth: function( cur, result, dir, elem ) { - result = result || 1; - var num = 0; - - for ( ; cur; cur = cur[dir] ) { - if ( cur.nodeType === 1 && ++num === result ) { - break; - } - } - - return cur; - }, - - sibling: function( n, elem ) { - var r = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - r.push( n ); - } - } - - return r; - } -}); - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, keep ) { - - // Can't pass null or undefined to indexOf in Firefox 4 - // Set to 0 to skip string check - qualifier = qualifier || 0; - - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep(elements, function( elem, i ) { - var retVal = !!qualifier.call( elem, i, elem ); - return retVal === keep; - }); - - } else if ( qualifier.nodeType ) { - return jQuery.grep(elements, function( elem, i ) { - return ( elem === qualifier ) === keep; - }); - - } else if ( typeof qualifier === "string" ) { - var filtered = jQuery.grep(elements, function( elem ) { - return elem.nodeType === 1; - }); - - if ( isSimple.test( qualifier ) ) { - return jQuery.filter(qualifier, filtered, !keep); - } else { - qualifier = jQuery.filter( qualifier, filtered ); - } - } - - return jQuery.grep(elements, function( elem, i ) { - return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep; - }); -} - - - - -function createSafeFragment( document ) { - var list = nodeNames.split( " " ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - -var nodeNames = "abbr article aside audio canvas datalist details figcaption figure footer " + - "header hgroup mark meter nav output progress section summary time video", - rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, - rleadingWhitespace = /^\s+/, - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, - rtagName = /<([\w:]+)/, - rtbody = /", "" ], - legend: [ 1, "
", "
" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - td: [ 3, "", "
" ], - col: [ 2, "", "
" ], - area: [ 1, "", "" ], - _default: [ 0, "", "" ] - }, - safeFragment = createSafeFragment( document ); - -wrapMap.optgroup = wrapMap.option; -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// IE can't serialize and