mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-18 11:31:20 -05:00
fixing assignment-in-condition
This commit is contained in:
23
test/fixtures/execution/test_assignment.coffee
vendored
Normal file
23
test/fixtures/execution/test_assignment.coffee
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
# Assign to try/catch.
|
||||
|
||||
result: try
|
||||
nonexistent * missing
|
||||
catch error
|
||||
true
|
||||
|
||||
result2: try nonexistent * missing catch error then true
|
||||
|
||||
print(result is true and result2 is true)
|
||||
|
||||
|
||||
# Assign to conditional.
|
||||
|
||||
get_x: => 10
|
||||
|
||||
if x: get_x() then 100
|
||||
|
||||
print(x is 10)
|
||||
|
||||
x: if get_x() then 100
|
||||
|
||||
print(x is 100)
|
||||
Reference in New Issue
Block a user