CoffeeScriptRedux icon indicating copy to clipboard operation
CoffeeScriptRedux copied to clipboard

Classes are global in beta8

Open hybrist opened this issue 12 years ago • 0 comments

Coffee-script:

class Foo

Compiles to:

// Generated by CoffeeScript 2.0.0-beta8
void function () {
  Foo = function () {
    function Foo() {
    }
    void 0;
    return Foo;
  }();
}.call(this);

This does not seem to be happening if Foo is top-level (--bare and no surrounding function). For the following case it's even happening with --bare:

makeClass = ->
  class Foo

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/2268303-classes-are-global-in-beta8?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F33145&utm_medium=issues&utm_source=github).

hybrist avatar Jan 23 '14 19:01 hybrist