org.jetbrains.k2js.translate.utils
Class TranslationUtils

java.lang.Object
  extended by org.jetbrains.k2js.translate.utils.TranslationUtils

public final class TranslationUtils
extends java.lang.Object


Method Summary
static com.google.dart.compiler.backend.js.ast.JsExpression assignmentToBackingField(TranslationContext context, PropertyDescriptor descriptor, com.google.dart.compiler.backend.js.ast.JsExpression assignTo)
           
static com.google.dart.compiler.backend.js.ast.JsNameRef backingFieldReference(TranslationContext context, PropertyDescriptor descriptor)
           
static com.intellij.openapi.util.Pair<com.google.dart.compiler.backend.js.ast.JsVars.JsVar,com.google.dart.compiler.backend.js.ast.JsExpression> createTemporaryIfNeed(com.google.dart.compiler.backend.js.ast.JsExpression expression, TranslationContext context)
           
static java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> generateInvocationArguments(com.google.dart.compiler.backend.js.ast.JsExpression receiver, java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> arguments)
           
static com.google.dart.compiler.backend.js.ast.JsNameRef getQualifiedReference(TranslationContext context, DeclarationDescriptor descriptor)
           
static boolean hasCorrespondingFunctionIntrinsic(TranslationContext context, JetOperationExpression expression)
           
static boolean isCacheNeeded(com.google.dart.compiler.backend.js.ast.JsExpression expression)
           
static boolean isEqualLikeOperator(com.google.dart.compiler.backend.js.ast.JsBinaryOperator operator)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation isNotNullCheck(com.google.dart.compiler.backend.js.ast.JsExpression expressionToCheck)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation isNullCheck(com.google.dart.compiler.backend.js.ast.JsExpression expressionToCheck)
           
static com.google.dart.compiler.backend.js.ast.JsConditional notNullConditional(com.google.dart.compiler.backend.js.ast.JsExpression expression, com.google.dart.compiler.backend.js.ast.JsExpression elseExpression, TranslationContext context)
           
static com.google.dart.compiler.backend.js.ast.JsBinaryOperation nullCheck(com.google.dart.compiler.backend.js.ast.JsExpression expressionToCheck, boolean isNegated)
           
static com.google.dart.compiler.backend.js.ast.JsFunction simpleReturnFunction(com.google.dart.compiler.backend.js.ast.JsScope functionScope, com.google.dart.compiler.backend.js.ast.JsExpression returnExpression)
           
static com.google.dart.compiler.backend.js.ast.JsConditional sure(com.google.dart.compiler.backend.js.ast.JsExpression expression, TranslationContext context)
           
static java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> translateArgumentList(TranslationContext context, java.util.List<? extends ValueArgument> jetArguments)
           
static com.google.dart.compiler.backend.js.ast.JsExpression translateBaseExpression(TranslationContext context, JetUnaryExpression expression)
           
static com.google.dart.compiler.backend.js.ast.JsExpression translateExclForBinaryEqualLikeExpr(com.google.dart.compiler.backend.js.ast.JsBinaryOperation baseBinaryExpression)
           
static java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> translateExpressionList(TranslationContext context, java.util.List<JetExpression> expressions)
           
static com.google.dart.compiler.backend.js.ast.JsPropertyInitializer translateFunctionAsEcma5PropertyDescriptor(com.google.dart.compiler.backend.js.ast.JsFunction function, FunctionDescriptor descriptor, TranslationContext context)
           
static com.google.dart.compiler.backend.js.ast.JsExpression translateInitializerForProperty(JetProperty declaration, TranslationContext context)
           
static com.google.dart.compiler.backend.js.ast.JsExpression translateLeftExpression(TranslationContext context, JetBinaryExpression expression)
           
static com.google.dart.compiler.backend.js.ast.JsExpression translateRightExpression(TranslationContext context, JetBinaryExpression expression)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

translateFunctionAsEcma5PropertyDescriptor

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsPropertyInitializer translateFunctionAsEcma5PropertyDescriptor(@NotNull
                                                                                                                               com.google.dart.compiler.backend.js.ast.JsFunction function,
                                                                                                                               @NotNull
                                                                                                                               FunctionDescriptor descriptor,
                                                                                                                               @NotNull
                                                                                                                               TranslationContext context)

simpleReturnFunction

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsFunction simpleReturnFunction(@NotNull
                                                                                              com.google.dart.compiler.backend.js.ast.JsScope functionScope,
                                                                                              @NotNull
                                                                                              com.google.dart.compiler.backend.js.ast.JsExpression returnExpression)

translateExclForBinaryEqualLikeExpr

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsExpression translateExclForBinaryEqualLikeExpr(@NotNull
                                                                                                               com.google.dart.compiler.backend.js.ast.JsBinaryOperation baseBinaryExpression)

isEqualLikeOperator

public static boolean isEqualLikeOperator(@NotNull
                                          com.google.dart.compiler.backend.js.ast.JsBinaryOperator operator)

isNullCheck

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation isNullCheck(@NotNull
                                                                                            com.google.dart.compiler.backend.js.ast.JsExpression expressionToCheck)

isNotNullCheck

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation isNotNullCheck(@NotNull
                                                                                               com.google.dart.compiler.backend.js.ast.JsExpression expressionToCheck)

nullCheck

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsBinaryOperation nullCheck(@NotNull
                                                                                          com.google.dart.compiler.backend.js.ast.JsExpression expressionToCheck,
                                                                                          boolean isNegated)

notNullConditional

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsConditional notNullConditional(@NotNull
                                                                                               com.google.dart.compiler.backend.js.ast.JsExpression expression,
                                                                                               @NotNull
                                                                                               com.google.dart.compiler.backend.js.ast.JsExpression elseExpression,
                                                                                               @NotNull
                                                                                               TranslationContext context)

translateArgumentList

@NotNull
public static java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> translateArgumentList(@NotNull
                                                                                                                 TranslationContext context,
                                                                                                                 @NotNull
                                                                                                                 java.util.List<? extends ValueArgument> jetArguments)

backingFieldReference

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsNameRef backingFieldReference(@NotNull
                                                                                              TranslationContext context,
                                                                                              @NotNull
                                                                                              PropertyDescriptor descriptor)

assignmentToBackingField

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsExpression assignmentToBackingField(@NotNull
                                                                                                    TranslationContext context,
                                                                                                    @NotNull
                                                                                                    PropertyDescriptor descriptor,
                                                                                                    @NotNull
                                                                                                    com.google.dart.compiler.backend.js.ast.JsExpression assignTo)

translateInitializerForProperty

@Nullable
public static com.google.dart.compiler.backend.js.ast.JsExpression translateInitializerForProperty(@NotNull
                                                                                                            JetProperty declaration,
                                                                                                            @NotNull
                                                                                                            TranslationContext context)

getQualifiedReference

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsNameRef getQualifiedReference(@NotNull
                                                                                              TranslationContext context,
                                                                                              @NotNull
                                                                                              DeclarationDescriptor descriptor)

translateExpressionList

@NotNull
public static java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> translateExpressionList(@NotNull
                                                                                                                   TranslationContext context,
                                                                                                                   @NotNull
                                                                                                                   java.util.List<JetExpression> expressions)

translateBaseExpression

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsExpression translateBaseExpression(@NotNull
                                                                                                   TranslationContext context,
                                                                                                   @NotNull
                                                                                                   JetUnaryExpression expression)

translateLeftExpression

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsExpression translateLeftExpression(@NotNull
                                                                                                   TranslationContext context,
                                                                                                   @NotNull
                                                                                                   JetBinaryExpression expression)

translateRightExpression

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsExpression translateRightExpression(@NotNull
                                                                                                    TranslationContext context,
                                                                                                    @NotNull
                                                                                                    JetBinaryExpression expression)

hasCorrespondingFunctionIntrinsic

public static boolean hasCorrespondingFunctionIntrinsic(@NotNull
                                                        TranslationContext context,
                                                        @NotNull
                                                        JetOperationExpression expression)

generateInvocationArguments

@NotNull
public static java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> generateInvocationArguments(@NotNull
                                                                                                                       com.google.dart.compiler.backend.js.ast.JsExpression receiver,
                                                                                                                       @NotNull
                                                                                                                       java.util.List<com.google.dart.compiler.backend.js.ast.JsExpression> arguments)

isCacheNeeded

public static boolean isCacheNeeded(@NotNull
                                    com.google.dart.compiler.backend.js.ast.JsExpression expression)

createTemporaryIfNeed

@NotNull
public static com.intellij.openapi.util.Pair<com.google.dart.compiler.backend.js.ast.JsVars.JsVar,com.google.dart.compiler.backend.js.ast.JsExpression> createTemporaryIfNeed(@NotNull
                                                                                                                                                                                      com.google.dart.compiler.backend.js.ast.JsExpression expression,
                                                                                                                                                                                      @NotNull
                                                                                                                                                                                      TranslationContext context)

sure

@NotNull
public static com.google.dart.compiler.backend.js.ast.JsConditional sure(@NotNull
                                                                                 com.google.dart.compiler.backend.js.ast.JsExpression expression,
                                                                                 @NotNull
                                                                                 TranslationContext context)