Commit Graph

4073 Commits

Author SHA1 Message Date
Ilya Gorbunov 709076acc9 [stdlib] Improve documentation of Char.isWhitespace and test it behaves the same in different targets 2024-02-20 03:48:08 +00:00
Ilya Gorbunov baca742a31 [stdlib] Minor: fix various grammar in docs 2024-02-20 03:48:08 +00:00
Ilya Gorbunov 15375c0fd5 [stdlib] Use more idiomatic and performant implementation of isBlank
Also replace expect-actual with a common function because its implementation is no longer different in different platforms.

KT-65590
2024-02-20 03:48:08 +00:00
Abduqodiri Qurbonzoda ae3c9dd9b9 Improve Path.walk/delete/copyToRecursively documentation 2024-02-09 17:20:15 +00:00
Abduqodiri Qurbonzoda f8c587ddcf Fix security vulnerability in Path recursive functions #KT-63103
* Prohibit files with name "." or ".."
* Detect cycles caused by files with name "/"
* Prohibit copy outside the target directory

The commit also moves zip-related tests to PathRecursiveFunctionsZipTest.
2024-02-09 17:20:15 +00:00
Igor Yakovlev 7cf793f308 [Wasm] Add bootstrap declarations 2024-02-08 14:15:17 +00:00
Igor Yakovlev be6b9e8a9a [Wasm] Support lazy associated object initialisation
Fix #KT-63939
2024-02-08 14:15:17 +00:00
Abduqodiri Qurbonzoda 5b703c57ec Fix a test failure caused by KT-52181 2024-02-08 07:46:09 +00:00
Abduqodiri Qurbonzoda 600e306d80 Fix JS Map.keys.remove return value #KT-65525 2024-02-08 07:46:09 +00:00
Abduqodiri Qurbonzoda 20b9ac9d55 Fix memory leak in MapBuilder #KT-65518 2024-02-08 07:46:09 +00:00
Abduqodiri Qurbonzoda e4a8fc01c3 Fix typo in stdlib KDocs, behavoir -> behavior 2024-01-31 12:11:48 +00:00
Abduqodiri Qurbonzoda c9d8ecc599 Detect concurrent modifications in ArrayDeque #KT-63355
Remove the ArrayDeque.subList().subList() test for comodification detection.
For types that extend AbstractList and to not override subList function,
the behavior varies depending on JDK version. With JKD8, the test fails for ArrayDeque.
While with JDK9+, it passes.
2024-01-31 12:11:48 +00:00
Abduqodiri Qurbonzoda 5f16fb2e4d Introduce Common protected property AbstractMutableList.modCount #KT-57150 2024-01-31 12:11:48 +00:00
Anton Keks 695119ca35 [stdlib] remove duplicate size checks, as the same is done inside of Array extension functions that are called here 2024-01-31 06:51:08 +00:00
Abduqodiri Qurbonzoda b67ebf36a2 Implement optimized removeRange for ArrayDeque #KT-64956
Test ArrayDeque with size 15. With the existing sizes the removeRange
implementation couldn't reach the maximum number of iterations - 3.

Benchmark results for ArrayDeque.subList().clear() that uses
removeRange() can be found here:
https://github.com/qurbonzoda/KotlinArrayDequeBenchmarks/tree/master/results
2024-01-30 22:37:25 +00:00
Abduqodiri Qurbonzoda 240a423bed Introduce Common protected function AbstractMutableList.removeRange #KT-57151 2024-01-30 22:37:25 +00:00
Artem Kobzar 8c69ffe8c9 [K/Wasm] Generate wasm-specific unsigned implementations ^KT-58039 Fixed 2024-01-29 20:11:41 +00:00
Artem Kobzar b59993d88a [K/Wasm] Prepare for splitting unsigned implementation helpers into expect/actuals KT-58039 2024-01-29 20:11:41 +00:00
vladislav.grechko f318b5969d Erase non-reified type parameters by-default when inlining.
Substitution of type arguments to non-reified type parameters may lead
to accidental reification, which should not be done (see ^KT-60174 for
examples). So, we should erase them, except the few cases.

^KT-60174: Fixed
^KT-60175: Fixed
2024-01-26 18:31:20 +00:00
Anastasiia Spaseeva 945f602b91 Revert "[Wasm] Support lazy associated object initialisation"
This reverts commit 552ee1ee38.
2024-01-25 14:11:56 +01:00
Igor Yakovlev 552ee1ee38 [Wasm] Support lazy associated object initialisation
Fix #KT-63939
2024-01-24 16:24:44 +00:00
Igor Yakovlev 3e9b2573c5 [Wasm/std] Fix invalid sign for FP rem operator
Fixed #KT-64829
2024-01-24 15:40:48 +00:00
Artem Kobzar 8d1a90c23c [K/JS] Support essential Kotlin collections (List, MutableList, Set, MutableSet, Map, MutableMap) for exporting into JS
^KT-34995 Fixed
^KT-44871 Fixed
2024-01-24 11:14:46 +00:00
Anastasia.Nekrasova ad9025afa6 [k1/K2]: Mark @SubclassOptInRequired as an experimental
At the moment, SubclassOptInRequired is marked with the
ExperimentalSubclassOptIn annotation. However, it does not work
as expected due to a missing opt-in error. To use SubclassOptInRequired,
an explicit opt-in is necessary because SubclassOptInRequired is an
unstable feature now.

^KT-64739
2024-01-15 14:54:36 +00:00
Igor Yakovlev 931cc48def [Wasm/WASI] Implementation of a callback on root exported function exit
Fixed #KT-64486
2024-01-15 11:37:37 +00:00
Igor Yakovlev 99d5ee4db8 [stdlib] Replace usage of Enum.values with Enum.entries 2024-01-12 18:28:00 +00:00
Igor Yakovlev 2d08953c91 [stdlib] Remove unused kotlin.time.formatUpToDecimals 2024-01-12 18:28:00 +00:00
Igor Yakovlev 1e9bc1abc7 [Wasm/WASI] Use K/JVM implementation of MonotonicTimeSource
Fixed #KT-60963
2024-01-12 18:28:00 +00:00
Igor Yakovlev 567fc6b140 [Wasm/WASI] Make std random generator 64bit seeded
Fixed #KT-60962
2024-01-12 18:28:00 +00:00
Yahor Berdnikau 2a55aa782d Revert "[Gradle] Add dsl marker to KotlinSourceSet"
This reverts commit eb663117c7.
2024-01-10 22:10:59 +00:00
Yahor Berdnikau eb663117c7 [Gradle] Add dsl marker to KotlinSourceSet
We also need users to distinguish KotlinSourceSet DSL from other levels
of DSL, specifically extension one.

^KT-64722 In Progress
2024-01-08 14:07:50 +00:00
Filipp Zhinkin 940c3c81ad KT-64361 delegate Int/Long::sign to methods from Java stdlib
Merge-request: KT-MR-13708
Merged-by: Filipp Zhinkin <filipp.zhinkin@jetbrains.com>
2024-01-05 17:13:37 +00:00
Dmitrii Gridin b6d373d8e5 Update copyright to 2024 2024-01-05 13:43:17 +00:00
cristiangarcia 5a1fb78fcd Declare generated SourceSets correctly
Allow Gradle to keep the track of the task generating the sources
KTI-1502 Fixed
2023-12-24 00:01:59 +00:00
Yahor Berdnikau ea8f7af1f2 [Gradle] Add api marker to Kotlin compilation tasks DSL
Kotlin's compilation tasks DSL should also be separated from other DSL
parts.

^KT-57292 In Progress
2023-12-21 10:30:50 +00:00
Artem Kobzar 2530cba82a [K/JS] Compile Kotlin coroutines as JS generator ^KT-63038 Fixed 2023-12-18 17:13:07 +00:00
Artem Kobzar 1473b4bb41 [K/Wasm] Introduce JsBigInt type 2023-12-13 18:44:57 +00:00
Ilya Gorbunov 5ce2a2cbee Use strongly typed task GenerateProjectStructureMetadata to tweak kpsm.json 2023-12-13 15:40:25 +00:00
Ilya Gorbunov e0bc0b81c6 [kotlin-test] Drop subprojects unneeded anymore KT-61969 2023-12-13 15:40:25 +00:00
Ilya Gorbunov f07bf70aa7 Switch stdlib tests to KMP kotlin-test KT-61969 2023-12-13 15:40:25 +00:00
Ilya Gorbunov f3240757ed Extract custom publishing dsl to buildsrc-compat
It will be used also in kotlin-test KT-61969
2023-12-13 15:40:25 +00:00
Artem Kobzar 2eb1e65bbf [K/Wasm] Allow to export unsigned numbers 2023-12-08 09:06:19 +00:00
Alexander.Likhachev a19bd2ed2e [Build] Migrate most of the build logic from Project.buildDir usage
It's going to be deprecated in Gradle 8.3

There's currently no way to pass a `org.gradle.api.provider.Provider` to the JavaExec.systemProperty or Test.systemProperty. There's a workaround using `org.gradle.process.CommandLineArgumentProvider`, but I intentionally don't rework these calls as Gradle is going to allow passing providers to configure system properties: https://github.com/gradle/gradle/issues/12247#issuecomment-1568427242
^KTI-1473 In Progress
2023-12-07 18:31:06 +00:00
Ilya Gorbunov 28c1049518 [stdlib] KT-55619 provide samples and extend documentation for String.format 2023-11-27 15:04:51 +00:00
Abduqodiri Qurbonzoda e94b247835 Introduce Common StringBuilder.append/insert(Byte/Short) extensions #KT-63341 2023-11-26 02:48:19 +02:00
Abduqodiri Qurbonzoda db6a662631 Remove Common StringBuilder.append/insert(Byte/Short) members #KT-63341 2023-11-26 02:48:18 +02:00
Ilya Gorbunov 88bbe8d92d [stdlib] Enable explicit API mode 2023-11-24 01:45:45 +00:00
Ilya Gorbunov d8ee74222f [builtins-gen] Explicit visibility for companion objects and secondary constructors 2023-11-22 18:04:34 +00:00
Ilya Gorbunov ab7c2f2196 [stdlib] Explicit visibility and return types: builtins 2023-11-22 18:04:34 +00:00
Ilya Gorbunov df190b1265 [stdlib] Explicit visibility and return types: JVM internal 2023-11-22 18:04:34 +00:00