Support TargetPlatform.isJs() for FIR
This commit is contained in:
committed by
Ilya Kirillov
parent
f8a101cf3a
commit
1a5a6474d6
@@ -5,14 +5,9 @@
|
||||
|
||||
package org.jetbrains.kotlin.platform.js
|
||||
|
||||
import org.jetbrains.kotlin.platform.SimplePlatform
|
||||
import org.jetbrains.kotlin.platform.JsPlatform
|
||||
import org.jetbrains.kotlin.platform.TargetPlatform
|
||||
|
||||
abstract class JsPlatform : SimplePlatform("JS") {
|
||||
override val oldFashionedDescription: String
|
||||
get() = "JavaScript "
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION_ERROR")
|
||||
object JsPlatforms {
|
||||
object DefaultSimpleJsPlatform : JsPlatform()
|
||||
@@ -33,7 +28,3 @@ object JsPlatforms {
|
||||
|
||||
val allJsPlatforms: List<TargetPlatform> = listOf(defaultJsPlatform)
|
||||
}
|
||||
|
||||
// TODO: temporarily conservative implementation; use the same approach as for TargetPlatform?.isNative()
|
||||
// when JsPlatform will become parameterized with "JS target"
|
||||
fun TargetPlatform?.isJs(): Boolean = this?.singleOrNull() is JsPlatform
|
||||
|
||||
Reference in New Issue
Block a user