From 18beeab5e2f6bba7bca96b4bfa1ab23952f722d5 Mon Sep 17 00:00:00 2001 From: Thomas Butler Date: Fri, 13 Dec 2013 07:20:48 -0500 Subject: [PATCH 1/3] changed [illegal] variant type usage to a prefered static typing --- knockout/tests/knockout-tests.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index fb3955241..6aeaae89f 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -56,13 +56,13 @@ function test_computed() { function MyViewModel1() { this.price = ko.observable(25.99); - this.formattedPrice = ko.computed({ + this.formattedPrice = ko.computed({ read: function () { return '$' + this.price().toFixed(2); }, write: function (value) { - value = parseFloat(value.replace(/[^\.\d]/g, "")); - this.price(isNaN(value) ? 0 : value); + var num = parseFloat(value.replace(/[^\.\d]/g, "")); + this.price(isNaN(num) ? 0 : num); }, owner: this }); From e61f72fd71d79eec9640da3d7e1bf77791072f11 Mon Sep 17 00:00:00 2001 From: Thomas Butler Date: Fri, 13 Dec 2013 07:24:45 -0500 Subject: [PATCH 2/3] removed access of non-existant property --- knockout/tests/knockout-tests.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index 6aeaae89f..805f02638 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -124,7 +124,7 @@ function test_observableArrays() { myObservableArray.unshift('Some new value'); myObservableArray.shift(); myObservableArray.reverse(); - myObservableArray.sort(function (left, right) { return left.lastName == right.lastName ? 0 : (left.lastName < right.lastName ? -1 : 1) }); + myObservableArray.sort(function (left, right) { return left == right ? 0 : (left < right ? -1 : 1) }); myObservableArray.splice(1, 3); myObservableArray.remove('Blah'); From cbc8adfb1ed01564212853e0deb6d0169684facf Mon Sep 17 00:00:00 2001 From: Thomas Butler Date: Fri, 13 Dec 2013 07:25:35 -0500 Subject: [PATCH 3/3] removed duplicate identifier 'update' --- knockout/tests/knockout-tests.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/knockout/tests/knockout-tests.ts b/knockout/tests/knockout-tests.ts index 805f02638..8432089d9 100644 --- a/knockout/tests/knockout-tests.ts +++ b/knockout/tests/knockout-tests.ts @@ -180,8 +180,6 @@ function test_bindings() { init: function (element, valueAccessor) { var value = ko.utils.unwrapObservable(valueAccessor()); $(element).toggle(value); - }, - update: function (element, valueAccessor, allBindingsAccessor) { } }; ko.bindingHandlers.hasFocus = {