/*package*/ NamespaceTranslator(
     @NotNull NamespaceDescriptor descriptor,
     @NotNull ClassDeclarationTranslator classDeclarationTranslator,
     @NotNull TranslationContext context) {
   super(context.newDeclaration(descriptor));
   this.descriptor = descriptor;
   this.namespaceName = context.getNameForDescriptor(descriptor);
   this.classDeclarationTranslator = classDeclarationTranslator;
 }
示例#2
0
 @Nullable
 private JsExpression getThisObject() {
   if (qualifier != null && !isExtensionCall) {
     return qualifier;
   }
   return context.thisAliasProvider().get(resolvedCall);
 }
  public ClassDeclarationTranslator(@NotNull TranslationContext context) {
    super(context);

    dummyFunction = new JsFunction(context.scope());
    JsName declarationsObject = context().scope().declareName(Namer.nameForClassesVariable());
    classesVar = new JsVars.JsVar(declarationsObject);
    declarationsObjectRef = declarationsObject.makeRef();
  }
示例#4
0
 @NotNull
 private JsExpression getExtensionFunctionCallReceiver() {
   if (qualifier != null) {
     return qualifier;
   }
   DeclarationDescriptor receiverDescriptor =
       getDeclarationDescriptorForExtensionCallReceiver(resolvedCall);
   return context.getThisObject(receiverDescriptor);
 }
示例#5
0
 /* package */
 @NotNull
 static DefineInvocation create(
     @NotNull FqName packageFqName,
     @Nullable JsExpression initializer,
     @NotNull JsObjectLiteral members,
     @NotNull TranslationContext context) {
   return new DefineInvocation(
       initializer == null ? JsLiteral.NULL : initializer,
       new JsDocComment(JsAstUtils.LENDS_JS_DOC_TAG, context.getQualifiedReference(packageFqName)),
       members);
 }
 /*package*/ CachedArrayAccessTranslator(
     @NotNull JetArrayAccessExpression expression, @NotNull TranslationContext context) {
   super(expression, context);
   arrayExpression = context.declareTemporary(translateArrayExpression());
   indexExpressions = fromExpressionList(translateIndexExpressions(), context);
 }
示例#7
0
 @Nullable
 public static Name getNameIfStandardType(
     @NotNull JetExpression expression, @NotNull TranslationContext context) {
   JetType type = context.bindingContext().get(BindingContext.EXPRESSION_TYPE, expression);
   return type != null ? getNameIfStandardType(type) : null;
 }