Commit Graph

688 Commits

Author SHA1 Message Date
Artem Kobzar 53aa8eddfe [K/JS] Generate unstable names on Frontend-checks for declarations with the JsExport.Ignore annotation ^KT-60202 Fixed 2023-07-24 09:52:58 +00:00
Igor Yakovlev 750653e4b3 [Wasm] Add kotlin wasm wasi mode compiler flag 2023-07-07 15:23:18 +00:00
Svyatoslav Kuzmich 1dc0b054ed Deprecate PlatformDiagnosticSuppressors::shouldReportUnusedParameter with one parameter 2023-06-13 15:37:54 +00:00
Svyatoslav Kuzmich dc4aa8c15e [Wasm] Restore binary compatibility of PlatformDiagnosticSuppressor
Keep the original shouldReportUnusedParameter method without
 BindingContext parameter

^KT-58188 Fixed
2023-06-13 15:37:53 +00:00
Ilya Goncharov bcefa1cd66 [Gradle, Wasm] Add wasm platform kind
KTIJ-25583
2023-05-17 13:28:20 +00:00
Zalim Bashorov 62b21ac078 [Wasm] Add an option to dump reachability info to file 2023-04-25 19:44:02 +02: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 e8be3043cc [JS IR] Allow restriction of function argument by external type
Add a special annotation @JsExternalTypeArgument for
 marking function parameters. The marked parameter
 accepts an argument with an external type only.

^KT-57479 Fixed
2023-04-17 08:21:10 +00:00
Alexander Korepanov 4813b659ab [JS IR] Control an inheritance of non-external entity from external
Add a special annotation @JsExternalInheritorsOnly for marking
 external interfaces and classes. The marked interface or class
 can’t be a parent for non external interfaces, classes or objects.

^KT-57423 Fixed
2023-04-05 09:00:45 +00:00
Dmitriy Dolovov a450866db3 [PL] Commonize Native & JS compiler configuration keys 2023-03-30 12:38:07 +00:00
Dmitriy Dolovov 831611d577 [PL] Introduce new CLI parameter: -Xpartial-linkage-loglevel
The parameter controls the level of logs produced during the compile time by the partial linkage: 'info', 'warn' (default for now), and 'error'.
2023-03-30 12:38:06 +00:00
Artem Kobzar 633d840c88 [K/JS] Deprecate external enum declarations
^KT-57254 Fixed
2023-03-10 12:55:43 +00:00
Alexander Korepanov 2cad26f4cc [JS IR] Use cacheable ZIP file system accessor in JS IR BE
Related to KT-51712
2023-03-10 09:38:52 +00:00
Svyatoslav Kuzmich 60ef7fcb49 [Wasm] Suppress unused parameters warning for functions with JS body
These parameters can be used in js(code)
2023-03-03 19:39:09 +00:00
Svyatoslav Kuzmich 54a45c49f8 [Wasm] Add Wasm platform and K1 FE infrastructure 2023-02-24 01:05:23 +01:00
Vladimir Dolzhenko 3e99807436 Add ability to provide specific AbsentDescriptorHandler
#EA-457188

Merge-request: KT-MR-8900
Merged-by: Vladimir Dolzhenko <Vladimir.Dolzhenko@jetbrains.com>
2023-02-22 12:44:46 +00:00
Ilya Goncharov 1150ec6882 [JS] Implementation dependencies for JS klibs
^KT-56158 fixed
2023-01-27 13:31:59 +00:00
Mikhail Glukhikh 89dd28226b BinaryVersion: introduce isCompatibleWithCurrentCompilerVersion 2023-01-16 18:12:55 +01:00
Nikolay Lunyak e6efde76dc [FIR JS] Reuse declarations from JsStandardClassIds in both frontends 2023-01-09 08:57:13 +00:00
Nikolay Lunyak 85bcef537c [FIR JS] Support NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE 2023-01-09 08:57:12 +00:00
Nikolay Lunyak a20e29e8b7 [FIR JS] Implement FirJsExternalChecker
The JsAllowValueClassesInExternals feature is enabled explicitly,
because otherwise it's enabled
implicitly depending on the backend. See:
org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt:90

A property may have a fake source return kind, while its accessor
has a real source kind. In this case we can't "just copy"
the property return type down to the accessor.
2023-01-09 08:57:11 +00:00
Nikolay Lunyak 56285bb2d6 [FIR JS] Report CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION 2023-01-09 08:57:11 +00:00
Nikolay Lunyak f422a3a4e8 [FIR JS] Report WRONG_JS_QUALIFIER for the argument of JsQualifier 2023-01-09 08:57:08 +00:00
Artem Kobzar 7d881842b4 [K/JS] Include protected member declarations into checked by JsExportDeclarationChecker declarations ^Fixed KT-55786 2023-01-05 16:30:23 +00:00
Vladimir Dolzhenko 4542b3947b Clean up: rename Jet* to Kt* 2023-01-03 16:36:53 +01:00
Igor Yakovlev 71afbb36f5 [Wasm] Introduce Xwasm-generate-wat compiler flag (disabled by default) 2022-12-29 11:57:48 +00:00
Pavel Kunyavskiy 4928e284f6 Make LateinitIntrinsicApplicabilityChecker warning for Native and JS
This checker was enabled only on JVM by mistake.
It's now fixed, but we don't want to make it an error in minor release.
So it will be an warning in 1.8.20 and an error in 1.9.0

^KT-27002
2022-12-20 20:06:52 +00:00
Artem Kobzar 3f4a937ad6 [K/JS] Don't generate TypeScript definitions from ExportModel if the -Xgenerate-dts flag was not provided ^Fixed KT-53940 2022-12-01 15:47:08 +00:00
Svyatoslav Kuzmich 78bd6dbdcd [Wasm] Allow implementing function interfaces 2022-11-14 11:23:18 +01:00
Ilya Chernikov fa0cda6236 FIR JS: enable full JS box tests with FIR 2022-11-12 14:34:07 +01:00
Sergej Jaskiewicz 7b7c517dbb [JS IR] Emit original names for local vars to sourcemaps
#KT-35655 Fixed
2022-11-09 12:35:44 +00:00
Artem Kobzar 14e4febb05 [K/JS] Exclude default from the regular reserved keywords to give ability to export declarations with default export ^KT-54480 Fixed
fix(KT-54480): exclude default from the regular reserved keywords to give ability to export intities with default export.

Merge-request: KT-MR-7459
Merged-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>
2022-10-24 10:12:30 +00:00
Artem Kobzar 7b9aed25da [K/JS] Add the ability to turn off polyfills generating 2022-10-19 12:52:23 +00:00
Sergej Jaskiewicz 227864c6ec [JS IR] Add a compiler option for generating name entries in sourcemaps 2022-10-14 10:09:39 +00:00
Artem Kobzar de880ce9aa [K/JS] Move ES modules logic to a new transformer with IC 2022-10-13 07:32:44 +00:00
Artem Kobzar eb2326eabb [K/JS] Add ability to exclude declarations from export by a new annotation @JsExport.Ignore. 2022-10-03 11:07:25 +00:00
Artem Kobzar 0bb0be8703 feat(KT-48814): represent all of the external declarations nullable properties as an optional fields inside d.ts. 2022-09-02 10:50:20 +00:00
Ilya Goncharov 2f75ea585e [JS, Frontend] Not report warning with non-exportable super type
^KT-53539 fixed
2022-08-18 12:46:40 +00:00
Artem Kobzar 87038e7d8a [K/JS] feat: add logic under the flag for strict implicit export generating inside d.ts files. 2022-08-09 16:48:59 +00:00
Nikolay Lunyak 9a9beef25b [FIR JS] Prepare the infrastructure for FIR JS tests 2022-06-02 13:47:24 +00:00
Sergej Jaskiewicz e03747ea7d [JS IR] Introduce the GENERATE_INLINE_ANONYMOUS_FUNCTIONS feature flag 2022-06-01 09:02:31 +00:00
Victor Petukhov 2378979a99 [FE JS] Support until operator in WRONG_OPERATION_WITH_DYNAMIC error 2022-05-31 08:42:55 +00:00
Artem Kobzar 6da3b3b274 fix: remove unnecessary warnings for export declarations. 2022-05-13 11:10:17 +00:00
Artem Kobzar a2b40acc98 feat: add WARNING on usage top-level exportable declarations with non-consumable identifiers. 2022-05-04 11:22:57 +00:00
Igor Laevsky 3de1235fda [WASM] Add command line option to enable/disable assertions 2022-04-26 20:41:52 +00:00
Aleksei.Cherepanov 3d8f140d6b [JPS] Fix incremental build after changing Java enum used in Kotlin when
EnumWhenTracker implemented for tracking changed java enum class items, that used in kotlin when expression.

#KT-47824 Fixed
2022-04-19 18:39:41 +00:00
Igor Laevsky 81eae94821 [Wasm] Disable range checks for arrays. Add cli argument to enable them back. 2022-04-05 18:00:32 +00:00
Victor Petukhov b5933c70e2 [FE 1.0] Refactor error utils: split error entities and introduce error type and error scope kinds 2022-03-23 21:13:33 +00:00
Dmitry Savvinov ea466353fb Dont store type refinement mode in analysis flags
Instead, check the refiner from the DI-container or refiner from
capability of a module descriptor.

The reason is because in the IDE there might be multiple
ResolutionFacades (-> multiple DI-containers -> multiple module
descriptors) for one and the same IDE module, with different refinement
settings.
However, due to how the code is written, it's hard to have
different LanguageVersionSettings for one and the same module.

After this commit the refinement settings are determined by the
moduleDescriptor capabilities, which is much easier to tweak

See usage of that change in Kotlin IDE Plugin (commit is linked to the
YT issue)

^KTIJ-20775
2022-02-14 13:08:50 +03:00
Alexander Korepanov 59173baf5a [JS IR] Pass forward -Xir-property-lazy-initialization option
Pass forward -Xir-property-lazy-initialization option
for the incremental cache.

^KT-50175 Fixed
2022-01-19 13:28:47 +00:00