Code cleanup: removed redundant semicolons

This commit is contained in:
Valentin Kipyatkov
2016-04-26 23:30:42 +03:00
parent e1d8c72aa7
commit b551886889
141 changed files with 2520 additions and 239 deletions
@@ -212,7 +212,7 @@ internal class TemporaryAssignmentElimination(private val root: JsBlock) {
hasChanges = true
ctx.replaceMe(replacement)
statementsToRemove += usage.statements
return false;
return false
}
}
return super.visit(x, ctx)
@@ -22,7 +22,7 @@ import java.util.Stack
class ScopeContext(scope: JsScope) {
private val rootScope = generateSequence(scope) { it.parent }.first { it is JsRootScope }
private val scopes = Stack<JsScope>();
private val scopes = Stack<JsScope>()
init {
scopes.push(scope)
@@ -155,5 +155,5 @@ private fun TranslationContext.createCallInfo(resolvedCall: ResolvedCall<out Cal
return notNullConditionalForSafeCall
}
}
};
}
}
@@ -47,7 +47,7 @@ object CallTranslator {
resolvedCall: ResolvedCall<out VariableDescriptor>,
extensionOrDispatchReceiver: JsExpression? = null
): JsExpression {
val variableAccessInfo = VariableAccessInfo(context.getCallInfo(resolvedCall, extensionOrDispatchReceiver), null);
val variableAccessInfo = VariableAccessInfo(context.getCallInfo(resolvedCall, extensionOrDispatchReceiver), null)
return variableAccessInfo.translateVariableAccess()
}
@@ -56,7 +56,7 @@ object CallTranslator {
value: JsExpression,
extensionOrDispatchReceiver: JsExpression? = null
): JsExpression {
val variableAccessInfo = VariableAccessInfo(context.getCallInfo(resolvedCall, extensionOrDispatchReceiver), value);
val variableAccessInfo = VariableAccessInfo(context.getCallInfo(resolvedCall, extensionOrDispatchReceiver), value)
return variableAccessInfo.translateVariableAccess()
}
@@ -65,7 +65,7 @@ object CallTranslator {
args: List<JsExpression>,
dispatchReceiver: JsExpression?
): JsExpression {
val argumentsInfo = CallArgumentTranslator.ArgumentsInfo(args, false, null);
val argumentsInfo = CallArgumentTranslator.ArgumentsInfo(args, false, null)
val functionName = context.getNameForDescriptor(functionDescriptor)
val isNative = AnnotationsUtils.isNativeObject(functionDescriptor)
val hasSpreadOperator = false
@@ -207,7 +207,7 @@ interface DelegateIntrinsic<I : CallInfo> {
}
private fun I.getIntrinsic(): JsExpression? {
val descriptor = getDescriptor();
val descriptor = getDescriptor()
// Now intrinsic support only FunctionDescriptor. See DelegatePropertyAccessIntrinsic.getDescriptor()
if (descriptor is FunctionDescriptor) {
@@ -140,7 +140,7 @@ class UsageTracker(
if (containingDescriptor == container) return false
if (containingDescriptor !is ClassDescriptor) {
val containingClass = getParentOfType(containingDescriptor, ClassDescriptor::class.java, false);
val containingClass = getParentOfType(containingDescriptor, ClassDescriptor::class.java, false)
if (containingClass == container) return false
}
@@ -168,7 +168,7 @@ class ClassTranslator private constructor(
.innerWithUsageTracker(constructorScope, constructorDescriptor)
.innerContextWithAliased(receiverDescriptor, thisNameRef)
val outerClassName = context.getOuterClassReference(classDescriptor);
val outerClassName = context.getOuterClassReference(classDescriptor)
val outerClass = DescriptorUtils.getContainingClass(classDescriptor)
if (outerClassName != null) {
val outerClassReceiver = outerClass!!.thisAsReceiverParameter
@@ -295,7 +295,7 @@ class ClassTranslator private constructor(
}
}
function.body.statements.addAll(0, additionalStatements);
function.body.statements.addAll(0, additionalStatements)
}
private fun getSuperclassReferences(declarationContext: TranslationContext): JsExpression {
@@ -42,10 +42,10 @@ class DelegationTranslator(
) : AbstractTranslator(context) {
private val classDescriptor: ClassDescriptor =
BindingUtils.getClassDescriptor(context.bindingContext(), classDeclaration);
BindingUtils.getClassDescriptor(context.bindingContext(), classDeclaration)
private val delegationBySpecifiers =
classDeclaration.getSuperTypeListEntries().filterIsInstance<KtDelegatedSuperTypeEntry>();
classDeclaration.getSuperTypeListEntries().filterIsInstance<KtDelegatedSuperTypeEntry>()
private class Field (val name: String, val generateField: Boolean)
private val fields = mutableMapOf<KtDelegatedSuperTypeEntry, Field>()
@@ -186,6 +186,6 @@ class DelegationTranslator(
) {
val delegateRefName = context().getScopeForDescriptor(descriptor).declareName(delegateName)
val delegateRef = JsNameRef(delegateRefName, JsLiteral.THIS)
properties.add(generateDelegateCall(descriptor, overriddenDescriptor, delegateRef, context()));
properties.add(generateDelegateCall(descriptor, overriddenDescriptor, delegateRef, context()))
}
}
@@ -115,7 +115,7 @@ fun translateForExpression(expression: KtForExpression, context: TranslationCont
getClassDescriptorForType(rangeType).name.asString() == "IntArray"
}
val destructuringParameter: KtDestructuringDeclaration? = expression.destructuringParameter;
val destructuringParameter: KtDestructuringDeclaration? = expression.destructuringParameter
fun declareParameter(): JsName {
val loopParameter = getLoopParameter(expression)
@@ -66,7 +66,7 @@ object LongOperationFIF : FunctionIntrinsicFactory {
"times" to BaseBinaryIntrinsic(::mul),
"div" to BaseBinaryIntrinsic(::div),
"mod" to BaseBinaryIntrinsic(::mod)
);
)
class BaseBinaryIntrinsic(val applyFun: (left: JsExpression, right: JsExpression) -> JsExpression) : FunctionIntrinsic() {
override fun apply(receiver: JsExpression?, arguments: List<JsExpression>, context: TranslationContext): JsExpression {
@@ -29,7 +29,7 @@ object NumberAndCharConversionFIF : CompositeFIF() {
pattern("Int.toInt|toFloat|toDouble"), pattern("Short.toShort|toInt|toFloat|toDouble"),
pattern("Byte.toByte|toShort|toInt|toFloat|toDouble"), pattern("Float|Double.toFloat|toDouble"),
pattern("Long.toLong"), pattern("Char.toChar")
);
)
private val convertOperations: Map<String, ConversionUnaryIntrinsic> =
mapOf(
@@ -176,7 +176,7 @@ class CallArgumentTranslator private constructor(
return typeArgs.addReifiedTypeArgsTo(result, context)
}
return result;
return result
}
private fun translateSingleArgument(actualArgument: ResolvedValueArgument, result: MutableList<JsExpression>, context: TranslationContext): ArgumentsKind {
@@ -36,7 +36,7 @@ fun generateDelegateCall(
val parameters = SmartList<JsParameter>()
val args = SmartList<JsExpression>()
val functionScope = context.getScopeForDescriptor(fromDescriptor);
val functionScope = context.getScopeForDescriptor(fromDescriptor)
if (DescriptorUtils.isExtension(fromDescriptor)) {
val extensionFunctionReceiverName = functionScope.declareName(Namer.getReceiverParameterName())