mirror of
https://github.com/Mibew/mibew.git
synced 2025-01-31 05:20:30 +03:00
Make sure all for-in loops works as expected
This commit is contained in:
parent
199438285c
commit
d5130ed655
@ -377,9 +377,7 @@
|
||||
}
|
||||
try {
|
||||
var packageObject = this.mibewAPI.decodePackage(data);
|
||||
// TODO: Try to use 'for' loop instead of 'for in' loop
|
||||
// or use hasOwnProperty method
|
||||
for (var i in packageObject.requests) {
|
||||
for (var i = 0, len = packageObject.requests.length; i < len; i++) {
|
||||
this.processRequest(packageObject.requests[i]);
|
||||
}
|
||||
} catch (e) {
|
||||
|
@ -87,6 +87,10 @@ MibewAPI.prototype.checkFunction = function(functionObject, filterReservedFuncti
|
||||
);
|
||||
argumentsLoop:
|
||||
for (var argName in functionObject.arguments){
|
||||
if (!functionObject.arguments.hasOwnProperty(argName)) {
|
||||
// Work with own properties only.
|
||||
continue;
|
||||
}
|
||||
for (var i = 0; i < mandatoryArgumentsList.length; i++) {
|
||||
if (argName == mandatoryArgumentsList[i]) {
|
||||
mandatoryArgumentsCount++;
|
||||
|
Loading…
Reference in New Issue
Block a user