Bytecode compile is/not is and contains

This commit is contained in:
sergeych committed 2026-01-28 18:55:41 +03:00
1 parent 250220a42f
commit 490faea2ba
6 files changed
+43 -10

No files matched your search

@@ -5215,6 +5215,20 @@ class ScriptTest {
assertEquals(ObjFalse, scope.eval("inList(5, [1,2,3])"))
}
@Test
fun testIsOperatorBytecode() = runTest {
val scope = Script.newScope()
scope.eval(
"""
fun isInt(x) { x is Int }
""".trimIndent()
)
val disasm = scope.disassembleSymbol("isInt")
assertFalse(disasm.contains("not a compiled body"))
assertEquals(ObjTrue, scope.eval("isInt(42)"))
assertEquals(ObjFalse, scope.eval("isInt(\"42\")"))
}
@Test
fun testFilterBug() = runTest {
eval(