0acaedef92
Attributes are used to name continuation classes and are generated before inline classes processing. During the processing, for override functions in inlined classes, the compiler generates STATIC_INLINE_CLASS_REPLACEMENT function with body of the override. The override's body is replaced with delegating call to STATIC_INLINE_CLASS_REPLACEMENT. However, since we need to keep the name of the continuation class, we copy attributes from the override to STATIC_INLINE_CLASS_REPLACEMENT. This leads to attribute clash during AddContinuationLowering. So, to fix the issue, do not use the attribute of STATIC_INLINE_CLASS_REPLACEMENT in original->suspend map. As an optimization, do not generate continuation for the override function.
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