[Wasm] Revert removal of some Dynamic functions

Deprecate them with ERROR instead to improve compiler messages
This commit is contained in:
Svyatoslav Kuzmich
2023-04-19 15:27:35 +02:00
committed by teamcity
parent eb4e96a113
commit 7c2fa3290e
@@ -13,6 +13,19 @@ package kotlin.js
@Deprecated("Use JsAny instead", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("JsAny"))
public external interface Dynamic : JsAny
/**
* Reinterprets this value as a value of the Dynamic type.
*/
@Deprecated("If value is a subtype of JsAny, use JsAny instead. Otherwise, use toJsHandle", level = DeprecationLevel.ERROR)
fun Any.asDynamic(): JsAny = this.toJsHandle()
/**
* Reinterprets this value as a value of the Dynamic type.
*/
@Deprecated("Use toJsString instead", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("this.toJsString()"))
@kotlin.internal.InlineOnly
fun String.asDynamic(): JsString = this.toJsString()
private fun jsThrow(e: JsAny) {
js("throw e;")
}