Commit Graph

69 Commits

Author SHA1 Message Date
Vitaly fe047f9b47 [JS BE] mutes tests for JS_IR_ES6, which muted for JS_IR 2020-05-27 00:32:56 +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 dabf6376db Update js reachable nodes count after expanding StringBuilder api 2019-12-06 05:37:09 +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
Svyatoslav Kuzmich 69962cbf8c [JS IR BE] Add JsExport annotations 2019-07-01 18:55:41 +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
Svyatoslav Kuzmich 0f07209490 [JS IR BE] Remove unnecesary println from tests 2019-03-15 13:53:21 +03:00
Anton Bannykh 4e298ae5cb JS: Inlined local declarations should be positioned after imports 2019-02-14 15:14:28 +03:00
Anton Bannykh 0bfd332580 JS: improve a test (review fix) 2019-02-14 15:14:28 +03:00
Anton Bannykh 990ee849e2 JS: test local declaration deduplication with name clash; fix the test 2019-02-14 15:14:28 +03:00
Anton Bannykh 60aa6e4971 JS: a cross-module local declaration fake override test;
Also describe an alternative, more robust approach in a TODO comment
2019-02-14 15:14:28 +03:00
Anton Bannykh 2022a9c887 JS: fix inheriting fake overrides in inlined object literals 2019-02-14 15:14:28 +03:00
Anton Bannykh 9716abcc12 JS: inline private properties 2019-02-14 15:14:28 +03:00
Anton Bannykh cd0fd569b4 JS: visit tests and main in import remover; update line numbers 2019-02-14 15:14:28 +03:00
Anton Bannykh c65383fa3f JS: postpone JS AST merging 2019-02-14 15:14:28 +03:00
Svyatoslav Kuzmich aa811dcfb3 [JS IR BE] Add KJS_WITH_FULL_RUNTIME directive to compiler tests 2019-01-24 16:14:40 +03:00
Roman Artemev 4e05be9a96 Update tests 2018-12-07 17:58:20 +03:00
Svyatoslav Kuzmich 0210ec3114 [JS BE] Fix KT-26787: handle JsSwitch in LabeledBlockToDoWhileTransformation 2018-10-10 19:35:16 +03:00
Roman Artemev a807397f65 [JS_IR] Add inlineBox tests 2018-09-21 14:02:53 +03:00
Anton Bannykh 6736987239 JS: fix unsigned literal inlining 2018-09-19 15:04:36 +03:00
Anton Bannykh 0660e4d616 [JS IR BE] support multimodule tests 2018-09-18 14:36:20 +03:00
Anton Bannykh 2e709a81fa [JS IR BE] Arrays, varargs 2018-09-18 14:36:20 +03:00
Anton Bannykh b389e29db5 JS: update DCE testdata 2018-09-12 09:49:25 +03:00
Anton Bannykh 779d9aafe7 JS: fix module aliasing for inline imports (KT-26466 fixed)
Consider an import from an inline function invocation. If it is
being called from another inline function, it should be defined
in a special way (e.g. `$$importsForInline$$.foo`) so that
the compiler knows where to load transitive dependencies from.
What's more, the declaration itself should be inside the inline
function wrapper.

Otherwise it should be defined in a regular way (e.g.
`$module$bar.foo` among other top-level imports).

By default the imports are loaded in the first form, and
transformed into the second one when needed. To check
whether this transformation the following predicate is
used: `inlineFunctionDepth == 0`.

At the moment the mentioned variable is increased upon
visiting an inline function declaration (`defineInlineFunction`),
and upon visiting an unknown (not visited before) inline function invocation.

It seems that instead the variable should be increased when processing
an existing inline function wrapper. At that point a new place to
put import definitions (`statementContextForInline`) is set.

Due to way JS code is generated (lambda's come before their call sites)
this issue seems to have been masked. Primary class constructors are a special
case - they come before any other declaration within. Hence a lambda
invocation inside a constructor leads to incorrect import definition.
2018-09-06 19:08:45 +03:00
Anton Bannykh 4e496cf2b2 JS: don't throw AssertionError from RedundantCallElimination
Also mark JS `call` function to avoid removing a custom `call`
2018-08-23 14:44:40 +03:00
Anton Bannykh 04b04f919d JS: fix complex nested cross-module inlining (KT-26117 fixed) 2018-08-21 20:42:02 +03:00
Ilya Gorbunov ebc64da52a Update EXPECTED_REACHABLE_NODES after introducing top-level comparator
#KT-18067
2018-08-15 21:28:57 +03:00
Svyatoslav Kuzmich 392ad521fd [JS IR BE] Reflection support 2018-08-15 13:35:14 +03:00
Zalim Bashorov 2fb286e39c [JS IR BE] Update tests 2018-07-31 11:28:39 +03:00
Svyatoslav Kuzmich 625983b28a [JS IR BE] Enum class lowering 2018-07-23 15:08:18 +03:00
Roman Artemev e4b314c26c Fix inlining of invoke operator [#KT-25474]
* add test
2018-07-18 16:12:41 +03:00
Svyatoslav Kuzmich 1abb4f42ac [JS IR BE] Add ranges to runtime, rangeTo for primitive numbers 2018-07-17 20:18:29 +03:00
Anton Bannykh 07b3b66fd9 JS IR: unmute tests 2018-07-10 13:34:19 +03:00
Anton Bannykh 04a2ffc0c1 JS IR: unmute tests 2018-06-21 13:27:17 +03:00
Anton Bannykh b551afb202 JS IR: minor fix for callable ref translation
The caching variable has to have no initializers so that there is no
dependence on evaluation order.
2018-06-18 13:15:19 +03:00
Anton Bannykh 43e3314255 JS IR: Remove inline functions with reified type parameters
Otherwise we cannot handle type casts
2018-06-18 13:15:19 +03:00
Anton Bannykh 3808d77bf4 JS IR: inliner 2018-06-18 13:15:19 +03:00
Roman Artemev 6ac4fd2e5f [JS IR BE] Update test data 2018-06-14 19:54:30 +03:00
Svyatoslav Kuzmich 563637548a KJS: Fix loop levels in ContinueReplacingVisitor (KT-24777) 2018-06-07 12:57:36 +03:00
Svyatoslav Kuzmich 2ec8c4aae6 KJS: Label loops in LabeledBlockToDoWhileTransformation
Fix KT-24542: insert labes for affected loops, breaks and continues
statements during LabeledBlockToDoWhileTransformation
2018-06-07 12:57:36 +03:00
Roman Artemev 84447d59e1 [JS IR BE] Update test data 2018-05-24 21:07:25 +03:00
Roman Artemev d9fdddceb9 Update test data 2018-04-27 20:02:59 +03:00
Roman Artemev 61e051cafa Update test data 2018-04-24 14:04:16 +03:00
Zalim Bashorov d03a128aa5 [JS IR BE] mute failed tests 2018-04-19 13:17:28 +03:00
Alexey Andreev 3b3fd0fa0d JS: fix DCE limits in test data to fit new kotlin.js size
The size has increased due to new implementation of KClass
2017-10-06 18:16:51 +03:00
Alexey Andreev 24c6f5f0f0 JS: add test to prove that KT-19483 is no more reproducible 2017-09-08 18:27:43 +03:00
Alexey Andreev abb254297a Properly rename local name aliases when merging JS fragments together 2017-09-04 15:33:16 +03:00
Alexey Andreev 918ce78c5a Support inlining internal functions to friend modules in JS BE
There's one exception: if an inline internal function calls
private function, this will fail at run time.
2017-09-04 15:33:13 +03:00
Alexey Andreev b90885d1cb Support new inline function format in JS DCE tool 2017-09-04 15:33:09 +03:00