org.jetbrains.kotlin.js.translate.context
Class Namer

java.lang.Object
  extended by org.jetbrains.kotlin.js.translate.context.Namer

public final class Namer
extends java.lang.Object

Encapsulates different types of constants and naming conventions.


Field Summary
static java.lang.String ANOTHER_THIS_PARAMETER_NAME
           
static java.lang.String CALL_FUNCTION
           
static java.lang.String CALLEE_NAME
           
static java.lang.String CLASS_KIND_CLASS
           
static java.lang.String CLASS_KIND_ENUM
           
static java.lang.String CLASS_KIND_INTERFACE
           
static java.lang.String CLASS_KIND_OBJECT
           
static java.lang.String COMPARE_TO_METHOD_NAME
           
static java.lang.String DEFAULT_PARAMETER_IMPLEMENTOR_SUFFIX
           
static java.lang.String DEFINE_INLINE_FUNCTION
           
static java.lang.String ENUM_NAME_FIELD
           
static java.lang.String ENUM_ORDINAL_FIELD
           
static java.lang.String EQUALS_METHOD_NAME
           
static java.lang.String FUNCTION_CALLABLE_REF
           
static java.lang.String GET_KCLASS
           
static java.lang.String GET_KCLASS_FROM_EXPRESSION
           
static JsNameRef IS_ARRAY_FUN_REF
           
static java.lang.String IS_CHAR
           
static java.lang.String IS_NUMBER
           
static java.lang.String KOTLIN_LOWER_NAME
           
static java.lang.String KOTLIN_NAME
           
static java.lang.String LOCAL_MODULE_PREFIX
           
static java.lang.String LONG_FROM_INT
           
static java.lang.String LONG_FROM_NUMBER
           
static java.lang.String LONG_NEG_ONE
           
static java.lang.String LONG_ONE
           
static java.lang.String LONG_TO_NUMBER
           
static java.lang.String LONG_ZERO
           
static java.lang.String METADATA
           
static java.lang.String METADATA_CLASS_KIND
           
static java.lang.String METADATA_SIMPLE_NAME
           
static java.lang.String METADATA_SUPERTYPES
           
static java.lang.String OBJECT_INSTANCE_FUNCTION_SUFFIX
           
static java.lang.String OBJECT_INSTANCE_VAR_SUFFIX
           
static java.lang.String OUTER_FIELD_NAME
           
static java.lang.String PRIMITIVE_COMPARE_TO
           
static java.lang.String PROPERTY_CALLABLE_REF
           
 
Method Summary
 JsExpression andPredicate(JsExpression a, JsExpression b)
           
static JsNameRef createInlineFunction()
           
static JsInvocation createObjectWithPrototypeFrom(JsExpression referenceToClass)
           
 JsExpression getCallGetProperty()
           
 JsExpression getCallSetProperty()
           
static JsNameRef getCapturedVarAccessor(JsExpression ref)
           
static java.lang.String getDelegateName(java.lang.String propertyName)
           
static JsNameRef getDelegateNameRef(java.lang.String propertyName)
           
static java.lang.String getDelegatePrefix()
           
static JsNameRef getFunctionApplyRef(JsExpression functionExpression)
           
static JsNameRef getFunctionCallRef(JsExpression functionExpression)
           
static java.lang.String getFunctionTag(CallableDescriptor functionDescriptor)
           
static java.lang.String getPrototypeName()
           
static java.lang.String getReceiverParameterName()
           
static java.lang.String getRootPackageName()
           
static java.lang.String getStableMangledNameForDescriptor(ClassDescriptor descriptor, java.lang.String functionName)
           
static JsExpression getUndefinedExpression()
           
static JsNameRef imul()
           
 JsExpression isCharSequence()
           
 JsExpression isComparable()
           
 JsExpression isInstanceOf(JsExpression type)
           
 JsExpression isInstanceOf(JsExpression instance, JsExpression type)
           
static java.lang.String isInstanceSuggestedName(TypeParameterDescriptor descriptor)
           
 JsExpression isTypeOf(JsExpression type)
           
static JsNameRef kotlin(JsName name)
           
 JsNameRef kotlin(java.lang.String name)
           
static JsNameRef kotlinLong()
           
static JsNameRef kotlinObject()
           
static Namer newInstance(JsScope rootScope)
           
 JsExpression orNull(JsExpression callable)
           
static boolean requiresEscaping(java.lang.String name)
           
static java.lang.String suggestedModuleName(java.lang.String id)
           
static JsExpression throwClassCastExceptionFunRef()
           
static JsExpression throwIllegalStateExceptionFunRef()
           
static JsExpression throwNPEFunctionRef()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

KOTLIN_NAME

public static final java.lang.String KOTLIN_NAME
See Also:
Constant Field Values

KOTLIN_LOWER_NAME

public static final java.lang.String KOTLIN_LOWER_NAME

EQUALS_METHOD_NAME

public static final java.lang.String EQUALS_METHOD_NAME

COMPARE_TO_METHOD_NAME

public static final java.lang.String COMPARE_TO_METHOD_NAME

LONG_FROM_NUMBER

public static final java.lang.String LONG_FROM_NUMBER
See Also:
Constant Field Values

LONG_TO_NUMBER

public static final java.lang.String LONG_TO_NUMBER
See Also:
Constant Field Values

LONG_FROM_INT

public static final java.lang.String LONG_FROM_INT
See Also:
Constant Field Values

LONG_ZERO

public static final java.lang.String LONG_ZERO
See Also:
Constant Field Values

LONG_ONE

public static final java.lang.String LONG_ONE
See Also:
Constant Field Values

LONG_NEG_ONE

public static final java.lang.String LONG_NEG_ONE
See Also:
Constant Field Values

PRIMITIVE_COMPARE_TO

public static final java.lang.String PRIMITIVE_COMPARE_TO
See Also:
Constant Field Values

IS_CHAR

public static final java.lang.String IS_CHAR
See Also:
Constant Field Values

IS_NUMBER

public static final java.lang.String IS_NUMBER
See Also:
Constant Field Values

GET_KCLASS

public static final java.lang.String GET_KCLASS
See Also:
Constant Field Values

GET_KCLASS_FROM_EXPRESSION

public static final java.lang.String GET_KCLASS_FROM_EXPRESSION
See Also:
Constant Field Values

CALLEE_NAME

public static final java.lang.String CALLEE_NAME
See Also:
Constant Field Values

CALL_FUNCTION

public static final java.lang.String CALL_FUNCTION
See Also:
Constant Field Values

OUTER_FIELD_NAME

public static final java.lang.String OUTER_FIELD_NAME
See Also:
Constant Field Values

ANOTHER_THIS_PARAMETER_NAME

public static final java.lang.String ANOTHER_THIS_PARAMETER_NAME
See Also:
Constant Field Values

IS_ARRAY_FUN_REF

public static final JsNameRef IS_ARRAY_FUN_REF

DEFINE_INLINE_FUNCTION

public static final java.lang.String DEFINE_INLINE_FUNCTION
See Also:
Constant Field Values

DEFAULT_PARAMETER_IMPLEMENTOR_SUFFIX

public static final java.lang.String DEFAULT_PARAMETER_IMPLEMENTOR_SUFFIX
See Also:
Constant Field Values

LOCAL_MODULE_PREFIX

public static final java.lang.String LOCAL_MODULE_PREFIX
See Also:
Constant Field Values

METADATA

public static final java.lang.String METADATA
See Also:
Constant Field Values

METADATA_SUPERTYPES

public static final java.lang.String METADATA_SUPERTYPES
See Also:
Constant Field Values

METADATA_SIMPLE_NAME

public static final java.lang.String METADATA_SIMPLE_NAME
See Also:
Constant Field Values

METADATA_CLASS_KIND

public static final java.lang.String METADATA_CLASS_KIND
See Also:
Constant Field Values

CLASS_KIND_ENUM

public static final java.lang.String CLASS_KIND_ENUM
See Also:
Constant Field Values

CLASS_KIND_CLASS

public static final java.lang.String CLASS_KIND_CLASS
See Also:
Constant Field Values

CLASS_KIND_INTERFACE

public static final java.lang.String CLASS_KIND_INTERFACE
See Also:
Constant Field Values

CLASS_KIND_OBJECT

public static final java.lang.String CLASS_KIND_OBJECT
See Also:
Constant Field Values

OBJECT_INSTANCE_VAR_SUFFIX

public static final java.lang.String OBJECT_INSTANCE_VAR_SUFFIX
See Also:
Constant Field Values

OBJECT_INSTANCE_FUNCTION_SUFFIX

public static final java.lang.String OBJECT_INSTANCE_FUNCTION_SUFFIX
See Also:
Constant Field Values

ENUM_NAME_FIELD

public static final java.lang.String ENUM_NAME_FIELD
See Also:
Constant Field Values

ENUM_ORDINAL_FIELD

public static final java.lang.String ENUM_ORDINAL_FIELD
See Also:
Constant Field Values

FUNCTION_CALLABLE_REF

@NotNull
public static final java.lang.String FUNCTION_CALLABLE_REF
See Also:
Constant Field Values

PROPERTY_CALLABLE_REF

@NotNull
public static final java.lang.String PROPERTY_CALLABLE_REF
See Also:
Constant Field Values
Method Detail

getFunctionTag

@NotNull
public static java.lang.String getFunctionTag(@NotNull
                                                      CallableDescriptor functionDescriptor)

getReceiverParameterName

@NotNull
public static java.lang.String getReceiverParameterName()

getRootPackageName

@NotNull
public static java.lang.String getRootPackageName()

getPrototypeName

@NotNull
public static java.lang.String getPrototypeName()

getDelegatePrefix

@NotNull
public static java.lang.String getDelegatePrefix()

getDelegateName

@NotNull
public static java.lang.String getDelegateName(@NotNull
                                                       java.lang.String propertyName)

getDelegateNameRef

@NotNull
public static JsNameRef getDelegateNameRef(java.lang.String propertyName)

getFunctionCallRef

@NotNull
public static JsNameRef getFunctionCallRef(@NotNull
                                                   JsExpression functionExpression)

getFunctionApplyRef

@NotNull
public static JsNameRef getFunctionApplyRef(@NotNull
                                                    JsExpression functionExpression)

createObjectWithPrototypeFrom

@NotNull
public static JsInvocation createObjectWithPrototypeFrom(@NotNull
                                                                 JsExpression referenceToClass)

getCapturedVarAccessor

@NotNull
public static JsNameRef getCapturedVarAccessor(@NotNull
                                                       JsExpression ref)

isInstanceSuggestedName

@NotNull
public static java.lang.String isInstanceSuggestedName(@NotNull
                                                               TypeParameterDescriptor descriptor)

newInstance

@NotNull
public static Namer newInstance(@NotNull
                                        JsScope rootScope)

getStableMangledNameForDescriptor

@NotNull
public static java.lang.String getStableMangledNameForDescriptor(@NotNull
                                                                         ClassDescriptor descriptor,
                                                                         @NotNull
                                                                         java.lang.String functionName)

throwNPEFunctionRef

@NotNull
public static JsExpression throwNPEFunctionRef()

throwClassCastExceptionFunRef

@NotNull
public static JsExpression throwClassCastExceptionFunRef()

throwIllegalStateExceptionFunRef

@NotNull
public static JsExpression throwIllegalStateExceptionFunRef()

kotlin

@NotNull
public static JsNameRef kotlin(@NotNull
                                       JsName name)

kotlin

@NotNull
public JsNameRef kotlin(@NotNull
                                java.lang.String name)

kotlinObject

@NotNull
public static JsNameRef kotlinObject()

isTypeOf

@NotNull
public JsExpression isTypeOf(@NotNull
                                     JsExpression type)

isInstanceOf

@NotNull
public JsExpression isInstanceOf(@NotNull
                                         JsExpression type)

orNull

@NotNull
public JsExpression orNull(@NotNull
                                   JsExpression callable)

andPredicate

@NotNull
public JsExpression andPredicate(@NotNull
                                         JsExpression a,
                                         @NotNull
                                         JsExpression b)

isComparable

@NotNull
public JsExpression isComparable()

isCharSequence

@NotNull
public JsExpression isCharSequence()

isInstanceOf

@NotNull
public JsExpression isInstanceOf(@NotNull
                                         JsExpression instance,
                                         @NotNull
                                         JsExpression type)

getUndefinedExpression

@NotNull
public static JsExpression getUndefinedExpression()

getCallGetProperty

@NotNull
public JsExpression getCallGetProperty()

getCallSetProperty

@NotNull
public JsExpression getCallSetProperty()

kotlinLong

public static JsNameRef kotlinLong()

createInlineFunction

@NotNull
public static JsNameRef createInlineFunction()

suggestedModuleName

@NotNull
public static java.lang.String suggestedModuleName(@NotNull
                                                           java.lang.String id)

imul

public static JsNameRef imul()

requiresEscaping

public static boolean requiresEscaping(@NotNull
                                       java.lang.String name)