blob: d7a3c9b8b7f31858cb298fa362005d6af3f27ea1 [file]
/*
* Copyright 2010-2026 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 kotlin.js
import kotlin.internal.UsedFromCompilerGeneratedCode
import kotlin.internal.staticInitializationFailure
private const val INITIALIZATION_STATE_INITIALIZED: Int = 1
private const val INITIALIZATION_STATE_ERROR: Int = 2
@UsedFromCompilerGeneratedCode
internal fun checkStaticInitializationState(state: Int, ctor: Ctor?): Boolean {
if (state == INITIALIZATION_STATE_ERROR) {
staticInitializationFailure(null, ctor?.`$metadata$`?.simpleName)
}
return state == INITIALIZATION_STATE_INITIALIZED
}