Skip to content

Help text not working - issues with for (var x in array) #22

Description

@glorat

This seems to be environment specific but in a couple of environments, the unfulfilled_args help text is not being displayed properly. It seems to relate to this piece of code at https://github.com/MeLlamoPablo/clapp/blob/master/lib/App.js#L268

					for (let i in unfulfilled_args) {
						r += unfulfilled_args[i.name] + "\n";
					}

The for loop assumes that i will be an Argument but in some enviroments it is simply the into the array. E.g.

> for (var x in [10,20,30]) {console.log(x)}
0
1
2

I'm not an expert in Javascript but a quick google suggests that using for/in over an array is apparently a bad idea, presumably because of this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions