flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [10/12] git commit: [flex-asjs] [refs/heads/develop] - fix Constant binding in release builds
Date Mon, 17 Aug 2015 05:30:13 GMT
fix Constant binding in release builds


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

Branch: refs/heads/develop
Commit: df0b9d908a26e7112e7d1ca0cf13340d82043ffd
Parents: b60d1d8
Author: Alex Harui <aharui@apache.org>
Authored: Sun Aug 16 22:28:41 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Sun Aug 16 22:28:41 2015 -0700

----------------------------------------------------------------------
 .../js/src/org/apache/flex/binding/ConstantBinding.js | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/df0b9d90/frameworks/projects/Binding/js/src/org/apache/flex/binding/ConstantBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/projects/Binding/js/src/org/apache/flex/binding/ConstantBinding.js
b/frameworks/projects/Binding/js/src/org/apache/flex/binding/ConstantBinding.js
index 8ff26c9..65f5e43 100644
--- a/frameworks/projects/Binding/js/src/org/apache/flex/binding/ConstantBinding.js
+++ b/frameworks/projects/Binding/js/src/org/apache/flex/binding/ConstantBinding.js
@@ -51,6 +51,20 @@ Object.defineProperties(org.apache.flex.binding.ConstantBinding.prototype,
{
               val = this.source[this.sourcePropertyName];
             } else if (this.sourcePropertyName in this.source.constructor) {
               val = this.source.constructor[this.sourcePropertyName];
+            } else {
+              // GCC optimizer only puts exported class constants on
+              // Window and not on the class itself (which got renamed)
+              var cname = this.source.FLEXJS_CLASS_INFO;
+              if (cname) {
+                cname = cname.names[0].qName;
+                var parts = cname.split('.');
+                var n = parts.length;
+                var o = window;
+                for (var i = 0; i < n; i++) {
+                  o = o[parts[i]];
+                }
+                val = o[this.sourcePropertyName];
+              }
             }
             this.destination[this.destinationPropertyName] = val;
         }


Mime
View raw message