mirror of
https://github.com/robertkrimen/otto
synced 2025-10-26 20:28:49 +08:00
Test condition in case of continue in do-while
This commit is contained in:
18
otto_test.go
18
otto_test.go
@@ -566,6 +566,24 @@ func TestTryFinally(t *testing.T) {
|
||||
}
|
||||
`)
|
||||
test("result", "2")
|
||||
|
||||
test(`
|
||||
var abc = false, def = 0;
|
||||
do {
|
||||
def += 1;
|
||||
if (def > 100) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
continue;
|
||||
}
|
||||
finally {
|
||||
abc = true;
|
||||
}
|
||||
}
|
||||
while(!abc && def < 10)
|
||||
def;
|
||||
`, "10")
|
||||
}
|
||||
|
||||
func TestTryCatch(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user