[JS IR] Add test with exported overridden property from interface
[JS IR] Accessors should not be exported when overridden from non-exported interface
Merge-request: KT-MR-6166
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
^KT-52144 fixed
[JS IR] Add non overridden property and method insode exported class
[JS IR] Add method into exported interface in test
[JS IR] Add interface properties cases to all file export test
[JS IR] Fix usage of isExported inside IrJsUtils
Co-authored-by: Anton Bannykh <Anton.Bannykh@jetbrains.com>
Merge-request: KT-MR-6087
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
^KT-51973 fixed
Fake overrides don't have a signature and can't be assiciated with klib index,
therefore they can't be tracked with incremental cache invalidation logic.
Should be fixed after KT-51896.
If a lambda expression does not capture any local variables, convert
it to a global free function and replace the lambda creation with
a reference to that function.
Example: for the following Kotlin code
```kotlin
fun foo(f: () -> Unit) = f()
fun bar() = foo { console.log("hello") }
```
before this patch, we generated:
```js
function foo(f) {
return f();
}
function bar() {
return foo(bar$lambda());
}
function bar$lambda() {
return function () {
console.log('hello');
};
}
```
after this patch, we generate:
```js
function foo(f) {
return f();
}
function bar() {
return foo(bar$lambda);
}
function bar$lambda() {
console.log('hello');
}
```
[JS IR] Add single file test
[JS IR] isExportedMember considers only public API
[JS IR] Add case with non default accessor
Merge-request: KT-MR-6008
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
^KT-50504 fixed
[JS IR] Fix line number test
[JS IR] Ignore isInstance repl test
[JS IR] Ignore isInstance repl test
[JS IR] Add test with unsafe variance
Revert "[JS IR] Optimize away upcasts"
This reverts commit 8149189585.
Get rid of duplicated signatures
Revert "[JS IR] Consider erasing type parameters in return type in js signatures"
This reverts commit 6adcbe081e.
Revert "rra/ilgonmic/exported-bridges-2 [JS IR] Use js name for signature"
This reverts commit 00289d35
[JS IR] Leave as is
[JS IR] Add test with overloading by generic
[JS IR] Add test from master
[JS IR] Add tests from master
Merge-request: KT-MR-5987
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
^KT-51700 fixed
^KT-51523 fixed
^KT-51685 fixed
[JS IR] Test import.meta syntax
[JS IR] Add possibility to use import.meta
[JS IR] Check if import function-like returns Promise
[JS IR] Add test with import function syntax
[JS IR] Allow import function-like in js function
Merge-request: KT-MR-5948
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
^KT-51125 fixed
- Huge refactoring for IC
- Update hash combination logic
- Introduce value class for IC hashes
- Calc md5 directly by function IR
- Split IC logic by classes
- Move JsIrLinkerLoader into separate file
- CacheUpdateStatus is a sealed class
- Render TYPE_PARAMETER reified flag
^KT-51081 Fixed
^KT-51084 Fixed
[JS IR] Add tests with external funs and global vals
[JS IR] Non module cases are exceptions for naming
[JS IR] Use fqn for jsModule on declaration
[JS IR] Add test on same external names
Merge-request: KT-MR-5901
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
^KT-51438 fixed
- Cache signature readers and deserializers
- Cache inline function hashes
- IC refactoring
- [gradle] Use hash of module path for cache dir; Fix KT-51238
^KT-51238 Fixed
The issue this commit fixes occurs when we have an external interface
implemented by a Kotlin class, if that interface has methods with
varargs.
Kotlin functions expect varargs passed as arrays, but JavaScript code
may be unaware of this convention.
So, when generating a bridge for external interface method
implementaion, we insert some additional logic for extracting varargs
using the JavaScript `arguments` object.
A simplified example:
```kotlin
external interface Adder {
fun sum(vararg numbers: Int): Int
}
class AdderImpl: Adder {
override fun sum(vararg numbers: Int) = numbers.sum()
}
```
For `AdderImpl` we generate the following JS code:
```js
AdderImpl.prototype.sum_69wd7h_k$ = function (numbers) {
return sum(numbers);
};
AdderImpl.prototype.sum = function () {
var numbers = new Int32Array([].slice.call(arguments));
return this.sum_69wd7h_k$(numbers);
};
```
#KT-15223 Fixed
The temporary solution for KT-50546.
The complete solution requires the understanding,
whether a cross-module symbol redeclaration is a valid case or not.
If the case is valid, the linker symbol table logic must be reworked.