Commit Graph

223 Commits

Author SHA1 Message Date
Anton Bannykh b7ffdb9fde JS IR: support kotlin.test 2019-04-05 12:30:21 +03:00
Ilya Gorbunov 04bbf23936 Add explicit imports of kotlin.ranges more specific functions
The extensions 'contains' and 'reversed' from kotlin.ranges can be more
specific for IntRange, LongRange, etc than the same functions from
kotlin.collections, yet they lose in overload resolution to the latter
ones when invoked from kotlin.collections package
because of same package package extensions are preferred (KT-30633).
2019-04-02 21:28:33 +03:00
Sergey Rostov fb3f28974e Build: support local.properties for JPS build. Apply JPS related tweaks only inside IDEA import. 2019-03-28 10:06:16 +03:00
Ilya Gorbunov b74fe7c1c3 Clarify floor and ceil docs (KT-30418) 2019-03-19 03:12:12 +03:00
Ilya Gorbunov b0a234ec74 Minor: collection docs formatting 2019-03-19 03:12:09 +03:00
Abduqodiri Qurbonzoda a369496aca Throw IOOB on invalid index in JS StringBuilder.get to adhere contract 2019-03-15 17:40:31 +03:00
Abduqodiri Qurbonzoda ba61695a45 Check for index-out-of-bound in elementAt function (KT-30051) 2019-03-12 21:39:09 +03:00
Ilya Gorbunov db4c4132f6 Make JvmPackageName a common internal annotation 2019-03-08 23:35:37 +03:00
Abduqodiri Qurbonzoda fc85781bfc Implement asList, slice & sliceArray extension functions for UArrays 2019-03-08 23:34:34 +03:00
Roman Artemev 0ec75f1534 [JS IR BE] Temporary fix K/JS stdlib 2019-03-04 23:24:14 +03:00
Svyatoslav Kuzmich a01407eec9 [JS IR BE] Don't mangle Any::equals method 2019-02-28 20:13:56 +03:00
Svyatoslav Kuzmich c4ffe36a21 [JS IR BE] Add CharSequence type check 2019-02-25 15:09:25 +03:00
Ilya Gorbunov 8f6d73fd32 Use JS stdlib merger from bootstrap compiler 2019-02-22 21:22:19 +03:00
Kevin Peek 565727e302 KT-20357 - Add sample for Regex.findAll() 2019-02-18 21:05:46 +03:00
Vyacheslav Gerasimov 14d9ec9fb2 Build: Use javadocJar helper to specify artifact explicitly
Creating javadocJar task for every project produces lots of unnecessary
tasks, some project don't even have code. Jar task without outDir
property set fails idea import with gradle 5.0+
2019-02-18 19:59:36 +03:00
Svyatoslav Kuzmich 53d15ea27c [JS IR BE] Fix arrays type checks 2019-02-12 18:45:34 +03:00
Svyatoslav Kuzmich c9e2ed4e1f Undo unnecessary changes to stdlib
Partially revert "[stdlib] Reduce usage of extension functions"
2019-01-29 19:06:32 +03:00
Svyatoslav Kuzmich b239c80531 [JS IR BE] Add a few kotlin.test stubs to IR runtime 2019-01-29 19:06:31 +03:00
Svyatoslav Kuzmich 2818d3767e [JS IR BE] Covert Char into inline class 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich a5f537adc5 [JS IR BE] Implement *Array.plus(Collection<>) in typed Kotlin without dynamic helper 2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich 8c89ffbe2d [JS IR BE] Load builtins from code to runtime
Bypass builtins deserialization mechanism in legacy JS backend and load
bultins direcly as kotlin code.

This way we won't have separated IR declarations for Enum, Char, Long

Some "native" builtins are implemented in libraries/stdlib/js/irRuntime/builtins/
Other builtins are moved by MoveExternalDeclarationsToSeparatePlace and
used only in compile-time
2019-01-24 23:05:56 +03:00
Svyatoslav Kuzmich 29eb3c745c [JS IR BE] Support two versions of test runtime: full and reduced 2019-01-24 16:14:40 +03:00
Svyatoslav Kuzmich eea7e85d3a [stdlib] Reduce usage of extension functions 2019-01-24 16:14:40 +03:00
Ilya Gorbunov 0ac85ad715 Document that sorting is stable in each platform
#KT-12473 Fixed
2019-01-17 18:38:37 +03:00
Ilya Gorbunov 56672c2564 Ensure stable sorting in MutableList.sort/sortWith
MutableList.sortWith now works correctly in JS_IR backend too

#KT-12473
2019-01-17 18:38:23 +03:00
Ilya Gorbunov 23950042f6 Clarify how elements of arrays are compared by contentEquals function
Add clarification only for the particular group of overloads including
 arrays of object and floating point numbers.

#KT-22942 Fixed
2019-01-11 21:04:03 +03:00
Ilya Gorbunov 51eb21d44b Provide stable sorting when JS engine sorting doesn't look stable
#KT-12473
2019-01-11 20:53:29 +03:00
Ilya Gorbunov 7c3c454654 Remove specialization of toTypedArray for LongArray and BooleanArray in JS
The default implementation for primitive arrays returns an array of correct type.

#KT-29187 Fixed
2019-01-11 20:53:29 +03:00
Roman Artemev d35b20f764 [JS IR BE] Implement private members lowering to extract private methods from class and transform them into static function
* fix kotlin.Long
 * update tests
2019-01-11 20:28:04 +03:00
Ilya Gorbunov fcef876c7e Update copyright in generated stdlib sources 2019-01-11 19:23:12 +03:00
Ilya Gorbunov 30c769c19a Avoid hitting max argument limit in String(chars)
Rewrite CharArray to String conversions to appending chars one by one.

Refine parameter checking in String(chars, offset, length) to adhere to
the common exception contract and document it.

#KT-29003
2019-01-10 23:35:52 +03:00
Shagen Ogandzhanian 6dd69ea3d6 Support named constructors in idl-backed code generation
this resolves https://youtrack.jetbrains.com/issue/KT-27361
2018-12-21 14:53:59 +01:00
Shagen Ogandzhanian ca4521d57d Support ClipboardEvent in definitions generated from idl 2018-12-18 15:07:34 +01:00
Shagen Ogandzhanian 44af5b783f Introduce TrackEvent, MediaStreamTrackEvent-related IDL definitions 2018-12-18 12:19:12 +01:00
Shagen Ogandzhanian c1f75d2324 Introduce idl definition for SVGMaskElement 2018-12-17 16:11:22 +01:00
Shagen Ogandzhanian 714b4f25c0 Introduce better typing for on[event-name] attributes from idl
see https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2548
2018-12-14 13:17:41 +01:00
Shagen Ogandzhanian 44da3c89b7 Introduce PointerEvent-related definitions
* Resolves https://youtrack.jetbrains.com/issue/KT-23932
 * Backed by review https://upsource.jetbrains.com/kotlin/branch/KT-23932-POINTER-EVENT-FROM-REMOTE-IDL
2018-12-12 14:53:18 +01:00
Shagen Ogandzhanian 1f0bca12e1 Leave undefined values for undefined params in idl-generated code unassigned
https://upsource.jetbrains.com/kotlin/review/KOTLIN-CR-2535
2018-12-07 16:05:00 +01:00
Vyacheslav Gerasimov 508fe28781 Build: Add NoDebugJavaExec to filter out debugger arguments added by Idea
Workaround for IDEA-200192:
IDEA makes all JavaExec tasks not up-to-date and attaches debugger making our breakpoints trigger during irrelevant task execution
2018-12-05 16:23:25 +03:00
Shagen Ogandzhanian b154d10cc5 Merge pull request #2013 from JetBrains/KT-16305-MUTATION_OBSERVER_INIT
Skip assignment for null-value ArrayLike object in idl-based generate…
2018-12-04 20:33:24 +01:00
Vyacheslav Gerasimov 17a60e3fd3 Build: use UtilityJavaExec task for compileJs and generateVisitors 2018-12-04 15:38:56 +03:00
Shagen Ogandzhanian 8294309e5b Skip assignment for null-value ArrayLike object in idl-based generated code 2018-12-04 12:44:43 +01:00
Roman Artemev c5922bf74b Refact stdlib generator, add support for different backends
[JS IR BE] Runtime fixes
 * Do not generate external declarations for IR BE
 * Move `arrayToString` helper function out of shared JS stdlib
 * Fix arrays type check for IR BE
2018-11-29 22:04:53 +03:00
Ilya Gorbunov d7ff6c48ea Leave only 1.3 JS IR runtime sources
Update exclusions after merging coroutines sources into stdlib.
2018-11-28 06:05:03 +03:00
Ilya Gorbunov 5c94ef229b Move release coroutines sources into the corresponding stdlib sourcesets 2018-11-28 06:05:03 +03:00
Ilya Gorbunov ec3692026d Rename coroutines sourceset to coroutinesExperimental
Restore experimental coroutine tests as they were before e22ca022
and compile and run them twice:
 - first time with LV=1.2
 - second time with LV=1.3
2018-11-28 06:05:02 +03:00
Ilya Gorbunov cff32e46bb Provide expect declarations for String.startsWith/endWith overloads
Mark the existing declarations as actual.
2018-11-22 19:17:24 +03:00
Ilya Gorbunov 7d3de70754 Correct replacement for js Math.log
The correspondent kotlin.math function is ln(x)

#KT-28251 Fixed
2018-11-17 00:20:54 +03:00
Ilya Gorbunov 5f4e8bf4fb Correct abstract mutable collections declarations in kotlin-stdlib-common
Add SinceKotlin(1.3) to the new and substantially changed common declarations

#KT-28091
2018-11-09 13:39:44 +03:00
Ilya Gorbunov b026b9eb22 Remove +ReleaseCoroutines explicit feature enabling
It's enabled by default in Kotlin 1.3
2018-11-09 04:00:26 +03:00