de1e27c584
last-exclusive progressions (i.e., "until" progressions and loop over array indices). This change makes it possible to correctly implement the handling of "step" progressions. Computing the last element of a stepped progression requires that the last is inclusive. Also invert the while loop (into if + do-while) that is used when lowering for-loops over progressions that cannot overflow. This keeps the performance characteristics closer to the ForLoopsLowering in kotlin-native, since the goal is to converge to this shared version. Also used IrType instead of KotlinType, where possible. https://github.com/JetBrains/kotlin/pull/2390 https://github.com/JetBrains/kotlin/pull/2305
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