Skip to content

Commit

Permalink
Add ExperimentalContracts opt-in
Browse files Browse the repository at this point in the history
  • Loading branch information
igoriakovlev committed Sep 24, 2024
1 parent 60bc130 commit 314d7df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/wasmJsMain/kotlin/main.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import kotlinx.browser.document

@OptIn(kotlin.contracts.ExperimentalContracts::class)
fun main() {
document.body?.addTimeZoneWidget()
}
1 change: 1 addition & 0 deletions src/wasmJsMain/kotlin/timeZoneWidget.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import kotlinx.dom.appendText
import org.w3c.dom.Element
import org.w3c.dom.HTMLInputElement

@kotlin.contracts.ExperimentalContracts
fun Element.addTimeZoneWidget() {
appendElement("div") {
appendText("Time in ")
Expand Down
2 changes: 2 additions & 0 deletions src/wasmJsTest/kotlin/Test.kt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import kotlinx.browser.document
import org.w3c.dom.HTMLInputElement
import org.w3c.dom.get
import kotlin.contracts.ExperimentalContracts
import kotlin.test.Test
import kotlin.test.assertEquals

class BrowserTest {
@OptIn(ExperimentalContracts::class)
@Test
fun mainTest() {
val mockContainer = document.createElement("div")
Expand Down

0 comments on commit 314d7df

Please sign in to comment.