mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-01-25 22:57:55 -05:00
Make power operator have higher precedence than unary operators: +, -, ~, !
This commit is contained in:
@@ -302,6 +302,12 @@ test "power operator", ->
|
||||
|
||||
test "power operator has higher precedence than other maths operators", ->
|
||||
eq 55, 1 + 3 ** 3 * 2
|
||||
eq -4, -2 ** 2
|
||||
eq false, !2 ** 2
|
||||
eq 0, (!2) ** 2
|
||||
eq -2, ~1 ** 5
|
||||
|
||||
#test "power operator has lower precedence than"
|
||||
|
||||
test "power operator is right associative", ->
|
||||
eq 2, 2 ** 1 ** 3
|
||||
Reference in New Issue
Block a user