Fix contains usages in compiler.
This commit is contained in:
+6
-6
@@ -28,15 +28,15 @@ import java.lang.reflect.Field
|
||||
import java.lang.reflect.Method
|
||||
|
||||
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN")
|
||||
private val TYPES_ELIGIBLE_FOR_SIMPLE_VISIT = setOf(
|
||||
private val TYPES_ELIGIBLE_FOR_SIMPLE_VISIT = setOf<Class<*>>(
|
||||
// Primitives
|
||||
javaClass<java.lang.Integer>(), javaClass<java.lang.Character>(), javaClass<java.lang.Byte>(), javaClass<java.lang.Long>(),
|
||||
javaClass<java.lang.Short>(), javaClass<java.lang.Boolean>(), javaClass<java.lang.Double>(), javaClass<java.lang.Float>(),
|
||||
java.lang.Integer::class.java, java.lang.Character::class.java, java.lang.Byte::class.java, java.lang.Long::class.java,
|
||||
java.lang.Short::class.java, java.lang.Boolean::class.java, java.lang.Double::class.java, java.lang.Float::class.java,
|
||||
// Arrays of primitives
|
||||
javaClass<IntArray>(), javaClass<CharArray>(), javaClass<ByteArray>(), javaClass<LongArray>(),
|
||||
javaClass<ShortArray>(), javaClass<BooleanArray>(), javaClass<DoubleArray>(), javaClass<FloatArray>(),
|
||||
IntArray::class.java, CharArray::class.java, ByteArray::class.java, LongArray::class.java,
|
||||
ShortArray::class.java, BooleanArray::class.java, DoubleArray::class.java, FloatArray::class.java,
|
||||
// Others
|
||||
javaClass<Class<*>>(), javaClass<String>()
|
||||
Class::class.java, String::class.java
|
||||
)
|
||||
|
||||
public class ReflectKotlinClass private constructor(
|
||||
|
||||
@@ -162,10 +162,10 @@ private fun JsFunction.markInlineArguments(descriptor: CallableDescriptor) {
|
||||
namesSet = inlineFuns
|
||||
}
|
||||
|
||||
val name = (qualifier as? JsNameRef)?.getName()
|
||||
|
||||
if (name in namesSet) {
|
||||
x.inlineStrategy = InlineStrategy.IN_PLACE
|
||||
(qualifier as? JsNameRef)?.name?.let { name ->
|
||||
if (name in namesSet) {
|
||||
x.inlineStrategy = InlineStrategy.IN_PLACE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,9 +43,9 @@ public fun removeDefaultInitializers(arguments: List<JsExpression>, parameters:
|
||||
}
|
||||
|
||||
when {
|
||||
name in toRemove ->
|
||||
name != null && name in toRemove ->
|
||||
listOf<JsStatement>()
|
||||
name in toExpand ->
|
||||
name != null && name in toExpand ->
|
||||
flattenStatement((it as JsIf).getThenStatement()!!)
|
||||
else ->
|
||||
listOf(it)
|
||||
|
||||
+2
-2
@@ -39,7 +39,7 @@ public fun removeUnusedFunctionDefinitions(root: JsNode, functions: Map<JsName,
|
||||
|
||||
NodeRemover(javaClass<JsPropertyInitializer>()) {
|
||||
val function = it.getValueExpr() as? JsFunction
|
||||
function in removable
|
||||
function != null && function in removable
|
||||
}.accept(root)
|
||||
}
|
||||
|
||||
@@ -106,6 +106,6 @@ private class UnusedLocalFunctionsCollector(functions: Map<JsName, JsFunction>)
|
||||
return nameRef?.getName()?.staticRef is JsFunction
|
||||
}
|
||||
|
||||
private fun wasProcessed(function: JsFunction?): Boolean = function in processed
|
||||
private fun wasProcessed(function: JsFunction?): Boolean = function != null && function in processed
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user