Commit Graph

2666 Commits

Author SHA1 Message Date
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
Ilya Gorbunov 3751a8a797 Common Array.fill for unsigned arrays, improve docs, native impl name
KT-32359
2019-08-01 19:02:39 +03:00
Jake Wharton 1a6069382e Provide Array.fill in common stdlib
KT-32359
2019-08-01 19:02:38 +03:00
Ilya Gorbunov 695d657ca8 Random.nextLong: use progression properties consistently
Apply inspection suggestion that helps to reduce boxing.
2019-07-31 21:53:16 +03:00
Ilya Gorbunov 945e058586 Document return value of removeAll and retainAll with predicate
#KT-32532 Fixed
2019-07-17 14:27:26 +03:00
Ilya Gorbunov 4fc942c5e9 KT-16602: Improve mutable sorting samples, fix sample references 2019-07-12 21:34:54 +03:00
Dat Trieu 38d26b1d92 KT-16602: Provide samples for sorting API usage 2019-07-12 21:32:03 +03:00
keijumt 3f5d64e635 Add sample of hashMapOf 2019-07-12 17:10:15 +03:00
Pavel Semyonov 2577dfa06a docs: added KDoc for Comparator, fixed KDoc for comparison binarySearch() 2019-07-12 16:08:37 +03:00
Abduqodiri Qurbonzoda 96dcafdf35 Document order of array elements initialization (KT-32353) 2019-07-11 21:18:47 +03:00
Ilya Gorbunov 7d14fb756d Make Duration storageUnit inline val to avoid state initialization
Avoid state initialization in JS and Native
2019-07-09 20:39:28 +03:00
Roman Artemev d4fb76c1da [JS IR BE] Fix overriding property of Throwable 2019-07-09 10:40:01 +03:00
Ilya Gorbunov 7573fcde53 Demote new experimental capitalize overloads in overload resolution
Revert "Fix method reference ambiguity in test after introducing 'capitalize' overload"
This reverts commit fe9bd9ee
2019-07-09 03:39:25 +03:00
Ilya Gorbunov 686bcb830e Bit query and bit rotation functions for UInt, ULong, UShort, UByte
#KT-12749
2019-07-08 19:09:32 +03:00
Ilya Gorbunov 39bdf34b9f Use common implementation of fastLog2 based on countLeadingZeroBits 2019-07-08 19:09:32 +03:00
Ilya Gorbunov f8724654a1 Bit query and bit rotation functions for Int, Long, Short, Byte
#KT-12749
2019-07-08 19:09:32 +03:00