From 3566d918d29cf8e4baead28da3f8831599dea4c5 Mon Sep 17 00:00:00 2001 From: Svyatoslav Kuzmich Date: Sun, 15 Jan 2023 11:31:12 +0100 Subject: [PATCH] [Wasm] Deprecate @JsFun with warning kotlin.js.js("code") should be used instead --- compiler/testData/diagnostics/wasmTests/jsInterop/jsFun.kt | 2 ++ libraries/stdlib/wasm/src/kotlin/JsInterop.kt | 1 + 2 files changed, 3 insertions(+) diff --git a/compiler/testData/diagnostics/wasmTests/jsInterop/jsFun.kt b/compiler/testData/diagnostics/wasmTests/jsInterop/jsFun.kt index 7ae2cad609e..2314d7e35f6 100644 --- a/compiler/testData/diagnostics/wasmTests/jsInterop/jsFun.kt +++ b/compiler/testData/diagnostics/wasmTests/jsInterop/jsFun.kt @@ -1,3 +1,5 @@ +@file:Suppress("DEPRECATION") + @JsFun("() => {}") external fun topLevelExternalFun(): Unit diff --git a/libraries/stdlib/wasm/src/kotlin/JsInterop.kt b/libraries/stdlib/wasm/src/kotlin/JsInterop.kt index c2660e20681..4ea659c08cf 100644 --- a/libraries/stdlib/wasm/src/kotlin/JsInterop.kt +++ b/libraries/stdlib/wasm/src/kotlin/JsInterop.kt @@ -17,6 +17,7 @@ package kotlin * * This is a temporary annotation because K/Wasm <-> JS interop is not designed yet. */ +@Deprecated("@JsFun annotation is deprecated, use `fun f() = js(\"code\")` instead.") @Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER) @Retention(AnnotationRetention.BINARY) public annotation class JsFun(val code: String) \ No newline at end of file