defineProps won't let you just override the setter, you must override both if 
they exist


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

Branch: refs/heads/develop
Commit: 6008098e895db40fc9084c3f1830bafdf1acda31
Parents: 18355a5
Author: Alex Harui <aha...@apache.org>
Authored: Wed Apr 8 15:26:07 2015 -0700
Committer: Alex Harui <aha...@apache.org>
Committed: Wed Apr 8 15:26:07 2015 -0700

----------------------------------------------------------------------
 .../FlexJS/src/org/apache/flex/html/DropDownList.js | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/6008098e/frameworks/js/FlexJS/src/org/apache/flex/html/DropDownList.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/html/DropDownList.js 
b/frameworks/js/FlexJS/src/org/apache/flex/html/DropDownList.js
index a8b5ccb..d1f8d11 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/html/DropDownList.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/html/DropDownList.js
@@ -83,6 +83,13 @@ 
Object.defineProperties(org_apache_flex_html_DropDownList.prototype, {
     },
     /** @expose */
     selectedIndex: {
+        // TODO: (aharui) copied from ListBase because you
+        // can't just override the setter in a defineProps
+        // structure.
+        /** @this {org_apache_flex_html_DropDownList} */
+        get: function() {
+            return this.model.selectedIndex;
+        },
         /** @this {org_apache_flex_html_DropDownList} */
         set: function(value) {
             this.model.selectedIndex = value;
@@ -91,8 +98,15 @@ 
Object.defineProperties(org_apache_flex_html_DropDownList.prototype, {
     },
     /** @expose */
     selectedItem: {
+        // TODO: (aharui) copied from ListBase because you
+        // can't just override the setter in a defineProps
+        // structure.
+        /** @this {org_apache_flex_html_DropDownList} */
+        get: function() {
+            return this.model.selectedItem;
+        },
         /** @this {org_apache_flex_html_DropDownList} */
-        get: function(value) {
+        set: function(value) {
             this.model.selectedItem = value;
             this.element.selectedIndex = this.selectedIndex;
         }

Reply via email to