Commit Graph

65 Commits

Author SHA1 Message Date
Abduqodiri Qurbonzoda 600e306d80 Fix JS Map.keys.remove return value #KT-65525 2024-02-08 07:46:09 +00:00
Alexander Korepanov ad3583ac38 [JS IR] Fix KClass equals for Nothing type 2023-07-21 14:48:30 +00:00
Alexander Korepanov bfb7f74e47 [JS IR] Add linkedHashMap tests
^KT-59001
2023-07-21 14:48:29 +00:00
Abduqodiri Qurbonzoda 830c78773c Align behavoir of collection constructors across platforms #KT-59192
The initialCapacity should be non-negative and loadFactor should be positive.

As a part of efforts to stabilize Native stdlib.
2023-06-08 12:41:40 +00:00
Ilya Gorbunov 4c461d7864 Add min/max test generator and generated tests
Temporarily exclude these tests from kotlin-stdlib-wasm testing due to KT-51647
2022-04-04 22:33:25 +00:00
Alexander Udalov 3bc0eaff59 Fix warnings in stdlib samples and test modules 2021-08-10 17:57:50 +02:00
Ilya Gorbunov ed3542cdf5 Support covariant MutableMap.entries.remove in JS/IR
Workaround for KT-43321
Follow up to KT-41278
2021-04-26 17:45:27 +03:00
Abduqodiri Qurbonzoda ff5b2404af Introduce firstNotNullOf and firstNotNullOfOrNull #KT-12109 2021-03-12 09:27:14 +03:00
Abduqodiri Qurbonzoda 1314adb6f7 Locale-agnostic case conversions by default #KT-43023 2020-12-30 10:08:25 +03:00
Ilya Gorbunov 28168bf230 Correctly implement specialized MutableEntrySet.contains KT-41278
This is a workaround for the problem KT-43321.

Introduce an intermediate abstract set specialized for Map.Entry elements
and implement 'contains(Map.Entry)' method there.

Then inherit that intermediate set in entrysets of JS HashMap,
JS LinkedHashMap, JVM MapBuilder, that are specialized for
MutableMap.MutableEntry elements, so that no override of 'contains' is
required anymore.

This allows to avoid incorrect special 'contains' bridge being generated
that otherwise rejects all arguments except ones of MutableEntry type.
2020-12-14 12:42:47 +03:00
Ilya Gorbunov bdd53ee9cd Introduce new overloads of flatMap and flatMapTo
- Sequence<T>.flatMap((T) -> Iterable<R>)
- Iterable<T>.flatMap((T) -> Sequence<R>)
- Array<T>.flatMap((T) -> Sequence<R>)
- Map.flatMap((Entry) -> Sequence<R>)

KT-34506
2020-06-02 19:01:43 +03:00
Abduqodiri Qurbonzoda 4a7b1b210a Add onEachIndexed similar to forEachIndexed #KT-37161 2020-04-11 03:47:47 +03:00
nikita.movshin 65244b4bea Update copyright.
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Ilya Gorbunov e21c235bbb Add or update copyrights in the standard library sources 2018-04-26 21:57:50 +03:00
Ilya Gorbunov 20b122c1dd Use kotlin.test.Test instead of org.junit.Test in common stdlib tests
(and in jvm-only and js-only tests also)
2017-10-15 17:40:53 +03:00
Ilya Gorbunov f10ea03173 Provide extension to get mutable iterator from the mutable map
#KT-18992 Fixed
2017-07-24 21:02:15 +03:00
Ilya Gorbunov 6ae19e03d5 Clean warnings and refactor stdlib tests.
Merge RangeJVMTest into RangeTest.
2017-04-18 18:51:20 +03:00
Ilya Gorbunov 2e0209395a Restore Map.minus(key/keys) and Map.minusAssign(key/keys) operators.
#KT-13353
2017-01-25 22:08:46 +03:00
Ilya Gorbunov 822e58ad83 Map.getOrImplicitDefault is exposed public as Map.getValue
#KT-11851
2016-12-29 07:49:27 +03:00
Ilya Gorbunov dc57d69085 Improve onEach templates.
Add new functions to reference API.
Add tests for onEach
  #KT-8220
2016-11-30 16:46:56 +03:00
Ilya Gorbunov 6a70761783 Minor: normalize '@Test' annotation casing in all tests. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov 50cd620f92 Remove java.util.* imports from common code. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov 2c1d90c79d Improve test coverage of map operations 2016-08-10 21:52:24 +03:00
Ilya Gorbunov fb99919c59 Accept maps out-projected by key where possible. 2016-08-10 21:52:24 +03:00
Ilya Gorbunov e35a214eaf Review fixes: special case of toMap for singleton map.
#KT-9108
2016-08-09 21:49:57 +03:00
Ilya Gorbunov efc8f2c88a Provide extensions to copy maps.
#KT-9108
2016-08-09 21:49:57 +03:00
Ilya Gorbunov 4b533b297e reified assertFailsWith available in kotlin-test for JS
#KT-11346
2016-04-27 18:22:20 +03:00
Ilya Gorbunov d5d19f5595 Make Map.plus accept Map out-projected by key type as either operand (receiver or parameter).
#KT-11301 Fixed
2016-03-31 17:20:58 +03:00
Ilya Gorbunov d46501e11b Make all remaining deprecations to be errors. 2016-01-27 18:34:32 +03:00
Ilya Gorbunov 23080f78f7 Map.getOrPut: treat nulls as missing values. 2016-01-26 11:49:18 +03:00
Ilya Gorbunov a49db730a9 Map.getOrElse: treat nulls as missing values. 2016-01-26 11:49:17 +03:00
Ilya Gorbunov 8224a4e186 Rename toMap and toMapBy to associate and associateBy 2016-01-26 11:49:03 +03:00
Ilya Gorbunov 300a4be060 Deprecate Map.minus and minusAssign operators.
Disable tests failing in JS.
2016-01-22 01:13:33 +03:00
Ilya Gorbunov aafd79078f Provide mutableSetOf and mutableMapOf
#KT-9663 Fixed
2016-01-18 21:46:29 +03:00
Ilya Gorbunov 19a4f65fd1 Cleanup in libraries 2016-01-17 15:52:12 +03:00
Ilya Gorbunov 188119aa83 Prepare to treat keys mapped to null same way as missing keys in Map extensions: getOrElse, getOrPut, getOrImplicitDefault. 2015-12-18 15:24:03 +03:00
Ilya Gorbunov 544bc9a70c Introduce toMap with key-value pair selector.
#KT-6657
2015-12-17 22:50:43 +03:00
Ilya Gorbunov dadcdb5771 StdLib cleanup, deprecated symbol usage: List and Map members 2015-11-21 00:54:08 +03:00
Ilya Gorbunov 07654eb82b StdLib cleanup, deprecated symbol usage: size() and length() 2015-11-21 00:54:05 +03:00
Ilya Gorbunov 9323f61eaf Introduce T.addTo(MutableCollection<T>), mapNotNull and mapIndexedNotNull extensions.
#KT-4410 Fixed
2015-11-11 03:12:17 +03:00
Ilya Gorbunov e09c0ae2ff Rename toMap { selector } to toMapBy.
#KT-6657
2015-10-08 17:48:47 +03:00
Ilya Gorbunov 12d9beb3a4 Deprecate join (use joinToString instead)
#KT-6909
2015-10-08 17:48:33 +03:00
Ilya Gorbunov 404b228954 StdLib cleanup: replace fails with assertFails 2015-10-07 22:36:06 +03:00
Denis Zharkov 5cecaa6f87 Get rid of deprecated annotations and modifiers in stdlib (besides JS) 2015-09-18 10:14:28 +03:00
Ilya Gorbunov d1a12aa2a7 plus, plusAssign, minus, minusAssign for all possible parameter types for Maps.
#KT-6594 Fixed
2015-07-15 17:12:45 +03:00
Ilya Gorbunov d04e94c826 Use NoSuchElementException instead of KeyMissingException. Deprecate KeyMissingException. 2015-06-24 21:39:40 +03:00
Ilya Gorbunov 5306e88425 Provide the way to specify implicit default for a readonly or mutable map.
Refactor: rename default key and value providers.
2015-06-24 21:39:33 +03:00
Ilya Gorbunov 46d91b2606 Add test for toMap with key selector and value transform. 2015-05-20 19:28:45 +03:00
Ilya Gorbunov 899a01e8c2 Rename sequence() extension to asSequence() 2015-04-22 17:57:20 +03:00
Ilya Ryzhenkov e448f40756 Rename Stream<T> to Sequence<T> and provide migration path via deprecated types and functions. 2015-03-12 22:56:43 +03:00