[JS IR] Add test with boolean in external interface

[JS IR] Add possibility to safely access Boolean in external declaration

[JS IR] Add diagnostic for booleans in externals
This commit is contained in:
Ilya Goncharov
2021-06-15 20:18:30 +03:00
committed by Space
parent 2e049c1208
commit 21a3494bca
20 changed files with 293 additions and 69 deletions
@@ -1,24 +0,0 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.js.config
enum class DceRuntimeDiagnostic {
LOG,
EXCEPTION;
companion object
}
fun DceRuntimeDiagnostic.removingBody(): Boolean {
return this != DceRuntimeDiagnostic.LOG
}
fun DceRuntimeDiagnostic.dceRuntimeDiagnosticToArgumentOfUnreachableMethod(): Int {
return when (this) {
DceRuntimeDiagnostic.LOG -> 0
DceRuntimeDiagnostic.EXCEPTION -> 1
}
}
@@ -0,0 +1,13 @@
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.js.config
enum class RuntimeDiagnostic {
LOG,
EXCEPTION;
companion object
}