Skip to content

Lexer: Chaining: Leading dot throws error when previous line ends with empty function #3845

@bioball

Description

@bioball

This is not a huge deal, but not the behavior I was expecting. I'd like to be able to chain method calls with function callbacks together, even if the function bodies were empty. The use case is for cases like this:

doThing()
.then (@result) =>
.catch handleError

Where I'd expect this to compile into:

doThing().then((function(_this) {
  return function(account) {
    _this.account = account;
  };
})(this))["catch"](handleError);

Currently, this just throws an error: Error on line 3: unexpected .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions