Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supposed error on line 435 of the lib / model.js file #167

Open
emanuelmoraes-dev opened this issue Aug 18, 2018 · 0 comments
Open

Supposed error on line 435 of the lib / model.js file #167

emanuelmoraes-dev opened this issue Aug 18, 2018 · 0 comments

Comments

@emanuelmoraes-dev
Copy link

Hi, I know the project is probably disabled, but I was analyzing its source code and found a supposed error in implementing the "contains" method at line 435 of the lib / model.js file

function contains (arr, key) {
if (arr.indexOf (key)> -1) return true;
for (var obj in arr) {
if (obj.method === key) {
return true;
}
}
return false;
};

on the line:

"for (var obj in arr)"

the "in" operator will not traverse the values contained in the Array. The variable "obj" will only contain the key name contained in the object and not its value. In the case of an Array the key of the object will be its index.

I would just like to pass on my observation so that someone can verify the truth of my suspicion, because I think this work is very good and it is a pity that it is stopped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant