jashkenas/coffee-script — Issue #2161: Existential operator precedence bug?
Author: dsmiley
Created: 2012-02-28 20:47:17+00:00
State: open

Here is a sample failing coffeescript program in which I look up an optional user friendly label for a data variable:
```
key = 'my key name'
label = labels?[key] ?= key
alert(label)
```
This should intuitively look up the key in the labels object if present and use it if there, otherwise default to key. But it doesn't work; it always sets label to undefined. In this particular case, the expected behavior is an alert 'my key name'. Instead I have to break this down into an additional line:
```
key = 'my key name'
label = labels?[key]
label ?= key
alert(label)
```