flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mih...@apache.org
Subject [2/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34852 Fixing mustella failure introduced by a commit on this ticket. The bug was that SortField.objectHasSortFieldValue() returned true instead of false when the object didn't have that field. This
Date Thu, 16 Jul 2015 20:48:10 GMT
FLEX-34852
Fixing mustella failure introduced by a commit on this ticket. The bug was that SortField.objectHasSortFieldValue()
returned true instead of false when the object didn't have that field. This was because an
object typed as Object is always null, even when undefined is assigned to it. It needed to
be typed as *. (This is reproduced in SortField_Tests.as)


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/a722cf98
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/a722cf98
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/a722cf98

Branch: refs/heads/develop
Commit: a722cf981df6d85fae701137d2588bd9e59de2e7
Parents: 33c0a06
Author: Mihai Chira <mihaic@apache.org>
Authored: Thu Jul 16 22:44:49 2015 +0200
Committer: Mihai Chira <mihaic@apache.org>
Committed: Thu Jul 16 22:44:49 2015 +0200

----------------------------------------------------------------------
 .../framework/src/mx/collections/SortField.as   |  2 +-
 .../projects/framework/tests/SortField_Tests.as | 22 ++++++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/a722cf98/frameworks/projects/framework/src/mx/collections/SortField.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/src/mx/collections/SortField.as b/frameworks/projects/framework/src/mx/collections/SortField.as
index 821690e..a465656 100644
--- a/frameworks/projects/framework/src/mx/collections/SortField.as
+++ b/frameworks/projects/framework/src/mx/collections/SortField.as
@@ -676,7 +676,7 @@ public class SortField extends EventDispatcher implements ISortField
 
     protected function getSortFieldValue(obj:Object):*
     {
-        var result:Object = undefined;
+        var result:* = undefined;
 
         try
         {

http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/a722cf98/frameworks/projects/framework/tests/SortField_Tests.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/framework/tests/SortField_Tests.as b/frameworks/projects/framework/tests/SortField_Tests.as
new file mode 100644
index 0000000..3cd3871
--- /dev/null
+++ b/frameworks/projects/framework/tests/SortField_Tests.as
@@ -0,0 +1,22 @@
+package {
+    import mx.collections.SortField;
+
+    import org.flexunit.asserts.assertFalse;
+
+    public class SortField_Tests {
+        private var _sut:SortField;
+
+        [Test]
+        public function fix_mustella_failure_due_to_FLEX_34852():void
+        {
+            //given
+            _sut = new SortField("someField");
+
+            //when
+            var emptyObjectHasASortField:Boolean = _sut.objectHasSortField({});
+
+            //then
+            assertFalse(emptyObjectHasASortField);
+        }
+    }
+}


Mime
View raw message