use of org.jetbrains.kotlin.js.backend.ast.JsExpression in project kotlin by JetBrains.
the class OverloadedAssignmentTranslator method reassignment.
@NotNull
private JsExpression reassignment() {
KtExpression left = expression.getLeft();
assert left != null;
AccessTranslator accessTranslator = AccessTranslationUtils.getAccessTranslator(left, context()).getCached();
JsExpression newValue = overloadedMethodInvocation(accessTranslator);
return accessTranslator.translateAsSet(newValue);
}
use of org.jetbrains.kotlin.js.backend.ast.JsExpression in project kotlin by JetBrains.
the class AccessTranslationUtils method getArrayAccessTranslator.
@NotNull
private static AccessTranslator getArrayAccessTranslator(@NotNull KtArrayAccessExpression expression, @NotNull TranslationContext context, boolean forceOrderOfEvaluation) {
TranslationContext accessArrayContext;
if (forceOrderOfEvaluation) {
Map<KtExpression, JsExpression> indexesMap = new LinkedHashMap<KtExpression, JsExpression>();
for (KtExpression indexExpression : expression.getIndexExpressions()) {
JsExpression jsIndexExpression = context.cacheExpressionIfNeeded(Translation.translateAsExpression(indexExpression, context));
indexesMap.put(indexExpression, jsIndexExpression);
}
accessArrayContext = context.innerContextWithAliasesForExpressions(indexesMap);
} else {
accessArrayContext = context;
}
return ArrayAccessTranslator.newInstance(expression, accessArrayContext);
}
Aggregations