Skip to content

Wrong interpretation involving property indentation #2221

@mcmire

Description

@mcmire

Not sure if this has been filed before, but I notice this doesn't compile correctly:

prop: ->
  foo
    .bar 'baz', ->
      bliz
        .blaz 'zing', ->
          somethingHere()
        .fooz()
  someMoreStuffHere()

This compiles to:

({
  prop: function() {
    return foo.bar('baz', function() {
      return bliz.blaz('zing', function() {
        return somethingHere();
      }).fooz();
    });
  }
});

someMoreStuffHere();

when it should compile to:

({
  prop: function() {
    foo.bar('baz', function() {
      return bliz.blaz('zing', function() {
        return somethingHere();
      }).fooz();
    });
    return someMoreStuffHere();
  }
});

However, this gets interpreted correctly (i.e., outdenting one level):

prop: ->
  foo
  .bar 'baz', ->
    bliz
      .blaz 'zing', ->
        somethingHere()
      .fooz()
  someMoreStuffHere()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions