b0aefd543a
[JS IR] Use TypeSubstitutor for full substitution of types - adding new tests [JS IR] Commonize context and use in wasm [JS IR] Add test with receiver with callable reference [JS IR] Add prerequisites around inlining and callable references [JS IR] Review fixes - Add test with bounded type parameter - Remove redundant casts - Use offsets for synth function - Correct traversing [JS IR] Not use origin for not inlined function reference [JS IR] Move util into common place [JS IR] Fix offsets [JS IR] Add type parameter argument and using value in test [JS IR] Wrap inlined callable references with reified parameters [JS IR] Add test on callable reference inlined fun Merge-request: KT-MR-4722
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