Commit Graph

2681 Commits

Author SHA1 Message Date
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
Ilya Gorbunov bbdbc2896b Workaround in FloatMathTest.powers to avoid failures with js-ir runtime
Include kotlin-stdlib-js-ir in local core libs build/test and
enable failing build on test failures.

Relates to: KT-24975
2019-10-16 17:48:47 +03:00
Alexey Trilis b30537de0e Generate Kotlin/JS stdlib dependencies via dukat 2019-10-12 01:39:25 +02:00
Abduqodiri Qurbonzoda 834eeb567b Alter componentN documentation 2019-10-10 05:08:44 +03:00
Abduqodiri Qurbonzoda e54b405fe4 Fix Iterable, Sequence and String index overflow in windowed 2019-10-09 19:48:39 +03:00
Abduqodiri Qurbonzoda b4d580fa91 JS: document array destructuring behavior (KT-17544) 2019-10-08 19:24:31 +03:00
Svyatoslav Kuzmich 18d9e9b2b5 [JS] Make JsExport experimental
- JsExport was meant to be experimental from the beginning but
annotation was missing
- Add missing @SinceKotlin
2019-10-08 16:33:17 +03:00
Svyatoslav Kuzmich 5d7f18b1b9 [JS] Support wrapped and dynamic types in typeOf 2019-10-03 13:12:46 +03:00
Ilya Gorbunov 2106274fa3 Minor: fix Charset type reference in kdoc
#KT-34086 Fixed
2019-10-01 03:01:11 +03:00
Ilya Gorbunov 885d99068c Test reading files with incorrectly reported length
#KT-33864
2019-09-28 19:23:26 +03:00
Ilya Gorbunov c9dd8344d1 Do not use file length estimate in File.readText
This handles the situation when reported file length is less than actual.

#KT-33864
2019-09-28 19:20:54 +03:00
Ilya Gorbunov fe31509044 Support File.readBytes when reported file length is less than actual
After reading 'length' bytes from a file, check if there's extra content
available and read it into a resizable buffer, then append it after
the first 'length' bytes.

#KT-33864
2019-09-28 19:20:54 +03:00
Svyatoslav Kuzmich 7592048437 [JS] Support typeOf 2019-09-25 18:12:55 +03:00
Abduqodiri Qurbonzoda eae6fbad3a Document String.contentEquals overloads difference 2019-09-25 17:43:45 +03:00
Alexander Udalov 25799447a6 Minor, use slightly less internal argument to enable inline classes 2019-09-21 02:03:31 +02:00
Abduqodiri Qurbonzoda 2819ab4ae9 Avoid division in string-to-unsigned conversions (KT-26309) 2019-09-20 01:08:33 +03:00
Abduqodiri Qurbonzoda d66f07a84e CollectionsKt.windowed throws IllegalArgumentException 2019-09-20 00:50:54 +03:00
Abduqodiri Qurbonzoda f01420332f Avoid division in string-to-number conversions (KT-26309) 2019-09-15 21:08:23 +03:00
Abduqodiri Qurbonzoda 11f3c4b03f Clarify the error message when File.copyTo fails (KT-27545) 2019-09-13 21:29:13 +03:00
Ilya Gorbunov 7ff01b02a9 Make ExperimentalTime annotation documented 2019-08-22 21:29:18 +03:00
Ilya Gorbunov 2c79b1f89e Minor: fix incorrect reference in kdoc 2019-08-22 21:29:18 +03:00
Svyatoslav Kuzmich 6e6ffa12a6 [WASM] Initial infrastructure
- New module ":compiler:backend.wasm"
    - Initial compiler infra (driver, phaser, context)
    - Subset of Wasm AST
    - Skeleton of IR -> Wasm AST
    - Wasm AST -> WAT transformer

- Testing infra

- SpiderMonkey jsshell tool
2019-08-22 15:59:54 +03:00
Svyatoslav Kuzmich 812083ee05 [WASM] Initial runtime library
Add directory libraries/stdlib/wasm as a placeholder for WASM runtime library
Copy built-ins from core/builtins
Add ExcludeFromCodegen annotation for internal needs
2019-08-22 15:59:49 +03:00
Ilya Chernikov 0f41dc814f Switch many common tasks defined in buildSrc to lazy creation
also refactor some locally defined tasks to the creation avoidance API
2019-08-21 20:20:08 +02:00
Yanis Batura e9e3df23fc Fix typos and improve grammar in stdlib readmes (#2527)
* Fix typos in the main ReadMe.md

* Fix typos in the stdlib samples ReadMe.md

Co-Authored-By: ilya-g <ilya.gorbunov@jetbrains.com>
2019-08-16 19:56:56 +03:00
Ilya Gorbunov fba22606e6 Introduce erroneous operators ClockMark.minus/compareTo(ClockMark)
To provide a better diagnostic message on their misuse.
2019-08-16 15:29:17 +03:00
Ilya Gorbunov ac07cb686b Change status of ExperimentalTime API to a more risky one 2019-08-16 15:29:17 +03:00
Ilya Gorbunov a985402507 Introduce ClockMark.hasPassedNow, hasNotPassedNow functions
Makes it more clear to use them than comparing elapsed with Duration.ZERO.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov 44195d436e Rename: Clock.markNow, ClockMark.elapsedNow
Add "Now" suffix to the names of functions that depend on the current
time moment.
2019-08-16 15:29:16 +03:00
Ilya Gorbunov a493d46a6e Make effectively private properties actually private to avoid accessors 2019-08-16 15:29:16 +03:00
Ilya Gorbunov f889d25287 Introduce TestClock.plusAssign(Duration) and hide implementation details
TestClock.plusAssign(Duration) is for advancing TestClock time.
Hide reading value, do not allow to provide initial reading,
fix clock unit to nanoseconds at construction time.
2019-08-16 15:28:45 +03:00
Ilya Gorbunov 4de9361c37 Introduce Duration.isPositive method 2019-08-16 15:25:57 +03:00
Abduqodiri Qurbonzoda 63895483fd Fix take method from iterating one extra element (KT-32024) 2019-08-15 01:01:36 +03:00
Abduqodiri Qurbonzoda 01a613dca4 Add tests for floating-point to integral conversion 2019-08-15 00:57:27 +03:00
Abduqodiri Qurbonzoda 432828a2db Clarify floating-point to integral conversion rounding behaviour 2019-08-15 00:57:27 +03:00
Dmitry Petrov a9c961931c JS_IR: Support 'CHECK_NOT_NULL' intrinsic 2019-08-14 11:16:11 +03:00
Alexander Udalov 2baddb029c Use Intrinsics.checkNotNullParameter to throw NPE in parameter null checks
Similarly to previous commits, this method was unused, so we're changing
its semantics in API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov 480313210a Use Intrinsics.checkNotNullExpressionValue to throw NPE in Java null checks
Similarly to previous commit, this method was unused since its
introduction before 1.0, so we're changing its semantics to throw NPE
and starting to use it with API version >= 1.4.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Alexander Udalov a7c8fdcbe2 Use Intrinsics.checkNotNull and throw NPE in !! operator generation
This method was introduced in c204e8fc67 "just in case" and was never
used. Therefore we're free to change its semantics and use it in all new
generated code (with API version >= 1.4), without even worrying that the
newly used API will leak from inline functions in stdlib when used with
an older API version. Since we agreed to change the type of thrown
exceptions to java.lang.NPE in KT-22275, invoke a new method
throwJavaNpe now which throws that exception instead of KNPE.

Note that the additional method that takes an exception message is still
unused and exists just in case we need to use it in the future. The new
method throwJavaNpe is public also "just in case" we need to invoke it
in the future; currently it's not invoked from the bytecode.

 #KT-22275 In Progress
2019-08-12 16:09:23 +02:00
Abduqodiri Qurbonzoda 84971d2003 Mention union in intersect documentation and vice versa (KT-26212) 2019-08-12 01:15:20 +03:00
Ilya Gorbunov ebb59d51d2 Fix incorrect Double.toLong conversion for infinite values in JS
#KT-33225 Fixed
2019-08-09 11:49:28 +03:00
Ilya Gorbunov 65b0a5f903 Unify withIndex docs wording 2019-08-01 19:55:36 +03:00