Add stdlib API test + remove some extra IR stdlib API's
This commit is contained in:
@@ -46,10 +46,7 @@ val jsMainSources by task<Sync> {
|
||||
val sources = listOf(
|
||||
"core/builtins/src/kotlin/",
|
||||
"libraries/stdlib/js/src/",
|
||||
"libraries/stdlib/js/runtime/",
|
||||
|
||||
// TODO get rid - move to test module
|
||||
"js/js.translator/testData/_commonFiles/"
|
||||
"libraries/stdlib/js/runtime/"
|
||||
) + unimplementedNativeBuiltIns
|
||||
|
||||
val excluded = listOf(
|
||||
|
||||
@@ -12,7 +12,7 @@ package kotlin
|
||||
// TODO: KT-35100
|
||||
//@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
|
||||
//public inline class Char internal constructor (val value: Int) : Comparable<Char> {
|
||||
public class Char internal constructor(val value: Int) : Comparable<Char> {
|
||||
public class Char internal constructor(private val value: Int) : Comparable<Char> {
|
||||
|
||||
/**
|
||||
* Compares this value with the specified value for order.
|
||||
|
||||
@@ -8,6 +8,6 @@ package kotlin.js
|
||||
/**
|
||||
* @param CT is return type of calling constructor (uses in DCE)
|
||||
*/
|
||||
fun <CT> construct(constructorType: dynamic, resultType: dynamic, vararg args: Any?): Any {
|
||||
internal fun <CT> construct(constructorType: dynamic, resultType: dynamic, vararg args: Any?): Any {
|
||||
return js("Reflect").construct(constructorType, args, resultType)
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
|
||||
package kotlin.js
|
||||
|
||||
import kotlin.js.coroutineAliases.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
|
||||
@PublishedApi
|
||||
internal fun <T> getContinuation(): ContinuationAlias<T> { throw Exception("Implemented as intrinsic") }
|
||||
internal fun <T> getContinuation(): Continuation<T> { throw Exception("Implemented as intrinsic") }
|
||||
// Do we really need this intrinsic in JS?
|
||||
|
||||
@PublishedApi
|
||||
@@ -20,18 +20,18 @@ internal suspend fun <T> returnIfSuspended(@Suppress("UNUSED_PARAMETER") argumen
|
||||
|
||||
@PublishedApi
|
||||
internal fun <T> interceptContinuationIfNeeded(
|
||||
context: CoroutineContextAlias,
|
||||
continuation: ContinuationAlias<T>
|
||||
) = context[ContinuationInterceptorAlias]?.interceptContinuation(continuation) ?: continuation
|
||||
context: CoroutineContext,
|
||||
continuation: Continuation<T>
|
||||
) = context[ContinuationInterceptor]?.interceptContinuation(continuation) ?: continuation
|
||||
|
||||
|
||||
@SinceKotlin("1.2")
|
||||
@PublishedApi
|
||||
internal suspend fun getCoroutineContext(): CoroutineContextAlias = getContinuation<Any?>().context
|
||||
internal suspend fun getCoroutineContext(): CoroutineContext = getContinuation<Any?>().context
|
||||
|
||||
// TODO: remove `JS` suffix oncec `NameGenerator` is implemented
|
||||
@PublishedApi
|
||||
internal suspend fun <T> suspendCoroutineUninterceptedOrReturnJS(block: (ContinuationAlias<T>) -> Any?): T =
|
||||
internal suspend fun <T> suspendCoroutineUninterceptedOrReturnJS(block: (Continuation<T>) -> Any?): T =
|
||||
returnIfSuspended<T>(block(getContinuation<T>()))
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
|
||||
package kotlin.js.coroutineAliases
|
||||
|
||||
import kotlin.coroutines.*
|
||||
|
||||
|
||||
typealias ContinuationAlias<T> = Continuation<T>
|
||||
typealias CoroutineContextAlias = CoroutineContext
|
||||
typealias ContinuationInterceptorAlias = ContinuationInterceptor
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user