Legacy jsc allows this, and it's a feature of many other modern REPLs too. Not 100% sure how to do it. Maybe doing paren and brace matching will get us most of the way there. So things like: (function() { return 42; })(); or: var f = function(a, b) { return a + b; }; would be possible.