Skip to content

Suspicious bind call in Action class #1068

@drewhoener

Description

@drewhoener

I was going through some of the updated roslib code to add some more dynamic typing (great job on the rest of the refactor btw, sorry I couldn't add more stuff) and I noticed this snippet in Action#advertise:

    this.ros.on(this.name, (msg) => {
      if (isRosbridgeSendActionGoalMessage(msg)) {
        this.#executeAction.bind(this);
      } else {
        throw new Error(
          "Received unrelated message on Action server event stream!",
        );
      }
    });

Isn't this just a no-op? I noticed that it changed in d37cf8d to satisfy some ESLint conditions, but this change seems to do nothing.
The old version actually passed the bound function to the event, this one just does nothing. I assume it's meant to be called?

@EzraBrooks

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions