Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Dec 29, 2011
  1. Fixed a problem with if statements (the rewriting is too greedy and i…

    authored
    …t removes too much code)
    
    Sample code
    =======
    
        if(isSafari())
            ta = TEXTAREA(name_d, d.name_val);
        else {
            ta = TEXTAREA(name_d);
        }
    
        if(isSafari()) { } else { ta = TEXTAREA(name_d); }
    
        if(isSafari()) { } else { ta = TEXTAREA(name_d); }
    
    How the current compiler compiles it (incorrectly for the first rewrite)
    =========
    
        ta = TEXTAREA(name_d)  unless isSafari()
        ta = TEXTAREA(name_d)  unless isSafari()
        ta = TEXTAREA(name_d)  unless isSafari()
    
    How this fix compiles the above JS code (correctly):
    ========
    
        if isSafari()
          ta = TEXTAREA(name_d, d.name_val)
        else
          ta = TEXTAREA(name_d)
        ta = TEXTAREA(name_d)  unless isSafari()
        ta = TEXTAREA(name_d)  unless isSafari()
    
    This issue has been reported here
    js2coffee#108
Commits on Dec 28, 2011
  1. Added the ability to output more Pythonic code by providing --pythonic

    authored
    Made following options configureable via lib/codestyle.coffee:
    
    tabspacing = 2
    parenthesized_calls = false
    explicit_return = false
    use_unless = true
    doublespacing_if = true
    
    Added a command line option --pythonic that when provided will
    configure code style to be more pythonic (tabspace 4, no unless,
    parenthesized calls and explicit returns).
    
    Commandline parsing is a bit dirty now and I would have used something
    like commander (npm commander), but I am unsure what the author prefers.
    
    A showcase of the new features:
    ~/> cat test.'s
    function helloWorld(some_value) {
        if(some_value != 'hello')
            return;
        aFunctionCall('hello');
        return "value";
    }
    
    ~/> ./bin/js2coffee test.js
    helloWorld = (some_value) ->
      return  unless some_value is "hello"
      aFunctionCall "hello"
      "value"
    
    ~/> ./bin/js2coffee --pythonic test.js
    helloWorld = (some_value) ->
        return if some_value isnt "hello"
        aFunctionCall("hello")
        return "value"
Commits on Nov 19, 2011
  1. Rico Sta. Cruz

    Merge pull request #109 from tricknotes/fix-cake-text

    rstacruz authored
    Fix cake test
  2. Ryunosuke SATO

    Fix cake test

    tricknotes authored
Commits on Oct 20, 2011
  1. Rico Sta. Cruz
  2. Rico Sta. Cruz
Commits on Oct 15, 2011
  1. Rico Sta. Cruz

    Release v0.1.2

    rstacruz authored
  2. Rico Sta. Cruz
  3. Rico Sta. Cruz
  4. Rico Sta. Cruz

    Update HISTORY.md.

    rstacruz authored
  5. Rod Knowlton Rico Sta. Cruz

    Retrieve reserved words from coffeescript; removed use of reserved wo…

    codelahoma authored rstacruz committed
    …rd 'yes' from a test.
  6. Chia-liang Kao Rico Sta. Cruz

    Add test for reserved keywords in var declaration.

    clkao authored rstacruz committed
  7. Chia-liang Kao Rico Sta. Cruz

    Declare variable even if initializer is not provided.

    clkao authored rstacruz committed
  8. Rico Sta. Cruz

    Add a test for function invocations with the first argument being an …

    rstacruz authored
    …object literal. Related to #69.
  9. Rico Sta. Cruz

    Compile 'undefined' properly.

    rstacruz authored
  10. Rico Sta. Cruz

    Update HISTORY.md.

    rstacruz authored
  11. Rico Sta. Cruz
  12. Rico Sta. Cruz

    Update HISTORY.md.

    rstacruz authored
  13. Rico Sta. Cruz

    Update HISTORY.md.

    rstacruz authored
  14. Rico Sta. Cruz

    Fix fall through switch case

    Surat authored rstacruz committed
  15. Rico Sta. Cruz
  16. Rico Sta. Cruz

    don't unreserve property accessors

    Mike Blume authored rstacruz committed
    fixes #95
  17. Rico Sta. Cruz
  18. Rico Sta. Cruz

    also don't inline objects if they're in lists

    Mike Blume authored rstacruz committed
  19. Rico Sta. Cruz

    make tests pass

    Mike Blume authored rstacruz committed
  20. Rico Sta. Cruz

    Inline most one-property objects

    Mike Blume authored rstacruz committed
    Just newline them if they are themselves property values.
    
    This will preserve the desired round-trip behavior with fewer unneeded
    side-effects
  21. Rico Sta. Cruz

    don't special-case one-property objects

    Mike Blume authored rstacruz committed
    ensure generated coffeescript does not fall afoul of jashkenas/coffeescript#1116
  22. Rico Sta. Cruz
  23. Rico Sta. Cruz
  24. Rico Sta. Cruz
  25. Rico Sta. Cruz
  26. Rico Sta. Cruz

    Use 'npm test' for tests.

    rstacruz authored
  27. Rico Sta. Cruz

    Update HISTORY.md.

    rstacruz authored
  28. Rico Sta. Cruz
  29. Rico Sta. Cruz
Something went wrong with that request. Please try again.