Skip to content

Incorrect variable listed as undefined in error message #150

@nwinter

Description

@nwinter

This code:

        var target = {"x": targetX, "y": targetY};
        if (this.isPathClear(this.pos, target.pos))
            this.move(target.pos);

should be:

var target = {"x": targetX, "y": targetY};
        if (this.isPathClear(this.pos, target))
            this.move(target);

But when you put in the first code, instead of saying "target.pos is not defined" or the like, it says isPathClear is not defined. Which is wrong, because isPathClear works fine.

Probably somewhere in there we have some shortcut logic for figuring out which variable it was that was not defined, and it's being too dumb and just taking the this.[whatever] variable in the line of code.

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