added object expression support to the site, tnbundle, etc

This commit is contained in:
sergeych committed 2026-01-06 01:51:16 +01:00
1 parent eec732d11a
commit 5fc0969491
5 files changed
+35 -11

No files matched your search

+6 -2
View File
@@ -86,8 +86,12 @@ val base = { a: 1, b: 2 }
val patch = { b: 3, c: }
val m = { "a": 0, ...base, ...patch, d: 4 }
assertEquals(1, m["a"]) // base overwrites 0
assertEquals(3, m["b"]) // patch overwrites base
assertEquals(4, m["d"]) // literal key
// Object expressions: anonymous classes on the fly
val worker = object : Runnable {
override fun run() = println("Working...")
}
worker.run()
>>> void
""".trimIndent()
val mapHtml = "<pre><code>" + htmlEscape(code) + "</code></pre>"