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