Commit Graph

436 Commits

Author SHA1 Message Date
Alexey Andreev 8b9852edec JS: remove Kotlin.createClass/definePackage/etc functions from stdlib. Reimplement some classes in Kotlin 2016-11-23 12:13:54 +03:00
Ilya Gorbunov 50cd620f92 Remove java.util.* imports from common code. 2016-11-21 18:20:33 +03:00
Ilya Gorbunov 87c9d4e84e Introduce unsafeCast function. Provide more JS-idiomatic emptyArray() implementation.
#KT-14034 Fixed
2016-11-19 03:37:47 +03:00
Ilya Gorbunov 1defc10add Minor fix: pass message to superconstructor of NoSuchElementException 2016-11-18 19:12:05 +03:00
Ilya Gorbunov 0dbaf2a605 Make toTypedArray reified again and thus inline, rewrite copyToArray and copyToArrayImpl in kotlin. 2016-11-18 19:12:05 +03:00
Ilya Gorbunov 698bc7bd31 Internal visiblity for hacks.kt declarations.
Explicit public visibility.
2016-11-18 19:12:05 +03:00
Zalim Bashorov aa2a4f0794 KJS: implement Throwable in Kotlin instead of use it as alias of JS Error
* Make it an inheritor of JS Error. Otherwise, Chakra engine doesn't fill stack trace of exception; In other engines inheritance has some good effects too.
* Copy all properties from internally created instance of JS Error

 #KT-6985 Fixed
 #KT-2328 Fixed
 #KT-8019 Fixed
 #KT-10911 Fixed
2016-11-17 16:22:27 +03:00
Zalim Bashorov 1f4d95eaa7 Minor: rename kotlin.kt -> Enum.kt 2016-11-17 16:22:26 +03:00
Ilya Gorbunov b556adf8db Move/alias Appendable and StringBuilder to kotlin.text
#KT-2084
2016-11-16 18:47:42 +03:00
Ilya Gorbunov fae5c88f22 Remove java.util references from the common code 2016-11-16 18:47:42 +03:00
Ilya Gorbunov 63535393e7 Move Comparator to kotlin.comparisons and make it imported by default.
#KT-2084
2016-11-16 18:47:42 +03:00
Anton Bannykh b185715aeb Removed reified to fix the bootstrap. The @library annotation prevents from making the function inline. 2016-11-15 16:50:58 +03:00
Ilya Gorbunov 5f7d779370 Introduce KotlinVersion API
#KT-14789
2016-11-15 16:38:52 +03:00
Alexey Andreev 5ef8879aae JS: fixes after code review 2016-11-11 16:26:39 +03:00
Alexey Andreev 8eca8efae5 JS: fix some bugs:
1. Fix translation of FQN in inline lambdas
2. Fix StringBuilder.length
3. Workaround order of declaration of names for imported declarations
2016-11-11 16:26:35 +03:00
Alexey Andreev 06476402a2 JS: support enums in flat JS structure 2016-11-11 16:26:33 +03:00
Alexey Andreev 20396b0e5f JS: fix inlining in a new flat JS generator 2016-11-11 16:26:32 +03:00
Alexey Andreev e13d34e08d JS: rewrite stdlib to compile with new flat structure 2016-11-11 16:26:31 +03:00
Ilya Gorbunov 8feaaf4df0 Allow to annotate generated API with SinceKotlin and annotate new array functions. 2016-11-08 18:08:59 +03:00
Ilya Gorbunov dceec89572 JS: Array.toString is const, Array.contentToString is shallow, Array.contentDeepToString is deep and self-reference aware
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov f3da656d6e contentEquals, contentHashCode, contentToString: Add js implementation and tests
#KT-13582
2016-11-08 17:23:45 +03:00
Ilya Gorbunov ab2facf030 Remove special source generation for js stdlib, use same template, rename generated file. 2016-11-08 17:23:45 +03:00
Ilya Gorbunov a067888fed Provide no-op members in JS ArrayList to work with capacity.
#KT-14637
2016-11-07 21:58:43 +03:00
Ilya Gorbunov 660dc94f7c Move Closeable to its usage, move internal Serializable to kotlin package in JS, introduce internal typealias in kotlin.io in JVM. 2016-11-07 21:39:36 +03:00
Ilya Gorbunov a895702730 Remove js classes that should not be there 2016-11-07 21:35:27 +03:00
Alexander Udalov 3db459c1d8 JS: drop Collections.reverse and java.util.Collections altogether 2016-11-07 12:27:54 +03:00
Alexander Udalov e8fecea871 JS: drop Collections.max 2016-11-07 12:27:52 +03:00
Alexander Udalov 316fbd820b JS: drop Collections.sort 2016-11-07 12:27:13 +03:00
Alexander Udalov 30a7790dca Minimize references to java.util.Collections in stdlib sources
Only three usages are left in platform-independent code: in reverse, sort and
sortWith for mutable lists
2016-11-07 12:20:14 +03:00
Alexander Udalov b52f67132e Fix some warnings in JS-specific stdlib sources 2016-11-07 12:20:14 +03:00
Alexander Udalov 52511845fc Minor reformat in JS libraries + remove commented out code 2016-11-07 12:20:14 +03:00
Zalim Bashorov 5f2ba70745 KJS: use cached KClass instead create new each time when getting it from JsClass 2016-10-18 13:26:05 +03:00
Zalim Bashorov a085df914f KJS: allow to use KClass::isInstance; implement isInstance in KClassImpl 2016-10-18 13:26:05 +03:00
Zalim Bashorov 11b2c5fe59 JS: change visibility to internal for library and marker annotations 2016-10-14 19:44:57 +03:00
Zalim Bashorov 3c520a3ce3 JS backend: basic support for class literals.
Added:
* the ability to get KClass using class literals (`::class`);
* the ability to get KClass from JsClass and vice versa;
* the ability to get simpleName.

 #KT-13345 Fixed
2016-10-14 19:44:53 +03:00
Zalim Bashorov d31f18137d JS: make Any as upper bound of type parameter of JsClass and helpers 2016-10-14 19:40:35 +03:00
Ilya Gorbunov e6887ea4e5 Use abstract readonly collections as base classes for implementing collection properties of regex MatchResult 2016-10-14 19:06:25 +03:00
Alexey Andreev 4e2b1d68cf KT-2752: deprecate parameter of @native annotation, prohibit simultaneous usage of parameterized @native and @JsName 2016-10-08 19:25:42 +03:00
Alexey Andreev 725d13b72e KT-2752: fix JsName with explicit use target. Add some tests for JsName with use targets 2016-10-08 19:25:33 +03:00
Alexey Andreev 6e1a0901ac KT-2752: add checkers for inconsistent usage of JsName 2016-10-08 19:25:31 +03:00
Alexey Andreev 5e3aa33b13 KT-2752: add draft implementation of JsName annotation. Fix some tests using the annotation 2016-10-08 19:25:27 +03:00
Ilya Gorbunov 282629f618 Remove overrides of equals and hashCode from AbstractCollection and AbstractMap.values, making the equality referential again. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov 976260bda6 Fix state check in ListIterator.set, improve diagnostics. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov 8627547a63 Provide java.util.AbstractCollection and AbstractList as deprecated classes with implemented abstract methods rather than as typealiases to smooth migration.
This comes at price that `ArrayList is java.util.AbstractColleciton` is false.
2016-09-28 22:06:03 +03:00
Ilya Gorbunov ec6dbe7441 JS: use read-only AbstractList as a base class for read-only collection implementations. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov 7dde8df9ae Make mutation methods in AbstractMutable-collections abstract rather than implement them unsupported. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov 74e964aabe Rename files to match class names. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov f88a009653 Do not recreate entries, keys and values collections on each access to property. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov c6654fc9d8 Remove unused/redundant implementation details. 2016-09-28 22:06:03 +03:00
Ilya Gorbunov 38f030dce4 Split AbstractMap into readonly and mutable. 2016-09-28 22:06:03 +03:00