jashkenas/coffee-script — Issue #2182: Inconsistency with the existential operator
Author: michaelowens
Created: 2012-03-07 14:02:07+00:00
State: open

Quicky shown in one code:
```coffeescript
if varname? then
varname2 = "hi"
if varname2? then
delete varname2
if varname2? then
```

Compiles to
```javascript
var varname2;

if (typeof varname !== "undefined" && varname !== null) {}

varname2 = "hi";

if (varname2 != null) {}

delete varname2;

if (varname2 != null) {}
```

The last one doesn't check for undefined, even though the variable was deleted. I think it's bad for CoffeeScript to decide to not check for undefined based on how the script was during compiling.