org.jetbrains.k2js.translate.utils.dangerous
Class DangerousData
java.lang.Object
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.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DangerousData
public DangerousData()
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)