Change for-in loop to Collections.forEach to satify JSLint (looks like a bug in JSLint though)

This commit is contained in:
dloverin committed 2013-04-15 17:55:01 -04:00
1 parent dbb7d3f4d3
commit 33a016da6d
1 file changed
+6 -7
@@ -308,20 +308,19 @@ define(function (require, exports, module) {
*/
function getPendingRequest(file, offset, type) {
var key = file + "@" + offset;
if (Object.prototype.hasOwnProperty.call(pendingTernRequests, key)) {
if (CollectionUtils.hasProperty(pendingTernRequests, key)) {
var requests = pendingTernRequests[key],
requestType = requests[type],
anyProperties = false;
delete pendingTernRequests[key][type];
for (var prop in requests) {
if (CollectionUtils.hasProperty(requests, prop)) {
CollectionUtils.forEach(requests, function (requestValue, requestKey) {
if (CollectionUtils.hasProperty(requests, requestKey)) {
anyProperties = true;
break;
}
}
});
if (!anyProperties) {
delete pendingTernRequests[key];
}