Partially fix KT-46525
Now the code like
```
fun foo(a: () -> Unit) {}
interface A {
fun run()
}
fun main() {
foo {
println()
}
val a = object : A {
override fun run() {
TODO()
}
}
}
```
is being compiled into
```
function foo(a) {
}
function A() {
}
A.$metadata$ = {
simpleName: 'A',
kind: 'interface',
interfaces: []
};
function main() {
foo(main$lambda());
var a = new _no_name_provided_();
}
function main$lambda() {
return function () {
println();
};
}
// TODO
function _no_name_provided_() {
}
_no_name_provided_.$metadata$ = {
kind: 'class',
interfaces: [A]
};
```
IrLibraryFile, ingerited from Klib code, needed types, bodies, strings,
signatures encoded as byte strings.
When we store this data as class annotations, it is better to store it
as protobuf structs, to avoid re-encoding byte streams twice.
TL;DR, before we were emitting this JS code:
Object.defineProperty(Base.prototype, 'bar', {
configurable: true,
get: Base.prototype._get_bar__0_k$,
set: Base.prototype._set_bar__a4enbm_k$
});
Now we emit this code instead:
Object.defineProperty(Base.prototype, 'bar', {
configurable: true,
get: function () {
return this._get_bar__0_k$();
},
set: function (value) {
this._set_bar__a4enbm_k$(value);
}
});
This fixes the issue where if we had a @JsExport'ed base class with a
public property overridden in a non-exported derived class, we couldn't
access that property from JS if we were given an instance of
the derived class.
#KT-41912 Fixed
Call mather relies on that BuiltIn package fragment implement specific
interface `BuiltInsPackageFragment` which was missed. Make sure that
BuiltIn module's package fragments implement that interface.
Fix progression optimizer symbols resolve in JS & WASM IR BE
- Replaced UNDEFINED_OFFSET with SYNTHETIC_OFFSET, it's required by
Native backend codegen
- Fixed missing overridden symbols
- Enforce adding fakeoverrides for members not overridden by backend
- Support more points for platform customisation
- change test runner to production mode when sources are being compiled
into klib and then klib is being translated into js, not directly from
kt to js
- fix IC cache format
- support IC tests
- Materialize unit when its value is actually needed.
- Special-case Unit_getInstance return type at codegen. It should be a
proper Unit object instead of a "void"
Companion objects are exported as ParentClass.Companion.
Companion object's members are not exposed to its parent class —
one must reference the companion object explicitly if they want to
access its members.
#KT-43783 Fixed
In case internal inline function references private top level function
after inline such function (T.L.P.) couldn't be referenced
in klib and IC cache. So create internally visible accessors for P.T.L.
function similar to what JVM backend does.
- add box test
[JS IR] Fix type check utils to work with array of arities
[JS IR] Store multiple arities for suspend functional interface implementers
^KT-46204 fixed