mirror of
https://github.com/Mibew/mibew.git
synced 2025-02-07 08:14:42 +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 {
|
try {
|
||||||
var packageObject = this.mibewAPI.decodePackage(data);
|
var packageObject = this.mibewAPI.decodePackage(data);
|
||||||
// TODO: Try to use 'for' loop instead of 'for in' loop
|
for (var i = 0, len = packageObject.requests.length; i < len; i++) {
|
||||||
// or use hasOwnProperty method
|
|
||||||
for (var i in packageObject.requests) {
|
|
||||||
this.processRequest(packageObject.requests[i]);
|
this.processRequest(packageObject.requests[i]);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -87,6 +87,10 @@ MibewAPI.prototype.checkFunction = function(functionObject, filterReservedFuncti
|
|||||||
);
|
);
|
||||||
argumentsLoop:
|
argumentsLoop:
|
||||||
for (var argName in functionObject.arguments){
|
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++) {
|
for (var i = 0; i < mandatoryArgumentsList.length; i++) {
|
||||||
if (argName == mandatoryArgumentsList[i]) {
|
if (argName == mandatoryArgumentsList[i]) {
|
||||||
mandatoryArgumentsCount++;
|
mandatoryArgumentsCount++;
|
||||||
|
Loading…
Reference in New Issue
Block a user