You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: