Tests for when / break / continue fixed

This commit is contained in:
Mikhail Glukhikh
2015-04-06 16:04:59 +03:00
parent 412ab8f8b8
commit cdc2d0f542
2 changed files with 4 additions and 4 deletions
@@ -4,9 +4,9 @@ package foo
fun box(): Boolean {
var result = false
var i = 1
while(i==1)
@loop while(i==1)
when (i) {
1 -> { result = true; break }
1 -> { result = true; break@loop }
else -> result = false
}
return result;
@@ -381,7 +381,7 @@ class CanvasState(val canvas: HTMLCanvasElement) {
{
jq(canvas).click {
val mousePos = mousePos(it)
for (shape in shapes) {
@shapeLoop for (shape in shapes) {
if (shape is Button && mousePos in shape) {
val name = shape.src
shape.mouseClick()
@@ -401,7 +401,7 @@ class CanvasState(val canvas: HTMLCanvasElement) {
trafficLightDown.setGreen()
}
else -> continue
else -> continue@shapeLoop
}
}