Skip to content

constructor renaming parameters #4865

Open
@crisward

Description

@crisward

If you do this

class Blah
  constructor:(@thing)->
     @thing()
      
  method:->
    thing = "hi"

Coffeescript compiles to

var Blah;

Blah = class Blah {
  constructor(thing1) {
    this.thing = thing1;
    this.thing();
  }

  method() {
    var thing;
    return thing = "hi";
  }

};

Why the 1 after the thing?? I'm using an dependency injection system, and the rename is playing havoc with it. Coffeescript 1 didn't do this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions