Commit Graph

499 Commits

Author SHA1 Message Date
Ilya Gorbunov 2fe222e8e7 Add SKIP_DCE_DRIVEN directive in JS-IR tests
Otherwise they fail with a compiler exception:
"An operation is not implemented: SAM conversion"
2020-06-17 19:45:15 +03:00
Svyatoslav Kuzmich 695d383ed1 [JS] Support secondary constructors in JsExport 2020-06-03 10:33:45 +03:00
Vitaly fe047f9b47 [JS BE] mutes tests for JS_IR_ES6, which muted for JS_IR 2020-05-27 00:32:56 +03:00
Vitaly a231b21c69 [JS BE] add tests for es6-classes 2020-05-27 00:32:55 +03:00
Svyatoslav Kuzmich 6e3d3831c2 [JS] JsExport diagnostics and legacy support
Account for JsExport in legacy backend namer. It means we
catch overloaded exported function conflicts for free!

Add error diagnostics:
* NESTED_JS_EXPORT (Fixes KT-36798)
* WRONG_EXPORTED_DECLARATION (Part of the fix for KT-37752)
* NON_EXPORTABLE_TYPE (Fixes KT-37771)
2020-05-22 10:50:22 +03:00
Abduqodiri Qurbonzoda bfffcf6b23 Update BoxJsTest expected reachable nodes because of new collection builders 2020-04-30 02:28:41 +03:00
Anton Bannykh 2992d49a1d JS IR: fix findAssociatedObjects for primitive type KClass'es 2020-04-28 19:08:44 +03:00
Anton Bannykh 442331acc9 IR JS: support findAssociatedObject feature (KT-37418 fixed) 2020-04-27 17:23:19 +03:00
Svyatoslav Kuzmich 3ec13d5bd6 [JS IR BE] Support companion objects in external interfaces
These objects are referenced but value is not actually used.
Replace access to these references with null literals.
2020-04-07 21:19:14 +03:00
Victor Turansky 79bec82430 KT-34770 JS. Configurable properties. Test 2020-04-07 16:15:02 +03:00
Victor Turansky 4d219d1eed KT-31126 JS. Fix super constructor call. Test infra comment
Primary ordinary -> secondary external
2020-04-07 09:30:22 +03:00
Victor Turansky be39151fad KT-31126 JS. Fix super constructor call. Tests
Primary ordinary -> secondary external
2020-04-07 09:30:22 +03:00
Svyatoslav Kuzmich f113c22450 [JS IR BE] Fix enum entry initialization
Keep helper fields uninitialized. This way thier initialization
would not depend on field initialization order.
2020-03-11 14:28:20 +03:00
Anton Bannykh 63a909dee6 JS: fix KT-37386
Anonymous object constructor parameters should not reuse JsName's
of the super class. Otherwise the temporary name renamer gets
confused.
2020-03-11 12:15:23 +03:00
Roman Artemev 7430bfe518 [KLIB] Update test data
- mute temporary broken test
 - add regression test
2020-03-10 11:12:08 +03:00
Roman Artemev 5dcac16cf7 [JS IR] Update test data 2020-03-03 18:54:36 +03:00
Roman Artemev 161bb72439 [JS IR] Update test data 2020-03-03 18:54:36 +03:00
Svyatoslav Kuzmich 3ecee5c7cd [JS IR BE] Implement kotlin.js.jsTypeOf as intrinsics 2020-02-27 16:54:55 +03:00
Svyatoslav Kuzmich dff7d7b7b9 [PSI2IR] Patch parents before referenceExpectsForUsedActuals
There were some ADAPTER_FOR_CALLABLE_REFERENCE functions with
uninitialized parents at this point.
2020-02-27 16:54:55 +03:00
Svyatoslav Kuzmich cd80eced32 [JS IR BE] Use fresh name for external JsModule declarations. 2020-02-27 16:54:55 +03:00
Anton Bannykh e7816b4ec2 JS: support callable references with vararg and default parameters conversion 2020-02-27 15:12:49 +03:00
Victor Petukhov 4490efab3e [NI] Use original descriptor for functions imported from object during JS mangling
^KT-35904 Fixed
2020-01-30 19:55:41 +03:00
Abduqodiri Qurbonzoda b06645d1c0 Update number of reachable nodes because of MutableList.removeFirst/Last 2020-01-29 17:53:08 +03:00
Zalim Bashorov e6074e8759 [JS BE] Unmute test 2020-01-22 15:20:41 +03:00
Dmitriy Novozhilov 76b3964e96 Update testdata according to change compiler version to 1.4 2020-01-17 10:33:50 +03:00
Zalim Bashorov ee06678484 [JS BE] Fix is check with Function
#KT-33149 fixed
2019-12-26 22:49:53 +03:00
Roman Artemev cad3cb1bbe [KLIB] Fix references to type made from TypeParameter in KotlinMangler
- promote ABI version
2019-12-17 17:56:07 +03:00
Abduqodiri Qurbonzoda dabf6376db Update js reachable nodes count after expanding StringBuilder api 2019-12-06 05:37:09 +03:00
Roman Artemev 4759c16428 [JS IR] Fix IrGetClass for Throwable successors
- add test
2019-11-28 14:45:34 +03:00
Roman Artemev 97c8b2074e [JS] Set correct EXPECTED_REACHABLE_NODES 2019-11-27 00:06:42 +03:00
Anton Bannykh 81699299f5 JS_IR: DCE
Could be enabled by toggling `-Xir-dce`

Box test output in js/js.translator/testData/out-min
2019-11-26 12:20:39 +03:00
Roman Artemev c5e25a0382 [JS IR] Make PrivateMembersLowering global to handle inlined private references correctly
- Fixes [KT-33334]
2019-11-25 20:22:03 +03:00
Roman Artemev 9946feb66c [JS IR] Fix name clash between class members defined on prototype
- Fixes [KT-33327]
2019-11-25 20:22:03 +03:00
Roman Artemev 987c6ab3ee [JS IR] Roll making Char inline class back
- un/mute falling tests
2019-11-25 20:22:03 +03:00
Pavel Kirpichenkov 8c52bb4212 Add frontend checks for missing dependency supertypes
Call checker and declaration checker are used in order to preserve backward compatibility.
Attempt to use classifier usage checker was not good enouth,
since not all errors found with it would actually be reported before.
For example types and constructor calls don't cause supertypes to resolve,
so missing supertypes would not lead to errors in case they are the only use of class name.

Updated tests failing due to missing Java dependencies in superclasses.
2019-11-18 12:06:41 +03:00
Vladimir Dolzhenko 46d843643d Fixed BoxJsTestGenerated.Main due to nullable arguments in main method 2019-10-28 16:42:14 +01:00
Anton Bannykh aad9cbbf01 [JS IR BE] Fix tests failing due to reduced runtime 2019-10-04 17:30:45 +03:00
Roman Artemev 0040298eac Fix master
- improve assertion message
 - compare correct file paths
 - fix C JS BE testData
2019-09-04 14:37:14 +03:00
Roman Artemev 90504c797a [IR SERIALIZATION] Add tests about klib linkage 2019-09-03 14:21:31 +03:00
Svyatoslav Kuzmich 9594e9b3b1 [JS IR BE] Initial export generation 2019-08-30 13:15:37 +03:00
Roman Artemev efafb6585e [JS IR BE] Refactored js("...") function
- support object expression
 - do not wrap in function in statement-level position
 - support implicit return
 - code clean up
2019-07-11 18:00:28 +03:00
Roman Artemev d4fb76c1da [JS IR BE] Fix overriding property of Throwable 2019-07-09 10:40:01 +03:00
Roman Artemev d9c6d38715 [JS IR BE] Fix private members lowering
- visit over file instead of class
2019-07-09 10:40:01 +03:00
Roman Artemev 8a569cc698 [JS IR BE] Do not create $default stub for external function and any its fake override 2019-07-04 22:59:12 +03:00
Svyatoslav Kuzmich a2625c7bc8 [JS IR BE] Don't render null messages in Throwable
Set message property to 'undefined' to make Error.prototype.toString
skip it
2019-07-04 18:33:23 +03:00
Svyatoslav Kuzmich 871180cdc0 [JS IR BE] Fix setting names of Throwable subclasses without primary constructor 2019-07-03 20:37:49 +03:00
Svyatoslav Kuzmich 69962cbf8c [JS IR BE] Add JsExport annotations 2019-07-01 18:55:41 +03:00
Anton Bannykh fadeac083f JS: fix reified T::class for primitive T (e.g. Int) (KT-32215 fixed) 2019-06-28 13:49:22 +03:00
Svyatoslav Kuzmich 0b19a4a32b [JS IR BE] Initial version of member namer 2019-06-21 17:02:01 +03:00
Ilya Gorbunov aa69933ee0 Update EXPECTED_REACHABLE_NODES
DCE doesn't remove DurationUnit and some other kotlin.time stuff in these cases
2019-06-18 04:02:36 +03:00