Skip to content

Clobbering this from options might be murky #26

@joliss

Description

@joliss

If I understand the constructor correctly, we're providing the ability to assign arbitrary properties on this through an options hash as a common base class constructor.

I used to do this in early versions of Broccoli plugin classes because it seemed convenient. I stopped doing it when I started running into cases where some library upgrade would cause property names to start colliding with option names. I simply do this.options = options in constructors ever since, and have been much happier with that.

My suggestion would be to make the base class constructor empty, and let people do their own option handling. I realize this might be a breaking change, but perhaps it's worth considering for the next major version?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions