FIR JS: enable full JS box tests with FIR
This commit is contained in:
+4
-5
@@ -6,20 +6,19 @@
|
||||
package org.jetbrains.kotlin.test.services
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl
|
||||
import org.jetbrains.kotlin.library.KotlinLibrary
|
||||
|
||||
class JsLibraryProvider(private val testServices: TestServices) : TestService {
|
||||
private val descriptorToLibrary = mutableMapOf<ModuleDescriptor, KotlinLibrary>()
|
||||
private val stdlibPathToDescriptor = mutableMapOf<String, ModuleDescriptorImpl>()
|
||||
private val stdlibPathToDescriptor = mutableMapOf<String, ModuleDescriptor>()
|
||||
|
||||
fun getDescriptorByPath(path: String): ModuleDescriptorImpl {
|
||||
fun getDescriptorByPath(path: String): ModuleDescriptor {
|
||||
return stdlibPathToDescriptor[path] ?: testServices.assertions.fail {
|
||||
"There is no library with path $path"
|
||||
}
|
||||
}
|
||||
|
||||
fun setDescriptorAndLibraryByName(name: String, descriptor: ModuleDescriptorImpl, library: KotlinLibrary) {
|
||||
fun setDescriptorAndLibraryByName(name: String, descriptor: ModuleDescriptor, library: KotlinLibrary) {
|
||||
stdlibPathToDescriptor[name] = descriptor
|
||||
descriptorToLibrary[descriptor] = library
|
||||
}
|
||||
@@ -40,7 +39,7 @@ class JsLibraryProvider(private val testServices: TestServices) : TestService {
|
||||
}
|
||||
}
|
||||
|
||||
fun getOrCreateStdlibByPath(path: String, create: (String) -> Pair<ModuleDescriptorImpl, KotlinLibrary>): ModuleDescriptorImpl {
|
||||
fun getOrCreateStdlibByPath(path: String, create: (String) -> Pair<ModuleDescriptor, KotlinLibrary>): ModuleDescriptor {
|
||||
return stdlibPathToDescriptor.getOrPut(path) {
|
||||
create(path).let {
|
||||
descriptorToLibrary += it
|
||||
|
||||
Reference in New Issue
Block a user