8bdc4d34f7
- Allow participating subtypes of functional types in conversions - Fix several subtle inconsistencies - Place logic about conversions at one place Now conversions operations have two stages: before usual subtyping check and after one. This is needed to support conversions of subtypes (of functional types, for example). First, the compiler checks if it possible to resolve an argument without conversion and only then it tries to perform conversion. Note that it'd be incorrect to perform conversion eagerly as it can change resolve (Runnable & () -> Unit <: KRunnable), plus we can't guess whether conversion is needed at all as it's important not to look into supertypes if resolution doesn't actually needed it #KT-36448 Fixed #KT-37574 Fixed #KT-38604 Fixed
JavaScript Translation
This module performs the translation of Kotlin source code to JavaScript.
There are various Kotlin APIs to JavaScript environments in the standard library.
Compiling the Kotlin Standard Library for JavaScript
The Kotlin Standard Library for JS is built with gradle, see the corresponding module's ReadMe.
Reusing JVM based test cases in JavaScript
Any Kotlin test cases using the org.junit.Test annotation and the kotlin.test package, such as this test case are automatically converted to JavaScript using QUnit.
This allows the test cases to be run directly in a web page in any web browser.
Using the Kotlin Library in JavaScript
There is a simple sample which shows how to use the Kotlin Standard Library from inside JavaScript in a web page.
Contributing
We love contributions! The JavaScript translation could really use your help! If you fancy contributing:
- check the contributing section on general stuff like getting the code etc
- try fix one of the pending JavaScript translation issues