fixed wrong line report on throw statement

This commit is contained in:
sergeych committed 2025-11-21 17:18:59 +01:00
1 parent a229f227e1
commit 72c6dc2bde
3 files changed
+104 -10

No files matched your search

@@ -3519,4 +3519,21 @@ class ScriptTest {
""".trimIndent()).toString())
}
@Test
fun testThrowReportsSource() = runTest {
try {
eval(
"""
// line 1
// line 2
throw "the test"
""".trimIndent()
)
} catch (se: ScriptError) {
println(se.message)
// Pos.line is zero-based
assertEquals(2, se.pos.line)
}
}
}