[Wasm] Add @JsExport diagnostics test
@JsExport is only allowed on top-level functions in K/Wasm Restrictions for nested function are handled by reusing K/JS diagnostics Restrictions for classes and properties are handled by specifying annotation target in stdlib
This commit is contained in:
committed by
Space Team
parent
b4fcfd6719
commit
f79607d32d
@@ -0,0 +1,25 @@
|
|||||||
|
// !OPT_IN: kotlin.js.ExperimentalJsExport
|
||||||
|
|
||||||
|
@JsExport
|
||||||
|
fun foo1() {
|
||||||
|
}
|
||||||
|
|
||||||
|
class C {
|
||||||
|
<!NESTED_JS_EXPORT!>@JsExport<!>
|
||||||
|
fun memberFunction() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun foo2() {
|
||||||
|
<!NESTED_JS_EXPORT!>@JsExport<!>
|
||||||
|
fun localFun() {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
val p1 = (<!NESTED_JS_EXPORT!>@JsExport<!> fun () {})
|
||||||
|
|
||||||
|
<!WRONG_ANNOTATION_TARGET!>@JsExport<!>
|
||||||
|
class C2
|
||||||
|
|
||||||
|
<!WRONG_ANNOTATION_TARGET!>@JsExport<!>
|
||||||
|
var p2: Int = 1
|
||||||
+6
@@ -50,5 +50,11 @@ public class DiagnosticsWasmTestGenerated extends AbstractDiagnosticsWasmTest {
|
|||||||
public void testInheritance() throws Exception {
|
public void testInheritance() throws Exception {
|
||||||
runTest("compiler/testData/diagnostics/wasmTests/jsInterop/inheritance.kt");
|
runTest("compiler/testData/diagnostics/wasmTests/jsInterop/inheritance.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("jsExport.kt")
|
||||||
|
public void testJsExport() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/wasmTests/jsInterop/jsExport.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user