jashkenas/coffee-script — Issue #1779: Move helpers within local scope if possible
Author: TrevorBurnham
Created: 2011-10-18 20:20:19+00:00
State: open

On the current master, the function wrapper is only added when necessary (see #1774), but it shows up even in cases like

$ -> console.log 1 in [1..3]

because the `for...in` syntax adds the `__hasProp` helper, which goes in the outermost scope of the file.

We could squeeze some byte savings out of projects with a lot of files that are wrapped in, say, `$ ->` or `class @A` by moving CoffeeScript's helpers into a more local scope.