Hi all,
I’m trying to export 3 very simple classes.
@JsExport
open class MyFirstClass {
open fun myFirstClassFunction() {
println("################ MyFirstClass")
}
}
@JsExport
open class MySecondClass {
open fun mySecondClassFunction(){
println("################ MySecondClass")
}
}
@JsExport
open class MyThirdClass {
open fun myThirdClassFunction() {
println("################ MyThirdClass")
}
}
Basically, these classes are the same.
After compile, a get d.ts. file and .js
d.ts. file looks like:
export class MyFirstClass {
constructor();
myFirstClassFunction(): void;
}
export class MySecondClass {
constructor();
mySecondClassFunction(): void;
}
export class MyThirdClass {
constructor();
myThirdClassFunction(): void;
}
but, the .js file added some numbers beside the methods name
MyFirstClass.prototype.myFirstClassFunction_0 = function () {
println('################ MyFirstClass');
};
MyFirstClass.$metadata$ = {
simpleName: 'MyFirstClass',
kind: 'class',
interfaces: []
};
function MySecondClass() {
}
MySecondClass.prototype.mySecondClassFunction = function () {
println('################ MySecondClass');
};
MySecondClass.$metadata$ = {
simpleName: 'MySecondClass',
kind: 'class',
interfaces: []
};
function MyThirdClass() {
}
MyThirdClass.prototype.myThirdClassFunction_3 = function () {
println('################ MyThirdClass');
};
MyThirdClass.$metadata$ = {
simpleName: 'MyThirdClass',
kind: 'class',
interfaces: []
};
After inheritance like in example
class MyFirstClassTS extends MyFirstClass {
constructor() {
super();
}
myFirstClassFunction() {
console.info("############ MyFirstClassTS")
}
}
class MySecondClassTS extends MySecondClass {
constructor() {
super();
}
mySecondClassFunction() {
console.info("############ MySecondClassTS")
}
}
class MyThirdClassTS extends MyThirdClass {
constructor() {
super();
}
myThirdClassFunction() {
console.info("############ MyThirdClassTS")
}
}
in console I got very different result as in picture below.
Is there any other configuration of the compiler or something else to fix this issues ?
Thanks