Make null falsey.

This commit is contained in:
Bob Nystrom
2014-01-20 18:12:55 -08:00
parent 8c5ef693d0
commit 90d1ed6aa6
13 changed files with 118 additions and 58 deletions
+14
View File
@@ -0,0 +1,14 @@
// Evaluate the 'then' expression if the condition is true.
if (true) IO.print("good") // expect: good
if (false) IO.print("bad")
// Allow block body.
if (true) { IO.print("block") } // expect: block
// Assignment in if condition.
var a = false
if (a = true) IO.print(a) // expect: true
// Newline after "if".
if
(true) IO.print("good") // expect: good