Commit Graph

1313 Commits

Author SHA1 Message Date
Ilya Gorbunov 4e5e14c9a0 Provide string-to-number conversions in JS and common stdlib.
Relates to #KT-8286
#KT-4497 Fixed
2017-01-24 07:20:57 +03:00
Roman Elizarov 07dc937e2e typo if start/createCoroutine docs fixed 2017-01-23 14:25:04 +03:00
Ilya Gorbunov 3a1ed41436 Create deprecated MutableList.sort extensions to guide how to replace them.
#KT-15790 Fixed
2017-01-21 03:14:42 +03:00
Ilya Gorbunov ed9b9d972c Make 'add' function abstract in AbstractMutableSet in JVM 2017-01-18 20:07:24 +03:00
Roman Elizarov 25739a08ea CoroutineContext Key and Element are now inside CoroutineContext interface itself (just like Map.Entry)
ContinuationInterceptor companion object is named Key
CoroutineContext.Element property for key is named just key
AbstractCoroutineContextElement implements all of CoroutineContext.Element, including key
2017-01-16 14:33:02 +03:00
Ilya Gorbunov 914c55b57f Refactor: use new functions in stdlib code 2017-01-16 09:31:45 +03:00
Ilya Gorbunov 1ae56c374f Introduce new function 'takeIf' to replace value with null if it doesn't match the predicate.
#KT-7858
2017-01-16 05:58:51 +03:00
Ilya Gorbunov 1ac9815d76 Introduce new scope function: 'also'. Works like 'apply' but with 'it' instead of 'this' inside lambda.
#KT-6903
2017-01-16 05:58:51 +03:00
Ilya Gorbunov 3d70d73964 Rename file class CoroutinesLibraryKt to CoroutinesKt 2017-01-15 20:57:11 +03:00
Ilya Gorbunov 9f303ed06e Migrate to new coroutines API, rename Iterator implementation, annotate new API with SinceKotlin. 2017-01-14 20:14:06 +03:00
Ilya Gorbunov ffb183a2f3 Move a bit of bytecode out of next() 2017-01-14 20:14:05 +03:00
Ilya Gorbunov 560c184fd4 Merge AbstractIterator and SequenceBuilder, remove hasNext call from next. 2017-01-14 20:14:03 +03:00
Ilya Gorbunov 141ad43039 Introduce buildSequence and buildIterator functions based on coroutines. 2017-01-14 20:14:01 +03:00
Denis Zharkov 14f942aca7 Refine ABI for coroutine lambdas
Make their invoke work in the same way as any other suspend function:
it should return SUSPENDED_MARKER iff. it indeed became suspended
2017-01-14 19:51:05 +03:00
Denis Zharkov 85a3fefcc6 Get rid of SuspendFunctionX interfaces
Use a pair of effectively abstract methods in CoroutineImpl instead
2017-01-14 15:13:37 +03:00
Roman Elizarov 8d6a913cee CoroutineContext and ContinuationInterceptor (instead of dispatcher) 2017-01-14 13:24:53 +03:00
Denis Zharkov 2cb9d3a8ad Move coroutine intrinsics to kotlin.coroutine.intrinsics package
Also rename val SUSPENDED to SUSPENDED_MARKER

 #KT-15698 Fixed
2017-01-14 13:24:53 +03:00
Ilya Gorbunov 80f2efb625 joinTo/joinToString: Do not call toString on elements that are already CharSequence or Char.
#KT-15557
2017-01-13 19:49:57 +03:00
Ilya Gorbunov cdfb72ab76 Provide protected toArray implementation in AbstractCollection.
Relates to #KT-13898
2017-01-13 19:38:28 +03:00
Ilya Gorbunov 4816474d70 Hold back eachSumOf for a while. 2017-01-11 16:49:45 +03:00
Ilya Gorbunov 0dfcbdf072 Improve docs, use consistent naming for parameters, rename unused parameters of lambdas to _. 2017-01-11 16:49:45 +03:00
Ilya Gorbunov 04a0f0a036 Rename Grouping.elementIterator to sourceIterator 2017-01-11 16:49:45 +03:00
Ilya Gorbunov 6d3a71c691 Minor refactoring: use mapValuesInPlace optimization, delegate aggregate implementation to aggregateTo. 2017-01-11 16:49:45 +03:00
Ilya Gorbunov 2a2b417025 KEEP-23 implement group and fold operations
Docs for group-and-fold operations

Fix implementation for countEach and sumEachBy

countEach and sumEachBy implementations for JS

Rename keySelector to keyOf

Generate additional sources for groupingBy + headers

Rename countEach and sumEachBy to eachCount and eachSumOf.
2017-01-11 16:49:45 +03:00
Ilya Gorbunov 3bf38e62c8 Add a note about NaN propagation for floating point specializations. 2017-01-11 14:45:21 +03:00
Ilya Gorbunov 0bf2ba8701 Introduce new overloads of max and min to fix NaN propagation behavior on JVM. 2017-01-11 14:45:18 +03:00
Ilya Gorbunov 844c68286a Refactor: replace Math.min with minOf in common code.
Add temporary import of kotlin.comparisons where required.
2017-01-11 14:42:36 +03:00
Ilya Gorbunov 51c24a0c3c Introduce minOf/maxOf in kotlin.comparisons. #KT-7417 2017-01-11 14:42:36 +03:00
Ilya Gorbunov 35d433160e Move more logic of 'use' into 'closeSuppressed', rename the latter to 'closeFinally', that will result in more compact inline call expansions. 2017-01-11 14:35:38 +03:00
Ilya Gorbunov a71b68268d Refactor exception suppression to provide Throwable.addSuppressed extension in kotlin-stdlib.
Place Closeable and AutoCloseable extensions to separate files (CloseableKt and AutoCloseableKt).
#KT-15477 Fixed
2017-01-11 14:35:38 +03:00
Ilya Gorbunov 076a94f7f2 Provide parameterless mutable collection factory functions.
#KT-15630
2017-01-11 14:33:17 +03:00
Mikhael Bogdanov dc4cdbf82d Fix for KT-14162: Support @InlineOnly on inline properties
#KT-14162 Fixed
2017-01-10 14:09:41 +01:00
Ilya Gorbunov 5db75c993b Introduce array-like list instantiation functions.
#KT-14935 Fixed
2016-12-30 20:00:45 +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 9619e08c9b Use emptyArray in orEmpty. 2016-12-24 02:03:48 +03:00
Ilya Gorbunov 05dcaccf09 Do not require array extensions being reified to create new array.
#KT-15377
2016-12-24 01:55:33 +03:00
Ilya Gorbunov 6b509892cb Remove manual overflow for JS arithmetic operations 2016-12-23 18:14:32 +03:00
Denis Zharkov d0ba048342 Refine coroutine/suspend functions ABI
- `invoke` method must always start a suspend functions
- For creation of coroutine that has not been started yet, there are
two special internal interfaces `SuspendFunction0`/`SuspendFunction1`
2016-12-22 11:08:42 +03:00
Ilya Gorbunov 6ee8a23ddd JS: Drop native map get/set intrinsics altogether.
MutableMap.set extension operator is now common among stdlib and stdlib-js.
#KT-2323
2016-12-20 18:00:19 +03:00
Ilya Gorbunov 2209631f1a Add SinceKotlin to new coerceIn method. 2016-12-19 18:36:52 +03:00
Ilya Gorbunov 10f8e70322 Rename ClosedComparableRange to ClosedFloatingPointRange 2016-12-19 18:36:52 +03:00
Ilya Gorbunov 75992173b6 Unify Array.plus and plusElements function templates between JVM and JS. 2016-12-16 04:36:21 +03:00
Ilya Gorbunov 202cd81134 Unify Array.copyOf and copyOfRange function templates between JVM and JS. 2016-12-16 04:36:20 +03:00
Ilya Gorbunov 572a63f0e2 Unify Array.sort and sortWith function templates between JVM and JS.
Introduce new inline-only overload Array<out T: Comparable<T>>.sort().
2016-12-16 04:36:18 +03:00
Ilya Gorbunov e890cb137f Unify MutableList.reverse function template between JVM and JS 2016-12-16 04:36:16 +03:00
Ilya Gorbunov 085f476d22 Unify content[ToString, Equals, HashCode] function templates between JVM and JS 2016-12-16 04:36:14 +03:00
Ilya Gorbunov f3df648f4a Unify toTypedArray and asList templates between JVM and JS 2016-12-16 04:36:12 +03:00
Ilya Gorbunov 6ea1cde449 Generate additional sources for JS instead of copying them from JVM 2016-12-16 04:31:07 +03:00
Roman Elizarov 7b079bd1f7 Renaming after DM 2016-12-15 23:58:22 +03:00
Ilya Gorbunov 3bedbfae33 Move kotlin.comparisons.Comparator to kotlin package and remove the former from default imports. 2016-12-15 13:39:10 +03:00