Node's stock REPL provides a fragile and awkward notion of an evaluation context. A fresh REPL is configured with an evaluation context as if by both with(context) and .call(context) to enable unqualified access to context variables, as well as introspection of the this context. This, however, is a convenient illusion. If you evaluate var x = 1; this, you'll note that x is added to this. If you were to use var inside a with block, you wouldn't get that same behavior. The top-level inside the REPL is somewhat magical.
It doesn't have to be this way. There are languages that are much better suited to iterative REPL development. If you've been following my blog, then this is where you'd expect me to praise Clojure. I'll save that for a future post in which I'll discuss what is really necessary for a successful REPL. And while Clojure's REPL is far better than any other I've ever used, it's got it's own shortcomings to discuss as well.