@NotNull public TranslationContext innerContextWithThisAliased( @NotNull DeclarationDescriptor correspondingDescriptor, @NotNull JsName alias) { return new TranslationContext( staticContext, dynamicContext, aliasingContext.withThisAliased(correspondingDescriptor, alias)); }
@NotNull public JsName getNameForDescriptor(@NotNull DeclarationDescriptor descriptor) { JsName alias = aliasingContext.getAliasForDescriptor(descriptor); if (alias != null) { return alias; } return staticContext.getNameForDescriptor(descriptor); }
@NotNull public static TranslationContext rootContext(@NotNull StaticContext staticContext) { JsProgram program = staticContext.getProgram(); JsBlock globalBlock = program.getGlobalBlock(); DynamicContext rootDynamicContext = DynamicContext.rootContext(staticContext.getRootScope(), globalBlock); AliasingContext rootAliasingContext = AliasingContext.getCleanContext(); return new TranslationContext(staticContext, rootDynamicContext, rootAliasingContext); }
@NotNull public TranslationContext innerContextWithDescriptorsAliased( @NotNull Map<DeclarationDescriptor, JsName> aliases) { return new TranslationContext( staticContext, dynamicContext, aliasingContext.withDescriptorsAliased(aliases)); }
@NotNull public TranslationContext innerContextWithAliasesForExpressions( @NotNull Map<JetExpression, JsName> aliases) { return new TranslationContext( staticContext, dynamicContext, aliasingContext.withAliasesForExpressions(aliases)); }