[Wasm] Add JsAny.unsafeCast
Replacement for Dynamic.unsafeCast, but limited to JsAny types where it makes sense.
This commit is contained in:
committed by
Space Team
parent
e32611d2f2
commit
cafc27aae9
@@ -5,7 +5,19 @@
|
|||||||
|
|
||||||
package kotlin.js
|
package kotlin.js
|
||||||
|
|
||||||
|
import kotlin.wasm.internal.ExcludedFromCodegen
|
||||||
|
import kotlin.wasm.internal.WasmNoOpCast
|
||||||
|
import kotlin.wasm.internal.implementedAsIntrinsic
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Any JavaScript value except null or undefined
|
* Any JavaScript value except null or undefined
|
||||||
*/
|
*/
|
||||||
public external interface JsAny
|
public external interface JsAny
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Cast JsAny to other Js type without runtime check
|
||||||
|
*/
|
||||||
|
@WasmNoOpCast
|
||||||
|
@ExcludedFromCodegen
|
||||||
|
public fun <T : JsAny> JsAny.unsafeCast(): T =
|
||||||
|
implementedAsIntrinsic
|
||||||
Reference in New Issue
Block a user