Commit Graph

1534 Commits

Author SHA1 Message Date
Shagen Ogandzhanian 9bc9014c26 [KT-59294] Fix for the WRONG_JS_INTEROP_TYPE error in K1WasmJsTranslatorTestGenerated::simpleUndefined 2023-07-21 19:13:58 +00:00
Shagen Ogandzhanian eb7805baf9 [KT-59294] [wasm] Resolve undefined to null for any nullable types in external functions 2023-07-21 19:13:57 +00:00
Artem Kobzar 044c0adae7 [K/JS] Implement an incremental compilation for the per-file granularity 2023-07-19 15:57:56 +00:00
Artem Kobzar e4bdd3560c [K/JS] Change order of exported properties definition for non ES-classes compilation ^KT-60131 Fixed 2023-07-19 14:33:19 +00:00
Artem Kobzar b1884456b8 [K/JS] Fix initialization issue for objects which annotated with @JsExport and contain nested classes
Merge-request: KT-MR-11146
Merged-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>
2023-07-19 10:41:25 +00:00
Artem Kobzar 41f27d19b5 [K/JS, K/Wasm] Generate star imports for external objects with the @JsModule annotation for ES modules 2023-07-18 15:36:19 +00:00
Alexander Korepanov a588e75c11 [JS IR] Optimize JS AST for closures
^KT-58891 Fixed
2023-07-13 16:37:18 +00:00
Alexander Korepanov 524c475834 [JS IR] Implement MoveTemporaryVariableDeclarationToAssignment optimization 2023-07-13 16:37:18 +00:00
Alexander Korepanov 25f7b81d51 [JS IR] Drop TemporaryAssignmentElimination optimization
Enable TemporaryAssignment tests
2023-07-13 16:37:17 +00:00
Brian Norman 10ed26991d [FIR] Extract LHS receiver of assignment operator statements
#KT-53490 Fixed
2023-07-12 11:41:33 +00:00
Artem Kobzar fdda394a77 [K/JS] Calculate generated function names based on signatures of argument types (instead of fqNames) ^KT-49077 Fixed 2023-07-11 13:14:45 +00:00
Artem Kobzar cf949e8760 [K/JS] Support KClass<*>.createInstance reflection method ^KT-58684 Fixed 2023-07-06 18:18:14 +00:00
Alexander Korepanov 2cb28b6be1 [JS IR] Add an explicit toString() call for concatenating Char values
^KT-59718 Fixed
2023-07-06 14:40:06 +00:00
Ilya Goncharov b5a7b9c661 [JS] Migrate multi module order test 2023-07-06 08:08:55 +00:00
Alexander Korepanov 4695dca056 [JS IR] Keep box and unbox intrinsics in call args after decomposing
^KT-59717 Fixed
2023-07-05 07:33:03 +00:00
Artem Kobzar 9ad5910de9 [K/JS] Remove isObject check from runtime ^KT-57926 Fixed 2023-07-03 13:19:43 +00:00
Artem Kobzar 966a342bf1 [K/JS] Migrate invalidation tests to ES modules 2023-06-30 16:13:35 +00:00
Dmitriy Dolovov f2f935846c [JS] Fix IC tests to reflect changes in signature rendering
^KT-59486
2023-06-26 15:59:31 +00:00
Svyatoslav Kuzmich 4ad6fd4cde [Wasm] Add RUN_UNIT_TESTS directive to unit-test compiler tests 2023-06-25 10:20:43 +02:00
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00
Artem Kobzar 64158a8a2f [K/JS] Add file-to-file compilation ^KT-6168 Fixed 2023-06-22 18:23:45 +00:00
Ilya Goncharov 1c89a7e400 [JS] Remove legacy and output prefix-postfix tests 2023-06-22 12:25:24 +00:00
Artem Kobzar 039b5fca7a [K/JS] Use declared upper-bound types for parameters inside inlined functions body, instead of the provided types 2023-06-20 12:01:28 +00:00
Artem Kobzar 66bdb9ce79 [K/JS] Fix private constructor delegating inside single class with ES6 mode ^KT-59335 Fixed 2023-06-20 11:07:08 +00:00
Alexander Korepanov fc898c7620 [JS IR] Use type upper bounds for calculating function signatures
^KT-59239 Fixed
2023-06-14 14:57:15 +00:00
Artem Kobzar d2b64cd481 [K/JS] Generate .js files from .ts if they were not created, because of the incremental flag in tsconfig
The incremental option will prevent creating file if there is an incremental cache from TS compiler even if the file doesn't exist.
The situation could happen if `./gradlew clean` was executed (js file will be removed and ts incremental cache - not)

Merge-request: KT-MR-10229
Merged-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>
2023-06-14 09:26:18 +00:00
Alexander Korepanov 82a1242f22 [JS IR] Add tests for JS IR IC + PL
^KT-57347 related
2023-06-06 09:27:57 +00:00
Alexander Korepanov 97620030c6 [JS IR] Rollback PL hacks from JS IR IC infra
^KT-57347 related
2023-06-06 09:27:57 +00:00
Artem Kobzar bfd57fd2df [K/JS, K/Wasm] Optimize simple objects declaration and usage ^Fixed KT-58797 2023-06-02 14:23:40 +00:00
Alexander Korepanov 8066f1b7d2 [JS IR] Do not copy interface method if base class inherits it
^KT-58599 Fixed
2023-05-30 08:22:43 +00:00
Nikita Bobko ac40010501 [FE] Prohibit open val deferred initialization
^KT-57553 Fixed
Review: https://jetbrains.team/p/kt/reviews/9967

Other related tests:
- testUninitializedOrReassignedVariables
- testUseOfPropertiesWithoutPrimary
- @TestMetadata("compiler/testData/diagnostics/tests/secondaryConstructors")
- testAugmentedAssignmentInInitializer
- testInitOpenSetter
- testInitOverrideInConstructorComplex
- testPropertyInitializationOrder
2023-05-23 14:12:28 +03:00
Alexander Korepanov 2aea5822b2 [JS IR] Unmute all fir invalidation tests 2023-05-01 12:56:12 +00:00
Alexander Korepanov 9da9c95105 [JS IR] Add IC test for interface with default implementation 2023-05-01 12:49:07 +00:00
Ilya Gorbunov f470406150 Update EXPECTED_REACHABLE_NODES in JS testdata 2023-04-26 15:50:58 +00:00
Abduqodiri Qurbonzoda 63a5a74613 Introduce HexFormat for formatting and parsing hexadecimals #KT-57762
Merge-request: KT-MR-9460
Merged-by: Abduqodiri Qurbonzoda <abduqodiri.qurbonzoda@jetbrains.com>
2023-04-26 09:54:25 +00:00
Artem Kobzar 27b103e2ca [K/JS] Eliminate duplication of init block inside exported ES-classes ^KT-58246 Fixed 2023-04-25 16:21:08 +00:00
Alexander Korepanov 81b591ed21 [JS IR IC] Interface default implementations affect IC hash
Adding or removing a method or property with
a default implementation to an interface should
invalidate all children: we must regenerate JS code for them

^KT-56237 Fixed
2023-04-25 15:34:22 +00:00
Nikolay Lunyak 360d236b7e [FIR JS] KT-57601: Get rid of the builtin provider
In this example we get 2 variants of `kotlin/toString()`:
one coming from the KLib provider, and the
other coming from the builtins provider.
These are identical deserialized functions.

^KT-57601 Fixed
2023-04-25 11:29:34 +00:00
Artem Kobzar 9bcfd093c5 [K/JS] Remove super keyword insertion if the body of method was moved into another place (private methods, lambdas, coroutines) ^KT-57990 Fixed 2023-04-24 13:54:36 +00:00
Ilya Chernikov 8cc9f911d5 FIR: temp: make klib symbol provider know parent packages
Current qualified access resolving algo rely (likely incorrectly,
see #KT-58037) on a providers' "knowledge" about parent packages.
This commit adds this "knowledge" to k-lib based provider.
#KT-57353 fixed
2023-04-19 11:42:03 +00:00
Alexander Korepanov 79d378f2bd [JS IR] Perform optimizations on the generated JS code
The patch adopts and reuses the optimizations from the legacy backend.

The optimizations remove useless temporary variables,
statements and simplify generated JS code.

The optimizations can be disabled by `-Xoptimize-generated-js=false`.

Related to KT-51139
2023-04-18 12:49:33 +00:00
Alexander Korepanov 980d83eccd [JS IR IC] Drop incremental cache after updating a klib set
Enabled Partial Linkage may replace entire IR expressions with a stub
during klib linking and loading. This may break the incremental cache
dependency graph. Dropping incremental cache files after updating klibs
(e.g. update klib version) covers almost all cases which
could not be tracked due to a broken dependency graph.

This patch could be reverted after fixing KT-57347
2023-04-18 09:06:07 +00:00
Artem Kobzar 20dea37be0 [K/JS TEST] Run TestGenerated check on generated TS tests 2023-04-14 14:45:11 +00:00
Artem Kobzar 73f8c984a1 [K/JS TEST] Fix the problem with running JS tests on Windows if the test has a long name 2023-04-14 10:46:52 +00:00
Artem Kobzar 5dc6da2b33 [K/JS] Add serialization/deserialization for JsImport/JsExport nodes 2023-04-13 12:58:46 +00:00
Artem Kobzar c695da1bed [K/JS] Allow declare inline functions inside external declarations with a million suppresses ^KT-48154 Fixed 2023-04-13 08:53:57 +00:00
Artem Kobzar 09bccd272d [K/JS] Prevent Char boxing on value or reference equals call 2023-04-13 08:39:03 +00:00
Artem Kobzar fa0f9a9201 [K/JS] Change strategy for implicitly exported declarations if there is a cycled reference
^KT-57356 Fixed
2023-04-11 13:48:47 +00:00
Kirill Rakhman 210e8750f4 [FIR] Deserialize nested typealias
#KT-57689 Fixed
2023-04-06 08:03:12 +00:00
Kirill Rakhman f9540d8f69 [JS] Remove non-functional IGNORE_FIR directive in js box tests 2023-04-06 08:03:12 +00:00