Comma-separated global variable definitions can result in wrong indentation #429

Open
maikokuppe opened this Issue Mar 3, 2016 · 0 comments

Projects

None yet

1 participant

@maikokuppe

It seems that the following code is compiled wrong:

Input:

function a() {
  b = function () {
    // code
  },
    c = {}
};

Output:

a = ->

  b = ->
    # code
    return

c = {}
  return

# ---
# generated by js2coffee 2.1.0

In the output, the c definition is outside of the function indentation layer.

This JS code is definitely not good practice, but anyways, I'm posting this because I think it is an issue you might want to know about.

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