Skip to content

Commit 4332bb7

Browse files
committed
Make JSHInt happy
1 parent c9de501 commit 4332bb7

File tree

2 files changed

+15
-10
lines changed

2 files changed

+15
-10
lines changed

spec/issues.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(function() {
12
'use strict';
23
/*global ko, QUnit*/
34

@@ -241,12 +242,13 @@ QUnit.test('Issue #33', function(assert) {
241242
return ko.utils.unwrapObservable(data.id);
242243
},
243244
create: function(options) {
244-
var o = (new (function() {
245+
function SimpleObject() {
245246
this._remove = function() {
246247
options.parent.items.mappedRemove(options.data);
247248
};
248249
ko.mapping.fromJS(options.data, {}, this);
249-
})());
250+
}
251+
var o = new SimpleObject();
250252
return o;
251253
}
252254
}
@@ -330,3 +332,4 @@ QUnit.test('Issue #203', function(assert) {
330332

331333
assert.deepEqual(ko.mapping.toJS(viewModel), {connectionId: 1, type: 'thirdType', thirdTypeProperty: 'thirdTypeProperty'});
332334
});
335+
})();

spec/mappingBehaviors.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
(function() {
12
'use strict';
23
/*global ko, QUnit*/
34

@@ -1009,14 +1010,14 @@ QUnit.test('ko.mapping.fromJS should be able to map empty object structures', fu
10091010
QUnit.test('ko.mapping.fromJS should send create callbacks when atomic items are constructed', function (assert) {
10101011
var atomicValues = ["hello", 123, true, null, undefined];
10111012
var callbacksReceived = 0;
1012-
for (var i = 0; i < atomicValues.length; i++) {
1013-
var result = ko.mapping.fromJS(atomicValues[i], {
1014-
create: function (item) {
1015-
callbacksReceived++;
1016-
return item;
1017-
}
1018-
});
1019-
}
1013+
atomicValues.forEach(function(value) {
1014+
var result = ko.mapping.fromJS(value, {
1015+
create: function (item) {
1016+
callbacksReceived++;
1017+
return item;
1018+
}
1019+
});
1020+
});
10201021
assert.equal(callbacksReceived, 5);
10211022
});
10221023

@@ -1836,3 +1837,4 @@ QUnit.test('ko.mapping.toJS explicit declared none observable members should be
18361837

18371838
assert.equal(js.b, data.b);
18381839
});
1840+
})();

0 commit comments

Comments
 (0)