Ilya Gorbunov
7977b6cdb8
Implement DurationUnit in JS, add doc summary and conversion test
2019-06-18 03:59:51 +03:00
Ilya Gorbunov
37c5f2c54f
Initial prototype of Duration and Clocks API
2019-06-18 03:59:51 +03:00
Roman Artemev
1f70284b18
[JS IR BE] Fix charSequenceLength function for JS IR
2019-06-17 18:10:53 +03:00
Ilya Gorbunov
a1979677d0
Docs: mark all experimental annotations as MustBeDocumented
...
So that they are shown in the docs of annotated experimental API
2019-06-15 16:37:45 +03:00
Kevin Peek
4c91ba90bb
Add links to Scope Functions docs (PR #2407 )
...
Add links to Scope Functions docs on kotlinlang.org to 'with', 'run', 'let', 'apply', and 'also' extension function docs
2019-06-13 20:49:38 +03:00
Alexander Udalov
fec9ee6408
Minor, add kdoc for typeOf
2019-06-07 00:29:35 +02:00
Abduqodiri Qurbonzoda
37dfbb3eba
Workaround unpaired surrogates replacement with ? (KT-31614)
2019-06-04 21:25:41 +03:00
Ilya Gorbunov
8badfca459
Fix titlecase lowering in decapitalize
...
Replace isUpperCase() with !isLowerCase check to lower both
upper- and titlecased first chars.
2019-05-29 03:54:46 +03:00
Ilya Gorbunov
a921bd04e0
capitalize/decapitalize: improve docs, add one test
2019-05-29 03:54:46 +03:00
Jake Wharton
af31794f60
Add Locale-accepting overloads for (de)capitalize in JDK stdlib
...
#KT-28933 fixed
2019-05-29 03:35:33 +03:00
Eduard Wolf
c885cadde4
KT-31639: Fix Iterables.drop integer overflow
2019-05-27 23:07:14 +03:00
Svyatoslav Kuzmich
142c9e2a8b
[JS RUNTIME] Workaround invalid IR in ArraySorting
2019-05-24 11:50:47 +03:00
Svyatoslav Kuzmich
a3677d6fc0
[JS IR RUNTIME] Fix types in kotlin.js.captureStack
2019-05-24 11:50:47 +03:00
Svyatoslav Kuzmich
ec34cdaae9
[JS STDLIB] Fix: Object.keys() returns list of strings
2019-05-24 11:50:46 +03:00
Roman Artemev
9c7d47789c
[JS IR BE] Implement type check for SuspendFunctionN
2019-05-22 15:18:13 +03:00
Svyatoslav Kuzmich
b8bbcb3f93
[JS IR BE] Copy type metadata for Boolean, Char and Long varargs
2019-05-21 19:19:31 +03:00
Benjamin Orsini
3e39f26379
Add map() documentation sample
...
* docs: add map() sample
* docs: add samples for Map and CharSequence
* docs: add another sample for Maps.map()
2019-05-20 19:20:09 +03:00
Roman Artemev
cd3fd60dd7
[JS BE] Extract backend specific code from shared stdlib sources
2019-05-16 19:27:41 +03:00
Svyatoslav Kuzmich
23a214710b
[JS IR BE] Add Unit return type to function signature
2019-05-15 14:09:02 +03:00
pyos
683f8417d3
Add a common JVM/JS lowering for Array(size, function)
...
and remove the hack from JVM_IR codegen that replaces this call with
hardcoded inline function bytecode.
(cherry picked from commit 4a29e3cfcf )
2019-05-09 11:54:18 +02:00
max-kammerer
e74e0ea013
Revert "Add a common JVM/JS lowering for Array(size, function)"
...
This reverts commit 4a29e3cfcf .
2019-05-09 11:49:34 +02:00
pyos
4a29e3cfcf
Add a common JVM/JS lowering for Array(size, function)
...
and remove the hack from JVM_IR codegen that replaces this call with
hardcoded inline function bytecode.
2019-05-09 08:03:18 +02:00
Ilya Gorbunov
2c26dc3af6
Add simplified overloads of String<->ByteArray/CharArray conversions
...
These overloads cover the most common cases of conversion of the entire
String or Byte/CharArray, avoiding extra index check and branching.
#KT-24810, KT-29265
2019-05-08 02:58:57 +03:00
Svyatoslav Kuzmich
e3bcabeae3
[JS IR] stdlib: Fix bugs in Long.toString(radix)
2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
bc29a5b15c
[JS IR] stdlib: port methods that use bit representation of numbers
...
- Port part of 'misc.js' from current backend to 'bitUtils.kt' in IR backend
- Enable toBits, toRawBits, fromBits extension function on Double and Float
- Enable Double.withSign
- Refactor getNumberHashCode using new utils
2019-05-07 21:49:12 +03:00
Svyatoslav Kuzmich
362fbc8770
[JS IR] stdlib: Use comparator in CharArray.sort
...
CharArray is represented as a regular JS Array. Its default sort order is based
on string representation of elements.
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
179acf0789
[JS IR] stdlib: generate type-safe contentToString for primitive arrays
...
Avoid casting 'primitive' arrays to Array<*> because they fail on runtime
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
7687985442
[JS IR] Stdlib: use total-order comparasion for content equals
2019-05-07 21:48:50 +03:00
Svyatoslav Kuzmich
3a506a372b
[JS IR] stdlib: Use Nothing in return type of THROW helpers
...
Backend generated calls to those helpers inside expression which
resuleted in invalid type casts in IR (in dead code).
2019-05-07 21:48:50 +03:00
Abduqodiri Qurbonzoda
c8a4fa58cd
Implement String to/from ByteArray conversion (KT-24810)
2019-05-06 15:54:28 +03:00
Abduqodiri Qurbonzoda
81d2d3cb6a
Implement String to/from CharArray conversion (KT-29265)
2019-05-06 15:54:28 +03:00
Ilya Gorbunov
5f2762ed20
Follow up: fix typos in coroutine docs
2019-05-01 05:40:35 +03:00
Svyatoslav Kuzmich
87415cb769
[JS IR] Help IDEA: Copy stdlib sources instead of sharing
2019-05-01 00:28:36 +03:00
Yanis Batura
a51b7fb8d0
Fix typos
2019-04-30 18:42:07 +03:00
Svyatoslav Kuzmich
379cb08226
[JS] Reduce usage of 'js' function in stdlib
...
Function 'kotlin.js.js' is to be redesigned in JS IR backend,
partially because it is a hard feature to support.
Current implementation is unstable and can cause problems around
inlining and name generator. Luckily most of its use-cases
can be covered by simpler features like dynamic expressions and
external declarations.
Thus we are reducing it's usage in stdlib to make IR backend more
stable in current state. JavaScript features that can't be covered by dynamic expression are
implemented in 'jsOperators.kt' file respectively for each backend:
- 'internal inline' function which calls 'js' function inside for current
pre-IR backend
- 'internal' function with '_hack' parameters for JS IR backend which will be
later intinsicified in a compiler
2019-04-30 15:27:19 +03:00
Roman Elizarov
1e5d973bb1
Fix CoroutineContext documentation with respect to equality
...
KT-26398 had updated behavior from reference comparison to regular
equality, but the documentation for CoroutineContext was left out.
The whole "by reference" needs to be removed, because it now
follows default behavior of all Kotlin collections and need no
further clarification.
2019-04-29 16:33:22 +03:00
Svyatoslav Kuzmich
13b332e99e
Build scripts for JS IR versions of stdlib and kotlin.tests
2019-04-26 20:14:12 +03:00
Svyatoslav Kuzmich
5da83889d9
Stdlib tests: Supporess NoInfer access instead of redeclaration
...
Stdlib annotation 'kotlin.internal.NoInfer' was redeclared in stdlib tests
so non-fried modules (kotlin-stdlib-jdk7, kotlin-stdlib-jdk8, etc.)
could access it.
IR deserializer does not support declaration duplicates (at least yet
for JS IR backend). Thus this commit removes this redeclaration and
suppresses errors on its usages instead.
2019-04-26 20:14:03 +03:00
Svyatoslav Kuzmich
09d7f4015b
Move test.kt stubs to smallRuntime
...
We already use kotlin.test with fullRuntime klib.
2019-04-24 13:06:59 +03:00
Svyatoslav Kuzmich
b0bd5802bb
Remove optionalExpectation hacks
...
Add common sources to Generate IR Runtime
2019-04-24 13:06:58 +03:00
nikita.movshin
deb416484c
Update copyright. Fix 2 lines comments after rebase
...
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
2019-04-23 20:15:03 +03:00
nikita.movshin
abb7d3ab46
Update copyright.
...
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update 2 lines comment
2019-04-23 20:09:27 +03:00
nikita.movshin
65244b4bea
Update copyright.
...
Change the copyright from "JetBrains s.r.o." to
"JetBrains s.r.o. and Kotlin Project contributors"
Update only 2 lines copyright.
2019-04-23 20:09:22 +03:00
Svyatoslav Kuzmich
b1d303b027
Reorganize stdlib-js sources specific to the current JS backend
...
Move kotlin-stdlib-js project and the sources specific to the current backend to 'stdlib/js-v1' directory,
but leave sources that can be shared with the new IR backend in the common 'stdlib/js' location
with exception for 'stdlib/js/src/generated', which is used exclusively for current backend.
This simplifies sourceset configuration when building stdlib with the new backend.
2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
d7be91e8a4
[JS IR BE] Add SIZE_BYTES and SIZE_BITS to Long and Char
2019-04-22 20:30:57 +03:00
Svyatoslav Kuzmich
3fd55673a8
[JS IR BE] Workaround for println
...
IR backend has a bug in decomposition of dynamic calls.
Workaround: don't use inline function call inside dynamic call argument.
2019-04-22 13:18:00 +03:00
Abduqodiri Qurbonzoda
3f08753f87
Move string-related files to text directory
2019-04-19 03:51:20 +03:00
Svyatoslav Kuzmich
977d3ef840
[JS IR BE] New name generator
2019-04-13 14:19:36 +03:00
Svyatoslav Kuzmich
38fc4b0c59
[JS IR BE] Hack irRuntime js function usage to compensate for implementation shortcomings
2019-04-13 14:17:59 +03:00
Anton Bannykh
b7ffdb9fde
JS IR: support kotlin.test
2019-04-05 12:30:21 +03:00