Recognize defaults in CoffeeScript code when object destructuring is used #434

pbadenski opened this Issue Apr 22, 2016 · 0 comments


None yet

1 participant


This is a correct CoffeScript code:

method = ({foo = 2}) -> console.log(foo)

but when used with js2cofee it reports an error: unexpected =

Coffeescript transpiler translates it to the equivalent JavaScript code:

(function() {
  var method;

  method = function(arg) {
    var foo, ref;
    foo = (ref = != null ? ref : 2;
    return console.log(foo);


I believe js2coffee should match the behavior of a coffeescript transpiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment