[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:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user