Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: add an option to translate JS_IR with DCE. #501

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

JSMonk
Copy link
Member

@JSMonk JSMonk commented Jun 16, 2022

Add an query argument for adding dead code elimination step before IR to JS translating

@@ -51,8 +51,10 @@ class KotlinProjectExecutor(
return convertJsWithConverter(project, kotlinToJSTranslator::doTranslate)
}

fun convertToJsIr(project: Project): TranslationJSResult {
return convertJsWithConverter(project, kotlinToJSTranslator::doTranslateWithIr)
fun convertToJsIr(project: Project, shouldEliminateDeadCode: Boolean): TranslationJSResult {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, fix the usages of the method or set a default value for "shouldEliminateDeadCode".
BaseExecutorTest will not pass due to the method's signature mismatch.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also it;s good to have additional test for that feature

fun runJsIrWithDce(
code: String,
contains: String = "",
notContain: String = "",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

notContains mb?

@AlexanderPrendota
Copy link
Collaborator

@JSMonk do u need it?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants