Commit Graph

2722 Commits

Author SHA1 Message Date
Alexander Udalov e0b9ffa780 Regenerate builtins sources 2020-01-03 13:09:43 +01:00
Ilya Gorbunov a98f36bce4 Reorganize existing Closeable/AutoCloseable.use tests 2019-12-28 03:02:01 +03:00
Toshiaki Kameyama 941de655c4 Add contract for 'use'
#KT-35216 Fixed
2019-12-28 02:54:29 +03:00
Ilya Gorbunov 043eddb432 Cleanup: use effects introduced by contracts of assert* functions 2019-12-28 02:51:56 +03:00
Miguel Serra 4fa5e2d85c KT-20357: Add samples for linkedSetOf 2019-12-26 20:07:39 +03:00
Tillmann Berg 95300ae31d KT-20357: Add sample for reduce, reduceRight and their indexed counterparts 2019-12-26 19:57:33 +03:00
Ilya Gorbunov 6d092b5f71 Add more reduceOrNull tests
- Test for unsigned arrays
- Update binary api dump with the new functions
2019-12-26 19:27:47 +03:00
Alfredo Delli Bovi 9546307243 Add sample for reduceOrNull and reduceRightOrNull 2019-12-26 19:27:46 +03:00
Alfredo Delli Bovi 06008c40ab KT-33761 Add reduceRightOrNull 2019-12-26 19:27:46 +03:00
Alfredo Delli Bovi f5d696d3c4 KT-33761 Add reduceOrNull 2019-12-26 19:27:46 +03:00
Svyatoslav Kuzmich d74721716a [JS IR] Use short klib names instead of absolute paths 2019-12-25 13:44:57 +03:00
Svyatoslav Kuzmich 31c84e9ac4 [JS IR] Build stdlib using compiler from repo
Previously JS IR versions of stdlib and kotlin-test were build
by default using compiler previously built on a buildserver.

It had some issues:
 - This required us to advance bootstrap every time we made any
   incompatible IR changes. This happens often since IR ABI is
   not quite stable yet.

 - We never tested the exact combination of compiler and stdlib we publish

   We tested:
    - new compiler with new stdlib build by new compiler (in box tests)
    - old compiler with new stdlib build by old compiler (in stdlib tests)

   We published:
    - new compiler with new stdlib build by old compiler

After this change JS IR compiler tests, builds and publishes
single configuration:

    new compiler with new stdlib build by new compiler

JS IR stdlib and kotlin-test are now built using JavaExec of CLI instead
of Gradle plugin to avoid troubles of loading a freshly built plugin.

This also allows to have a granular dependencies: we don't rebuild klib
if we changed a lowering in a compiler backend, but we do rebuild it if
we changed IR serialization algorithm.
2019-12-25 13:44:57 +03:00
Roman Artemev 9871f8c579 [JS BE] Fix DCE to let it remove constant properties 2019-12-24 19:26:05 +03:00
Alexander Udalov cdbabf224f Introduce RequiresOptIn and OptIn annotations
RequiresOptIn should be used now instead of Experimental, OptIn instead
of UseExperimental. See https://github.com/Kotlin/KEEP/pull/201.

This change adds the new declarations only to the stdlib, and supports
them in the compiler. Because of the way compiler loads annotations, we
need to bootstrap it first before deprecating the old annotations and
updating tests.

 #KT-34647 Fixed
2019-12-17 18:17:48 +01:00
Abduqodiri Qurbonzoda b868e6f8da Rename Appendable methods parameters 2019-12-17 19:04:00 +03:00
Tillmann Berg cf86dc9a89 KT-20357: Add sample for Collections distinct and distinctBy methods 2019-12-11 07:42:05 +03:00
Ilya Gorbunov f0e67f8397 Fix coreLibsInstall composite task
It was broken after the commit bbdbc2896b,
which included kotlin-stdlib-js-ir project into coreLibs list,
but that project didn't have 'install' task, on which 'coreLibsInstall' depends
2019-12-11 06:36:40 +03:00
Abduqodiri Qurbonzoda 56cae75404 Fix StringBuilder reverse test 2019-12-10 13:07:27 +03:00
Abduqodiri Qurbonzoda 19e001afad Commonize Float.rangeTo(Float) #KT-35299 2019-12-09 20:24:06 +03:00
Abduqodiri Qurbonzoda 20d02dd0ee Commonize StringBuilder 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 1431e27a7b Move StringBuilder to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 0c033297a8 Move Appendable to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 50752d47fe Move CharacterCodingException to its own file 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 956e085b22 Rename text.kt file to StringBuilderJs.kt 2019-12-04 22:15:33 +03:00
Abduqodiri Qurbonzoda 2155f1680f Fix small mistake in CharSequence.lastIndexOf documentation 2019-12-04 22:15:33 +03:00
Ilya Gorbunov edfd933348 Improve Result docs to emphasize that any Throwable exception is caught
#KT-33447 Fixed
2019-12-03 21:08:31 +03:00
Ilya Gorbunov 555d503ff9 Improve indexOf sample to showcase return value handling
Remove sample reference from indexOf(Char) overload: both overloads are on
the same page, and showing the sample for indexOf(String) under indexOf(Char)
is redundant and misleading.
2019-11-29 21:34:49 +03:00
Burak Eregar e30d87ee01 KT-20357: Add samples for indexOf 2019-11-29 21:34:49 +03:00
Kerooker c16b89d770 Fix XorWowRandom documentation
This commit changes XorWowRandom.kt documentation to include a HTTPS link instead of a HTTP link, for security purposes.

This commit also changes the same documentation to reflect the real cycles from the `xorwow` algorithm:

    Simple and very fast (125 million/sec), the elements in its cycle of 2^192 − 2^32 easily pass all the tests in Diehard.

 Marsaglia, G. 2003. Xorshift RNGs. J. Statis. Soft. 8, 14, p. 5

 At last, this commit explicits which part of the code is the implementation of the mentioned algorithm.

 Closes KT-35175
2019-11-29 19:31:55 +03:00
Dmitry Borodin 664d69b752 Add flatMap sample KT-20357 2019-11-29 17:35:06 +03:00
Dat Trieu f334ad2ffc KT-20357: Add samples for associate* functions (#2798)
* KT-20357: Add samples for functions related to associate

* KT-20357: Use same fib function for both samples

* KT-20357: Use examples with duplicate keys and simplify examples with primitives

* KT-20357: Use primitive samples for all arrays

* KT-20357: Use String splitting example to better illustrate the use for associate over associateBy with a valueSelector
2019-11-29 16:54:02 +03:00
Roman Artemev 757ddd9179 [JS IR] Fix standard collections
- remove PlatformDependent annotated methods
2019-11-28 14:45:34 +03:00
Vyacheslav Gerasimov 8d31d4a60f Replace com.moowork.node plugin with com.github.node-gradle.node 2019-11-27 21:26:34 +03:00
Vyacheslav Gerasimov 81e24fbdb4 Build: Extract version of com.moowork.node to the settings.gradle 2019-11-27 21:26:34 +03:00
Anton Bannykh 9fec2c78d1 JS IR: apply forLoopsLowering
Replaced createTemporaryVariable usages with createTmpVariables.
The latter doesn't rely on KotlinType's. Using KotlinType with
JS_IR backend causes runtime excpetions, as some expected descriptor
API is not implemented, because it avoids descriptors as much as
possible.
2019-11-26 15:08:10 +03:00
Anton Bannykh 81699299f5 JS_IR: DCE
Could be enabled by toggling `-Xir-dce`

Box test output in js/js.translator/testData/out-min
2019-11-26 12:20:39 +03:00
Svyatoslav Kuzmich dc336c3c8a [JS] Add marker function getReifiedTypeParameterKType to runtime
So compiler bugs would produce a nicer error message instead of:
"TypeError: getReifiedTypeParameterKType is not a function"
2019-11-25 20:25:03 +03:00
Roman Artemev 987c6ab3ee [JS IR] Roll making Char inline class back
- un/mute falling tests
2019-11-25 20:22:03 +03:00
Alexey Trilis 764a25f6ae [JS] Add deprecated typealias and extension properties for renamed in dukat update entities 2019-11-20 12:49:03 +01:00
Roman Artemev 18d0b477b6 [JS IR] Fix arrayOfNulls API 2019-11-19 11:15:36 +03:00
Alexey Trilis 4f56b1a960 Add support for Touch API in JS Stdlib
#KT-34948 fixed
#KT-21445 fixed
2019-11-18 19:44:03 +03:00
Nikolay Krasko 155a760ee9 Revert "Revert [JS IR] commits that failed build"
This reverts commit 740f851a
2019-11-07 16:24:13 +03:00
Alexander Udalov 7f4b568021 Mark new KClass.cast/safeCast extensions as low-priority
To avoid overload resolution ambiguity error in sources where everything
from both kotlin.reflect and kotlin.reflect.full is imported with a
star-import
2019-11-05 19:34:06 +01:00
Nikolay Krasko 740f851a10 Revert [JS IR] commits that failed build
Revert "[JS IR] Build hybrid versions of stdlib and kotlin.test"
This reverts commit b9f88350dd.

Revert "[JS IR] Add gradle plugin integration tests"
This reverts commit d872b27663.

Revert "Update bootstrap"
This reverts commit bc47594c7a.

Revert "[JS IR] Support generating both IR and pre-IR libraries"
This reverts commit 1b8df45bfe.
2019-11-05 13:58:39 +03:00
Svyatoslav Kuzmich b9f88350dd [JS IR] Build hybrid versions of stdlib and kotlin.test
IR version of libraries are no published by default inside pre-IR JARs
2019-11-01 19:42:06 +03:00
Alexander Udalov 896512f7cd Support KClass.isInstance/cast/safeCast in stdlib-only reflection implementation
#KT-14720 Fixed
2019-10-29 15:52:00 +01:00
Alexander Udalov 5c89f2fa54 Support KClass.qualifiedName in stdlib-only reflection implementation
#KT-34586 Fixed
2019-10-29 15:51:25 +01:00
Alexander Udalov c164745301 Support KClass.simpleName in stdlib-only reflection implementation
#KT-33646 Fixed
2019-10-29 15:51:21 +01:00
Alexander Udalov c676a30919 Minor, clarify comment on SafePublicationLazyImpl.final 2019-10-24 16:57:54 +02:00
Ilya Gorbunov 59482f6827 Do not blank opt in for allowing kotlin package in all subprojects
-Xallow-kotlin-package must be specified explicitly to prevent
unintended declarations in kotlin package.
2019-10-24 16:05:48 +03:00