[K/JS, K/Wasm] Generate star imports for external objects with the @JsModule annotation for ES modules
This commit is contained in:
@@ -4,13 +4,16 @@ package foo
|
||||
|
||||
@JsModule("./externalObject.mjs")
|
||||
external object A {
|
||||
val x: Int = definedExternally
|
||||
@JsName("default")
|
||||
object Default {
|
||||
val x: Int = definedExternally
|
||||
|
||||
fun foo(y: Int): Int = definedExternally
|
||||
fun foo(y: Int): Int = definedExternally
|
||||
}
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
assertEquals(23, A.x)
|
||||
assertEquals(65, A.foo(42))
|
||||
assertEquals(23, A.Default.x)
|
||||
assertEquals(65, A.Default.foo(42))
|
||||
return "OK"
|
||||
}
|
||||
+18
-20
@@ -1,21 +1,19 @@
|
||||
export default {
|
||||
createX: function () {
|
||||
return {x: "X1"};
|
||||
},
|
||||
createXY: function () {
|
||||
return {x: "X2", y: "Y2"};
|
||||
},
|
||||
createXYZ: function () {
|
||||
return {x: "X3", y: "Y3", z: "Z3"};
|
||||
},
|
||||
createClassXYZ: function () {
|
||||
return {x: "X4", y: "Y4", z: "Z4"};
|
||||
},
|
||||
createNestedInterfaceXYZ: function () {
|
||||
return {x: "X5", y: "Y5", z: "Z5"};
|
||||
},
|
||||
export function createX () {
|
||||
return {x: "X1"};
|
||||
}
|
||||
export function createXY () {
|
||||
return {x: "X2", y: "Y2"};
|
||||
}
|
||||
export function createXYZ() {
|
||||
return {x: "X3", y: "Y3", z: "Z3"};
|
||||
}
|
||||
export function createClassXYZ() {
|
||||
return {x: "X4", y: "Y4", z: "Z4"};
|
||||
}
|
||||
export function createNestedInterfaceXYZ() {
|
||||
return {x: "X5", y: "Y5", z: "Z5"};
|
||||
}
|
||||
|
||||
x: "X6",
|
||||
y: "Y6",
|
||||
z: "Z6"
|
||||
};
|
||||
export const x = "X6"
|
||||
export const y = "Y6"
|
||||
export const z = "Z6"
|
||||
|
||||
Reference in New Issue
Block a user