org.jetbrains.k2js.translate.utils.dangerous
Class DangerousData

java.lang.Object
  extended by org.jetbrains.k2js.translate.utils.dangerous.DangerousData

public class DangerousData
extends java.lang.Object

This module uses a methaphor for naming.

Dangerous are the nodes that can be expressions in Kotlin but can't be expressions in JavaScript. These are: when, if, inlined functions. The issue with them is that we have to translate them to a list of statements. And also all the expressions which must be computed before the dangerous expressions. RootNode is a node which contains such an expression. For example, it may be a statement expression belongs to.


Constructor Summary
DangerousData()
           
 
Method Summary
static DangerousData collect(JetExpression expression, TranslationContext context)
           
static DangerousData emptyData()
           
 boolean exists()
           
 JetExpression getDangerousNode()
           
 java.util.List<JetExpression> getNodesToBeGeneratedBefore()
           
 JetExpression getRootNode()
           
 void setDangerousNode(JetExpression dangerousNode)
           
 void setRootNode(JetExpression rootNode)
           
 boolean shouldBeTranslated()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DangerousData

public DangerousData()
Method Detail

collect

@NotNull
public static DangerousData collect(@NotNull
                                            JetExpression expression,
                                            @NotNull
                                            TranslationContext context)

emptyData

@NotNull
public static DangerousData emptyData()

setDangerousNode

public void setDangerousNode(@NotNull
                             JetExpression dangerousNode)

getNodesToBeGeneratedBefore

@NotNull
public java.util.List<JetExpression> getNodesToBeGeneratedBefore()

exists

public boolean exists()

shouldBeTranslated

public boolean shouldBeTranslated()

getDangerousNode

@NotNull
public JetExpression getDangerousNode()

getRootNode

@NotNull
public JetExpression getRootNode()

setRootNode

public void setRootNode(@NotNull
                        JetExpression rootNode)