Commit Graph

1666 Commits

Author SHA1 Message Date
Ilya Gorbunov a429992e81 Do not generate headers for JS-only functions. 2017-01-18 22:16:49 +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
Ilya Gorbunov 3225ec8935 Provide headers for coroutine building blocks 2017-01-14 20:14:00 +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
Ilya Gorbunov 2dfcb490a5 Fix CoroutineContext tests, update public API dump 2017-01-14 13:24:53 +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 0c27e07e8c Improve headers of Appendable and StringBuilder 2017-01-13 19:41:59 +03:00
Ilya Gorbunov afdc7b94da Add headers for print and println.
#KT-15458 fixed
2017-01-13 19:41:59 +03:00
Ilya Gorbunov be95f66b13 Minor: remove unnecessary header. 2017-01-13 19:41:59 +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 6273ab5d43 Hold back eachSumOf for a while: fixups.
Remove unneeded import.
2017-01-11 20:04:00 +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 d73744f1c0 Tests for group-and-fold operations 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 897e9658ac Do not run total order tests on JS 2017-01-11 14:45:19 +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 74331f8eaa Add NaN propagation and total ordering tests. 2017-01-11 14:45:16 +03:00
Ilya Gorbunov 6041a7d6c8 Add tests for normal cases of maxOf/minOf 2017-01-11 14:45:14 +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
Alexander Udalov c4f731b987 Write Kotlin-Version to runtime artifacts built with Maven
Add a test that checks that Kotlin-Version and Kotlin-Runtime-Component have
been written to all relevant runtime libraries
2016-12-26 17:46:36 +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 c43e4f6682 Uncomment some assertions for overflow behavior that now can pass in JS 2016-12-23 18:14:32 +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 c6a812b11c Fix some API holes in headers 2016-12-20 14:02:01 +03:00