Commit Graph

1692 Commits

Author SHA1 Message Date
Ilya Gorbunov 33f3106157 Do not use Math in common code. 2017-01-30 19:44:51 +03:00
Ilya Gorbunov 4ac7be9fa5 Retract bitwise operators from builtins for Byte and Short and add them as extensions in kotlin.experimental package in stdlib.
#KT-16030
2017-01-30 18:54:59 +03:00
Dmitry Jemerov 8968d5663d Minor fixes for stdlb kdoc 2017-01-30 16:13:49 +01:00
Anton Bannykh 77aa685496 JS: char boxing 2017-01-30 16:31:44 +03:00
Ilya Gorbunov 7195e26ae2 Rollback Closeable.use implementation as it was in 1.0 in order not to call functions that were introduced in 1.1 from this inline function.
#KT-16026
2017-01-29 02:41:12 +03:00
Roman Elizarov a1571657f3 Updated test to experimental package 2017-01-27 23:24:13 +03:00
Roman Elizarov 8dc318dd92 Fixed KT-15963 (coroutines machinery should not use equals on results) 2017-01-27 23:24:13 +03:00
Denis Zharkov c362a9154b Rename SUSPENDED_MARKER to COROUTINE_SUSPENDED 2017-01-27 23:24:13 +03:00
Denis Zharkov 246946bc18 Move buildSequence/buildIterator to kotlin.coroutines.experimental 2017-01-27 23:24:13 +03:00
Denis Zharkov 68fc6fa217 Support non-CoroutineImpl instances in createCoroutine 2017-01-27 23:24:13 +03:00
Denis Zharkov 8fa8ba7055 Move coroutine-related runtime parts to kotlin.coroutines.experimental package
#KT-15975 Fixed
2017-01-27 23:24:13 +03:00
Denis Zharkov cb4914ab56 Make 'suspendCoroutineOrReturn' inline-only 2017-01-27 23:24:13 +03:00
Denis Zharkov 0e132b9857 Move all coroutine-related declarations from built-ins to stdlib
Also move internal declarations from runtime.jvm module into new package
kotlin.coroutines.jvm.internal in stdlib

The necessity of these declarations being in built-ins is controversial,
but also it will complicate the migration of current coroutine runtime
to a separate jar if we ever need this
2017-01-27 23:24:13 +03:00
Ilya Gorbunov dbaf31effe sourceDirs exclude the original test dir, so add it explicitly. 2017-01-27 14:53:33 +03:00
Ilya Gorbunov 01f53d0173 Return NaN as an average of an empty collection.
#KT-15399 Fixed
2017-01-27 14:53:33 +03:00
Ilya Gorbunov 661ff81e67 Specify names for parameters of functional types with two or more parameters to ease lambda completion.
#KT-13826
2017-01-27 14:46:29 +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 288e0b3c7e Allow to use Regex matches CharSequence and CharSequence matches Regex in infix form
#KT-14279
2017-01-25 21:31:42 +03:00
Ilya Gorbunov 19dd7ee09e Build kotlin-test after kotlin-stdlib, build kotlin-test sources with kotlin-stdlib tests again 2017-01-24 22:04:46 +03:00
Ilya Gorbunov 7ccaa77c5b Shade kotlin-runtime into kotlin-stdlib 2017-01-24 22:04:46 +03:00
Ilya Gorbunov a603de8bd7 Ensure string to number conversion fails on empty and blank inputs.
#KT-4497
2017-01-24 07:22:58 +03:00
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
Alexander Udalov fc637eb420 Change runtime component from "Core" to "Main"
This is needed to allow the old compiler have the new runtime libraries in the
classpath. See the previous commit for a more elaborate explanation
2017-01-21 12:57:15 +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 3d7bcbdff9 Minor: add two cases for Map.getOrDefault test
Relates to #KT-15610
2017-01-19 22:33:20 +03:00
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