mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Ambiguous ternary syntax might be an issue
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
//test division prevention
|
//test division prevention
|
||||||
{
|
{
|
||||||
var x = 0;
|
var x = 0;
|
||||||
assert x ? 0 : 1 / x == 0, "Division by zero prevention failed";
|
assert (x ? 0 : 1 / x) == 0, "Division by zero prevention failed";
|
||||||
}
|
}
|
||||||
|
|
||||||
//test ambiguous syntax
|
//test ambiguous syntax
|
||||||
@@ -29,7 +29,7 @@
|
|||||||
var d = 4;
|
var d = 4;
|
||||||
var e = 5;
|
var e = 5;
|
||||||
|
|
||||||
assert a ? b ? c : d : e == 3, "Ambiguous syntax failed";
|
assert (a ? b ? c : d : e) == 3, "Ambiguous syntax failed";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user