jashkenas/coffee-script — pull request #2814 by epidemian (2013-03-11 23:01:32+00:00)
Title: Fixes #1829. Preserve variable scope in the REPL

This little fix should make variable declarations work properly on the REPL.

Before this patch:

```
coffee> a = 1
1
coffee> do -> a = 2
2
coffee> a
1
```

Now:

```
coffee> a = 1
1
coffee> do -> a = 2
2
coffee> a
2
```

And, probably more important, before:

```
coffee> b = null
null
coffee> b ?= 42
repl:1:1: error: the variable "b" can't be assigned with ?= because it has not been declared before
b ?= 42
^
```

After:

```
coffee> b = null
null
coffee> b ?= 42
42
```