[Build] Remove/qualify for-in usages

This commit is contained in:
Victor Woeltjen
2016-03-04 13:10:23 -08:00
parent fb56b3ad56
commit 134452582c
3 changed files with 10 additions and 18 deletions

View File

@ -24,7 +24,7 @@
define( define(
[], [],
function () { function () {
/*jshint forin:false */
/** /**
* Wrapper for both "context" and "composition" capabilities; * Wrapper for both "context" and "composition" capabilities;
* ensures that any domain objects reachable in Edit mode * ensures that any domain objects reachable in Edit mode

View File

@ -90,12 +90,10 @@ define(function () {
// For documentation, see checkAll below // For documentation, see checkAll below
function checkAll() { function checkAll() {
var type;
// Reset all the other options to original/default position // Reset all the other options to original/default position
for (type in $scope.ngModel.checked) { Object.keys($scope.ngModel.checked).forEach(function (type) {
$scope.ngModel.checked[type] = false; $scope.ngModel.checked[type] = false;
} });
// Change the filters string depending on checkAll status // Change the filters string depending on checkAll status
if ($scope.ngModel.checkAll) { if ($scope.ngModel.checkAll) {

View File

@ -87,24 +87,20 @@ define(
}); });
it("checking checkAll option resets other options", function () { it("checking checkAll option resets other options", function () {
var type;
mockScope.ngModel.checked['mock.type.1'] = true; mockScope.ngModel.checked['mock.type.1'] = true;
mockScope.ngModel.checked['mock.type.2'] = true; mockScope.ngModel.checked['mock.type.2'] = true;
controller.checkAll(); controller.checkAll();
for (type in mockScope.ngModel.checked) { Object.keys(mockScope.ngModel.checked).forEach(function (type) {
expect(mockScope.ngModel.checked[type]).toBeFalsy(); expect(mockScope.ngModel.checked[type]).toBeFalsy();
} });
}); });
it("tells the user when no options are checked", function () { it("tells the user when no options are checked", function () {
var type; Object.keys(mockScope.ngModel.checked).forEach(function (type) {
for (type in mockScope.ngModel.checked) {
mockScope.ngModel.checked[type] = false; mockScope.ngModel.checked[type] = false;
} });
mockScope.ngModel.checkAll = false; mockScope.ngModel.checkAll = false;
controller.updateOptions(); controller.updateOptions();
@ -113,12 +109,10 @@ define(
}); });
it("tells the user when options are checked", function () { it("tells the user when options are checked", function () {
var type;
mockScope.ngModel.checkAll = false; mockScope.ngModel.checkAll = false;
for (type in mockScope.ngModel.checked) { Object.keys(mockScope.ngModel.checked).forEach(function (type) {
mockScope.ngModel.checked[type] = true; mockScope.ngModel.checked[type] = true;
} });
controller.updateOptions(); controller.updateOptions();