Commit Graph

3380 Commits

Author SHA1 Message Date
Sergej Jaskiewicz 6dc69adcc9 [JS IR] Don't mark Char as a value class
Char will still be treated as a value class
(see JsInlineClassesUtils.kt)
2021-12-16 12:46:11 +00:00
Ilya Gorbunov a829a6743d KT-50173 Fix Regex.escapeReplacement function in JS 2021-12-12 00:27:31 +00:00
Mikhael Bogdanov 239e79a241 JvmDefaultWithCompatibility. Update documentation 2021-12-09 07:40:07 +01:00
Igor Yakovlev 72e360be83 [WASM] More optimal way to keep regex decomposition table 2021-12-09 00:57:55 +01:00
Mikhael Bogdanov 8c17d5f5a7 JvmDefaultWithCompatibility. Switch retention to source 2021-12-08 12:25:02 +01:00
Dmitry Petrov 93713a9ad4 JVM_IR KT-47939 use FunInterfaceConstructorReference as base class 2021-12-08 14:12:41 +03:00
Dmitry Petrov 9eeb8f54fb JVM_IR KT-47939 fixes after review 2021-12-08 14:12:39 +03:00
Dmitry Petrov e179598457 JVM_IR KT-47939 equality for fun interface constructor references 2021-12-08 14:12:38 +03:00
Ilya Goncharov 2a1396bafe [JS IR] Remove JsEagerInitialization after bootstrap update 2021-12-08 10:42:50 +00:00
Ilya Goncharov 0c74376cc4 rra/ilgonmic/after-test-promise
[JS] Node downloading for js ir integration kotlin test

[JS] Fix API of Promise

[JS IR] Promise symbol as lazy2

[JS] Support legacy compiler aftertest with promises

[JS IR] Generate finally for promised tests

[JS] Setup it tests for JS IR kotlin-test

Merge-request: KT-MR-5168

^KT-49738 fixed
2021-12-08 08:22:53 +00:00
Igor Yakovlev ea060dcf8a [WASM] Implement lazy with UnsafeLazyImpl 2021-12-07 21:33:34 +03:00
Igor Yakovlev d55e16a030 [WASM] Regex std implementation 2021-12-07 21:33:31 +03:00
Igor Yakovlev 86daff8ae8 [WASM] Fix invalid exception type for IOOB array access 2021-12-07 21:33:24 +03:00
Igor Yakovlev 34c6abe0bd [WASM] Add Long.toString(radix) implementation 2021-12-07 21:33:14 +03:00
Igor Yakovlev 73ca478fbd [WASM] Add string to double conversion to Stdlib
This version is not completely correct - there is some IEEE rouding issue that, apparently, require to implement different algorithm with BigIntegers implementation.
2021-12-07 21:33:07 +03:00
Igor Yakovlev 9408499da9 [WASM] Add std text implementations 2021-12-07 21:32:59 +03:00
Mikhael Bogdanov ea58c858d1 JvmDefault. Support @JvmDefaultWithCompatibility annotation
#KT-48217 Fixed
2021-12-06 14:20:24 +01:00
Ilya Gorbunov eba6a4a000 KT-44089 Reflect Android SDK version to determine whether platform implementatoins are eligible
SDK version sanity check, suppress all reflection errors, duplicate SDK reflection code for more robustness
2021-12-06 12:24:45 +03:00
Ilya Gorbunov fe77046fe4 KT-44089 Try to use all known PlatformImplementation classes in Android
Currently platform method implementations loaded are limited by the
java.specification.version system property value, however that property
always returns 0.9 in Android.
2021-12-06 12:24:43 +03:00
Ilya Gorbunov 9c90d4e471 KT-50033 Add missing public API packages to module-info and setup a test
The test checks that new packages are not accidentally non-exported,
so each new stdlib package must be either exported or specified in that
test's expected non-exported package list.
2021-12-06 00:58:51 +00:00
Ilya Gorbunov 64c3aef7ab Reduce the chance shuffle produces an identical permutation in test 2021-12-02 20:58:53 +03:00
Dmitry Petrov d5da130d4b KT-47939 FunInterfaceConstructorReference 2021-12-02 20:28:06 +03:00
Anastasiya Shadrina e3f987459c [PSI, FE] Support functional types 2021-12-02 20:24:11 +03:00
Sergej Jaskiewicz 86cabf3bb7 [JS IR] Use Uint16Array as CharArray's storage 2021-12-02 12:39:41 +00:00
Sergej Jaskiewicz 67dfe7bed1 [JS IR] Make Char a value class (again)
#KT-35100 Fixed
2021-12-02 12:39:40 +00:00
Sergej Jaskiewicz 599f705842 [stdlib] Make @LowPriorityInOverloadResolution applicable to ctors 2021-12-02 12:39:40 +00:00
Sergej Jaskiewicz e13b6b2a90 [JS IR] [runtime] Remove valueOf method from Long
This method was used for coercing `Long` values to JavaScript
`number`. However, it caused issues when `Long` values were
concatenated to a string (see KT-8666, KT-26706).
2021-12-01 12:36:34 +00:00
Pavel Kunyavskiy 9b366af38b [K/N] Fix String.compareTo on unicode strings
^KT-49873
2021-12-01 07:51:27 +00:00
Ilya Gorbunov 4386a800c8 KT-49721 Avoid matching from the same position after a zero-width match
In JS, RegExp can return a match before the specified start index,
if it has matched at that index, but it is in the middle of a surrogate
pair. Account for that when advancing to the next position after
a zero-width match so that it doesn't get to the middle of SP.
2021-11-29 17:02:06 +00:00
Artem Kobzar 08b0e17d47 feat(polyfills): use stdlib for js polyfills. 2021-11-26 08:14:34 +00:00
Pavel Punegov 0249b7ed74 [K/N] Stdlib: warnings as errors
Fix or suppress warnings in Native stdlib.
2021-11-25 08:08:38 +00:00
Ilya Gorbunov d7c31fbe82 Disregard PlatformImplementation class loaded from parent classloader
Such type cannot be cast to a base type, if the former is loaded from
a different, parent classloader.

#KT-47857 Fixed

Co-authored-by: Aleksei.Cherepanov <aleksei.cherepanov@jetbrains.com>
2021-11-24 01:59:48 +03:00
Ilya Goncharov f48436b35e rra/ilgonmic/eager-like-native
[JS IR] Leave JsEagerInitialization until bootstrap update

[JS IR] Fix js stdlib api

[JS IR] Change annotation on eager initialization in sources

[JS IR] Make eager initialization consistent with native

Merge-request: KT-MR-5030
2021-11-22 12:45:37 +00:00
Dmitry Petrov 77dde26c7c JVM KT-48944 improve performance of FunctionReference#equals
'getOwner()' computes KDeclarationContainer for function references,
which can be costly. Compare other FunctionReference properties first.
2021-11-20 10:31:07 +03:00
Roman Artemev 7f27ebc589 [JS IR] Add API to js runtime to throw linkage errors 2021-11-19 01:16:35 +03:00
Anton Bannykh ee6d3ea281 [JS IR] mark coroutine intrinsics as inline
They are de-facto inlined, but their bodies don't get
loaded when using the "no bodies except for inline functions"
deserializtion mode.
2021-11-19 00:39:06 +03:00
Svyatoslav Kuzmich f833fc4bcb [Wasm] Default parameter values for external functions
+ import top-level external functions wrapped in lambdas
2021-11-17 19:28:14 +00:00
Alexander Udalov 850d76f6bf Remove error on annotated types as arguments to typeOf
Instead, document that `KType.annotations` returns an empty list for
types created with `typeOf`. Annotations might be supported in the
future.

 #KT-49573 Fixed
 #KT-29919
2021-11-16 15:02:50 +01:00
Igor Yakovlev ec9fcce1bc [WASM] Add hashCode, equals and toString to KClass and KType implementations 2021-11-15 19:53:48 +03:00
Igor Yakovlev ee7f4c7278 [WASM] Implementation typeOf support 2021-11-15 19:53:48 +03:00
Igor Yakovlev 39a389c49a [WASM] Implementation qualifiedOrSimpleName 2021-11-15 19:53:47 +03:00
Igor Yakovlev ce360bb10b [WASM] Implementation of Class references 2021-11-15 19:53:46 +03:00
Igor Laevsky c7cfa97748 [Wasm] Implement Any::hashCode() 2021-11-15 18:26:46 +03:00
Igor Laevsky 9e00a2c5b4 [Wasm] Implement platform random in stdlib 2021-11-15 18:26:45 +03:00
Svyatoslav Kuzmich 08362e8b38 [Wasm] Support defineExternally 2021-11-12 18:44:46 +03:00
Alexander Udalov e7680ddbff Fix execution optimization warning for :kotlin-stdlib-common:sourcesJar
#KTI-662 Fixed
2021-11-12 13:24:08 +01:00
Sergey Bogolepov f43b5d32f9 Add tests for Char.isHighSurrogate() and Char.isLowSurrogate() 2021-11-09 08:27:59 +00:00
Igor Laevsky 22c161bcee [Wasm] Run unit tests for the wasm stdlib (fail on verifier for now) 2021-11-03 16:23:02 +03:00
Igor Laevsky 46b56c7642 [Wasm] Improve string constructor in stdlib 2021-11-03 16:23:01 +03:00
Igor Laevsky cb10bd3a95 [Wasm] Port stdlib and kotlin.test build to wasm gradle plugin 2021-11-03 16:23:01 +03:00