Commit Graph

1167 Commits

Author SHA1 Message Date
Ilmir Usmanov d67e4f0c48 Rename inline class -> @JvmInline value class in stdlib and compiler 2021-02-25 16:06:51 +01:00
Ilya Goncharov d9be59ea97 [JS IR] JS code in init block only for js ir backend test 2021-02-20 21:06:28 +03:00
Ilya Goncharov 187d4998fa [JS IR] Not cast to declaration parent in JsCodeOutlineLowering, use parent otherwise
^KT-45057 fixed
2021-02-20 13:08:45 +03:00
Anton Bannykh 6c6d43c29a JS: add missing reachable nodes data 2021-02-12 16:21:09 +03:00
Ilya Goncharov 19bffc694b [JS IR] Add test with chain export--not-export--export
^KT-44616 fixed
2021-02-08 13:41:16 +03:00
Ilya Goncharov 7b4624aac4 [JS IR] Add exported method into exportNestedClass.kt
^KT-44616 fixed
2021-02-08 13:38:47 +03:00
Ilya Goncharov 6c051b2be4 [JS IR] Override method are not exported
[JS IR] Add test with jsexport overrides not js export method with stable name

^KT-44616 fixed
2021-02-08 13:38:30 +03:00
Svyatoslav Kuzmich c9cb7bc0fd [JS IR] Update tests 2021-02-04 16:16:41 +03:00
Victor Turansky ba0d60853d KT-40235 null companion for stdlib external union types 2021-02-03 20:36:24 +03:00
Ilya Gorbunov 87e130e77a Remove obsolete diagnostics suppression
The diagnostic NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS is now
obsolete because internal constructors of inline classes became allowed.
2021-02-03 18:23:53 +03:00
Ilya Goncharov 977781fa49 [JS IR] Add tests with export all file and export nested class
[JS IR] Skip dce driven for nested classes export

^KT-44469 fixed
2021-01-28 18:55:33 +03:00
Svyatoslav Kuzmich cb3b1f8ae2 [JS IR] Fix referencing Kotin variables in inline JS code
Fixed by outlining JS code that uses Kotlin variables making usages of
these locals explicit and preventing bugs due to one-sided variable renaming.

This prevents using Kotlin variables as lvalue in JS code.
2021-01-25 19:18:44 +03:00
Ilya Goncharov a89fe90043 [JS IR] Add test on exportable overriden method
^KT-44415 fixed
2021-01-25 15:16:22 +03:00
Pavel Kirpichenkov 5c28762c02 Fix check for local classes in approximating string table
Take local/anonymous classes and their inner classes into account.
Simplify approximation: use first available super classifier instead
of first super class. This approximation should only happen for
private declarations that were not previously approximated by frontend.
So basically the only requirement for the approximated types is to be
denotable. Note that this only works if the types are not used later.
JVM uses a different string table implementatin as it needs exact
types of private members for reflection.

^KT-20996 Fixed
2021-01-20 11:05:53 +03:00
Shagen Ogandzhanian 96de9144de [JS IR] Generate stub for exported functions with default params
see https://youtrack.jetbrains.com/issue/KT-43407
2020-12-31 20:21:21 +01:00
Shagen Ogandzhanian 55a5695fc0 [JS] Forbid export of interfaces
With the only exception of external interfaces.

See https://youtrack.jetbrains.com/issue/KT-44099
2020-12-29 20:43:57 +01:00
Zalim Bashorov e5c62c3838 [JS] Disable special checks in labeled-block-to-do-while 2020-12-07 17:27:24 +03:00
Zalim Bashorov 7ca54ec405 [JS IR] unmute test arraySort.kt 2020-12-07 17:27:23 +03:00
Shagen Ogandzhanian 8e5bcd349e [JS IR] Respect JsExport while assigning stable names
see https://youtrack.jetbrains.com/issue/KT-43404
2020-12-02 22:21:16 +01:00
Ilya Goncharov 697b2b02f1 [JS IR] Add properties lazy initialization with multiple modules
[JS IR] Move tests into compiler/testData

[JS IR] Add cyclic dependencies with lazy property initialization

[JS IR] Add test on not initialization in case of call non properties (classed, objects, enum classes, const vals)

[JS IR] Add initialization through top level

[JS IR] Ignore enum getInstance function in property lazy initialization

[JS IR] Use let function with useful result instead of pure apply and also

[JS IR] Remove duplicated tests in js.translator
2020-12-02 17:35:30 +03:00
Ilya Goncharov ac42dcd8da [JS IR] Add test for external fun vararg
[JS IR] Add tests with empty vararg and default arg before it

[JS IR] Ignore backend in tests instead of target backend

[JS IR] Add function with named spread operator

[JS IR] Remove ignoring of current js backend in jsExternalVarargFun

[JS IR] Add with arguments after vararg

^KT-42357 fixed
2020-11-30 17:33:07 +03:00
Ilya Goncharov f382a55b17 [JS IR] Add EXPECTED_REACHABLE_NODES for JS tests of external tail args 2020-11-24 16:34:27 +03:00
Ilya Goncharov efee3ea648 [JS IR] - Remove file lowering declarations from lowering phases
- rename fileToPurenessInitializers onto fileToInitializerPureness
- remove redundant check on top-level property

[JS IR] Rename initialis* to initializ* for consistency

[JS IR] Move propertyLazyInitialization property to context from configuration

[JS IR] Add test on lazy initialization properties order

[JS IR] Add multi module for lazy initialization of properties

[JS IR] Move tests onto js.translator

[JS IR] Rename fileToInitializerPureness according to context name

^KT-43222 fixed
2020-11-24 12:33:44 +03:00
Shagen Ogandzhanian 3282e092d8 [JS] Don't fail on recursive upper bounds while resolving JsExports
Fixes https://youtrack.jetbrains.com/issue/KT-42112
2020-11-23 18:01:00 +01:00
Shagen Ogandzhanian 2d4e9af289 [JS IR] Throw exception if test class or test method has explicit parameter
resolves https://youtrack.jetbrains.com/issue/KT-41032
2020-11-23 15:47:32 +01:00
Ilya Goncharov 64895fe7da [JS IR] Test with js specific moved to js.translator
- Move js function from `main` to separate js file

^KT-40090 fixed
2020-11-23 16:05:33 +03:00
Svyatoslav Kuzmich 02a84fa6e1 [Wasm] Remove wasmBox tests
They are be covered by common codegen box tests.
2020-11-09 16:04:43 +03:00
Roman Artemev 4d63ecd83c [JS IR] Do not copy prototype references of FO from super class
Reduce bundle size from issue from 4.9M to 3.4M

 - fix KT-41227
 - add simple test
2020-10-26 14:30:54 +03:00
Victor Turansky 4d4aabab8d [JS BE] Make properties configurable when implementing an interface by delegation
#KT-42364 Fixed
2020-10-20 15:49:29 +03:00
Roman Artemev f824bb6987 [JS BE] Merge Legacy and IR BE exceptions-related test data
- regenerate tests
 - add consistency test
2020-10-12 15:22:44 +03:00
Roman Artemev ff093d363a [JS IR BE] Fix Throwable ancestor transformation
Make sure that `message` and `cause` are properly configured

 - synchronize IR BE and Legacy behaviour
 - fix corresponding IR lowering
 - fix JS IR core runtime
 - add test
 - fix KT-39964
2020-10-12 15:22:43 +03:00
Svyatoslav Kuzmich 5e5712afbb [JS IR] Make JsExport not fail on companion objects (KT-37829) 2020-10-08 14:07:50 +03:00
Svyatoslav Kuzmich 162d9744ff [JS IR] Fix export of constructor with default argument (KT-41275) 2020-09-24 14:58:14 +03:00
Roman Artemev 2612609664 [JS] Add test for KT-39378 2020-09-02 14:42:17 +03:00
Zalim Bashorov 9097d0918c [JS BE] Support passing an array as argument of vararg in named form
#KT-38059 fixed
2020-08-28 13:14:23 +03:00
Zalim Bashorov 606232a584 [JS IR] Don't generate "import" statements for external interfaces
#KT-40964 fixed
2020-08-28 13:14:22 +03:00
Zalim Bashorov ba846830c9 [JS IR] Support nativeGetter, nativeSetter and nativeInvoke
#KT-41081 fixed
2020-08-28 13:04:18 +03:00
Roman Artemev fcca2c6fa3 [JS IR] fix failing test 2020-08-21 17:44:07 +03:00
Roman Artemev e7f22bcfbc [JS IR] Add test for cross module export 2020-08-20 22:16:20 +03:00
Roman Artemev 0559e192ee [JS IR] Support external delegation in case of JS in psi2ir
- fix FE delegation resolver
 - fix critical KT-40650
2020-07-29 19:57:05 +03:00
Svyatoslav Kuzmich 4a803e9d2f [JS IR] Support object declaration export
Fixes KT-39117 and KT-39367
2020-07-23 08:21:59 +03:00
Svyatoslav Kuzmich 4027dae594 [JS] Add js/js.translator/testData/package-lock.json 2020-07-23 08:21:57 +03:00
Svyatoslav Kuzmich 609f0ca9bc [JS IR] .d.ts generation for module systems
Support .d.ts generation for UMD, AMD, CommonJS module kinds in
addition to existing "plain" module kind.
2020-07-16 14:02:06 +03:00
Ilya Gorbunov 2f3e1dcbc6 Add EXACTLY_ONCE contract to suspendCoroutine* functions
Update line numbers in the affected test.
2020-07-10 01:05:16 +03:00
Roman Artemev ca44242f37 [IR] Fix synthetic declarations generator to make it produce correct type
- Fix KT-40126
 - Add test
2020-07-09 11:47:07 +03:00
Anton Bannykh da79f93c61 JS IR: per-module .js generation support 2020-06-26 17:55:33 +03:00
Anton Bannykh a1c9ee1013 Mute failing ES6 phases 2020-06-26 17:55:32 +03:00
Ilya Gorbunov 6c8ff25e5d Drop deprecated jsClass top level and extension functions
Introduce internal toplevel jsClass in js-ir source set instead.
It is needed for JS-IR backend.
2020-06-22 12:29:25 +03:00
Ilya Gorbunov e9c4f531eb Increase deprecation level for previously deprecated API
- unsupported common exceptions
- common 'synchronized'
- jquery API
- experimental kotlin.time API
- js Math object
- DefaultAsserter constructor-like fun
2020-06-22 12:29:24 +03:00
Svyatoslav Kuzmich bbfc1a10ad [JS] Fix stack trace capturing from secondary constructors KT-37563 2020-06-22 12:03:59 +03:00