swank-js/swank-js — pull request #46 by joddie (2012-07-21 23:04:05+00:00)
Title: Add inspect() function to the repl for async debugging

Debugging asynchronous node functions in a REPL is tricky when they take a callback but don't return a value to display immediately.

This patch adds an `inspect` function to the REPL which calls `util.inspect()` on each of its arguments and prints the results to the REPL output, so you can pass it as a callback to any asynchronous function. I put it in the `_swank` namespace and also bind it to `inspect` in the REPL's global context. This means it's quick to type, and if you overwrite it with some other value you can still get it from `_swank.inspect`.