Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch creates its own shared scope. #1476

Closed

Commits on Jun 29, 2011

  1. Catch creates its own shared scope.

    "catch e" create its own shared scope with e in it.
    Neither simply adding e to current scope instead of creating new socpe,
    nor creating non-shared scope pass the following test:
    
    test "catch statements should create shared scope with their argument", ->
      g = ->
        try
        catch e
        e = 2 # e should local to g
        try
          throw "error"
        catch e
          e = 3 # e should local to catch clause
          x = 1 # x should local to g, not catch clause
    
        ok e is 2
        ok x is 1
    
      e = 1 # this e should be different to e in g
      g()
      ok e is 1
    taku0 committed Jun 29, 2011
    Configuration menu
    Copy the full SHA
    fcc0aad View commit details
    Browse the repository at this point in the history