Support TargetPlatform.isJs() for FIR

This commit is contained in:
Jaebaek Seo
2022-10-27 22:47:23 +00:00
committed by Ilya Kirillov
parent f8a101cf3a
commit 1a5a6474d6
18 changed files with 32 additions and 27 deletions
@@ -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