2010-01-17 15:40:59 +00:00
|
|
|
result: try
|
|
|
|
nonexistent * missing
|
|
|
|
catch error
|
|
|
|
true
|
|
|
|
|
|
|
|
result2: try nonexistent * missing catch error then true
|
|
|
|
|
2010-02-17 00:45:25 +00:00
|
|
|
ok result is true and result2 is true, 'can assign the result of a try/catch block'
|
2010-01-17 15:40:59 +00:00
|
|
|
|
|
|
|
|
2010-01-26 15:52:05 +00:00
|
|
|
get_x: -> 10
|
2010-01-17 15:40:59 +00:00
|
|
|
|
|
|
|
if x: get_x() then 100
|
|
|
|
|
2010-02-17 00:45:25 +00:00
|
|
|
ok x is 10, 'can assign a conditional statement'
|
2010-01-17 15:40:59 +00:00
|
|
|
|
|
|
|
x: if get_x() then 100
|
|
|
|
|
2010-02-19 12:51:52 +00:00
|
|
|
ok x is 100, 'can assign a conditional statement'
|
|
|
|
|
2010-02-19 23:27:50 +00:00
|
|
|
|
2010-02-19 12:51:52 +00:00
|
|
|
tester: ->
|
|
|
|
@example: -> puts 'example function'
|
|
|
|
this
|
|
|
|
|
|
|
|
ok tester().example.name is 'example'
|