You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2013/11/07 01:54:51 UTC
[1/3] git commit: [flex-asjs] [refs/heads/develop] - adjust startup
APIs. Falcon will inject call to generateMXMLProperties in constructor
Updated Branches:
refs/heads/develop 9250591b6 -> 984c6f878
adjust startup APIs. Falcon will inject call to generateMXMLProperties in constructor
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c5bec261
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c5bec261
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c5bec261
Branch: refs/heads/develop
Commit: c5bec2612f8d20df027541c7e6f7bd4f546df837
Parents: 9250591
Author: Alex Harui <ah...@apache.org>
Authored: Wed Nov 6 08:01:23 2013 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Nov 6 08:08:28 2013 -0800
----------------------------------------------------------------------
frameworks/as/src/org/apache/flex/core/Application.as | 6 ++----
frameworks/as/src/org/apache/flex/core/ViewBase.as | 8 +++++---
2 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c5bec261/frameworks/as/src/org/apache/flex/core/Application.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/Application.as b/frameworks/as/src/org/apache/flex/core/Application.as
index eef71d1..a126b6f 100644
--- a/frameworks/as/src/org/apache/flex/core/Application.as
+++ b/frameworks/as/src/org/apache/flex/core/Application.as
@@ -52,8 +52,6 @@ package org.apache.flex.core
private function initHandler(event:flash.events.Event):void
{
- MXMLDataInterpreter.generateMXMLProperties(this, MXMLProperties);
-
ValuesManager.valuesImpl = valuesImpl;
ValuesManager.valuesImpl.init(this);
@@ -77,9 +75,9 @@ package org.apache.flex.core
return null;
}
- public function get MXMLProperties():Array
+ public function generateMXMLAttributes(data:Array):void
{
- return null;
+ MXMLDataInterpreter.generateMXMLProperties(this, data);
}
// beads declared in MXML are added to the strand.
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c5bec261/frameworks/as/src/org/apache/flex/core/ViewBase.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/ViewBase.as b/frameworks/as/src/org/apache/flex/core/ViewBase.as
index 3e92893..4e923a1 100644
--- a/frameworks/as/src/org/apache/flex/core/ViewBase.as
+++ b/frameworks/as/src/org/apache/flex/core/ViewBase.as
@@ -39,7 +39,7 @@ package org.apache.flex.core
// each MXML file can also have styles in fx:Style block
ValuesManager.valuesImpl.init(this);
- MXMLDataInterpreter.generateMXMLProperties(this, MXMLProperties);
+ MXMLDataInterpreter.generateMXMLProperties(this, mxmlProperties);
MXMLDataInterpreter.generateMXMLInstances(this, this, MXMLDescriptor);
dispatchEvent(new Event("initComplete"))
@@ -50,9 +50,11 @@ package org.apache.flex.core
return null;
}
- public function get MXMLProperties():Array
+ private var mxmlProperties:Array ;
+
+ public function generateMXMLAttributes(data:Array):void
{
- return null;
+ mxmlProperties = data;
}
public var mxmlContent:Array;
[3/3] git commit: [flex-asjs] [refs/heads/develop] - adjust for
changes to databinding codegen changes
Posted by ah...@apache.org.
adjust for changes to databinding codegen changes
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/984c6f87
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/984c6f87
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/984c6f87
Branch: refs/heads/develop
Commit: 984c6f878c19fb50d042dbe1f9e4a50ac51dc285
Parents: 8d222fa
Author: Alex Harui <ah...@apache.org>
Authored: Wed Nov 6 08:06:00 2013 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Nov 6 08:13:21 2013 -0800
----------------------------------------------------------------------
.../org/apache/flex/binding/GenericBinding.as | 11 ++--
.../org/apache/flex/core/ViewBaseDataBinding.as | 15 ++++-
.../org/apache/flex/binding/GenericBinding.js | 16 +++--
.../org/apache/flex/core/ViewBaseDataBinding.js | 69 +++++++++++++-------
4 files changed, 75 insertions(+), 36 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/984c6f87/frameworks/as/src/org/apache/flex/binding/GenericBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/binding/GenericBinding.as b/frameworks/as/src/org/apache/flex/binding/GenericBinding.as
index b86c0ab..4cb6f5e 100644
--- a/frameworks/as/src/org/apache/flex/binding/GenericBinding.as
+++ b/frameworks/as/src/org/apache/flex/binding/GenericBinding.as
@@ -35,6 +35,7 @@ package org.apache.flex.binding
public var source:Object;
public var destinationData:Object;
+ public var destinationFunction:Function;
public function set strand(value:IStrand):void
{
@@ -76,7 +77,11 @@ package org.apache.flex.binding
private function applyValue(value:Object):void
{
- if (destinationData is Array)
+ if (destinationFunction != null)
+ {
+ destinationFunction.apply(document, [value]);
+ }
+ else if (destinationData is Array)
{
var arr:Array = destinationData as Array;
var n:int = arr.length;
@@ -91,10 +96,6 @@ package org.apache.flex.binding
}
obj[arr[n-1]] = value;
}
- else if (destinationData is Function)
- {
- Function(destinationData).apply(document, [value]);
- }
}
public function setDocument(document:Object, id:String = null):void
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/984c6f87/frameworks/as/src/org/apache/flex/core/ViewBaseDataBinding.as
----------------------------------------------------------------------
diff --git a/frameworks/as/src/org/apache/flex/core/ViewBaseDataBinding.as b/frameworks/as/src/org/apache/flex/core/ViewBaseDataBinding.as
index 91317ad..0bff3a4 100644
--- a/frameworks/as/src/org/apache/flex/core/ViewBaseDataBinding.as
+++ b/frameworks/as/src/org/apache/flex/core/ViewBaseDataBinding.as
@@ -57,6 +57,7 @@ package org.apache.flex.core
{
var binding:Object = {};
binding.source = bindingData[index++];
+ binding.destFunc = bindingData[index++];
binding.destination = bindingData[index++];
bindings.push(binding);
}
@@ -142,6 +143,7 @@ package org.apache.flex.core
var gb:GenericBinding = new GenericBinding();
gb.setDocument(_strand);
gb.destinationData = binding.destination;
+ gb.destinationFunction = binding.destFunc;
gb.source = binding.source;
setupWatchers(gb, index, watchers.watchers, null);
}
@@ -200,14 +202,25 @@ package org.apache.flex.core
{
watcherData = { type: "function" };
watcherData.functionName = bindingData[index++];
+ watcherData.paramFunction = bindingData[index++];
watcherData.eventNames = bindingData[index++];
watcherData.bindings = bindingData[index++];
break;
}
case 1:
+ {
+ watcherData = { type: "static" };
+ watcherData.propertyName = bindingData[index++];
+ watcherData.eventNames = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ watcherData.getterFunction = bindingData[index++];
+ watcherData.parentObj = bindingData[index++];
+ watcherMap[watcherData.propertyName] = watcherData;
+ break;
+ }
case 2:
{
- watcherData = { type: type == 1 ? "static" : "property" };
+ watcherData = { type: "property" };
watcherData.propertyName = bindingData[index++];
watcherData.eventNames = bindingData[index++];
watcherData.bindings = bindingData[index++];
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/984c6f87/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js b/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js
index 36d293f..28d38fa 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/binding/GenericBinding.js
@@ -32,6 +32,12 @@ org.apache.flex.binding.GenericBinding.prototype.destinationData = null;
/**
* @expose
+ * @type {function}
+ */
+org.apache.flex.binding.GenericBinding.prototype.destinationFunction = null;
+
+/**
+ * @expose
* @this {org.apache.flex.binding.GenericBinding}
* @param {Object} value The strand (owner) of the bead.
*/
@@ -88,7 +94,11 @@ org.apache.flex.binding.GenericBinding.prototype.getValueFromSource =
org.apache.flex.binding.GenericBinding.prototype.applyValue =
function(value)
{
- if (typeof(this.destinationData) == 'object')
+ if (this.destinationFunction != null)
+ {
+ this.destinationFunction.apply(this.document, [value]);
+ }
+ else if (typeof(this.destinationData) == 'object')
{
var arr = this.destinationData;
var n = arr.length;
@@ -103,10 +113,6 @@ org.apache.flex.binding.GenericBinding.prototype.applyValue =
}
obj['set_' + arr[n - 1]](value);
}
- else if (typeof(this.destinationData) == 'function')
- {
- this.destinationData.apply(this.document, [value]);
- }
};
/**
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/984c6f87/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js
index a31c156..cc86875 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/core/ViewBaseDataBinding.js
@@ -63,6 +63,7 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.set_strand =
org.apache.flex.core.ViewBaseDataBinding.prototype.initCompleteHandler =
function(event) {
+ var prop;
var fieldWatcher;
var sb;
var bindingData = this.strand_['_bindings'];
@@ -74,6 +75,7 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.initCompleteHandler =
{
var binding = {};
binding.source = bindingData[index++];
+ binding.destFunc = bindingData[index++];
binding.destination = bindingData[index++];
bindings.push(binding);
}
@@ -105,18 +107,20 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.initCompleteHandler =
sb.sourceID = binding.source[0];
sb.sourcePropertyName = binding.source[1];
sb.setDocument(this.strand_);
- destination = this.strand_[
- binding.destination[0]];
- if (destination == null &&
- typeof(this.strand_['get_' +
- binding.destination[0]] == 'function'))
+ prop = binding.destination[0];
+
+ if (typeof(this.strand_['get_' +
+ prop]) == 'function')
destination = this.strand_[
- 'get_' + binding.destination[0]]();
+ 'get_' + prop]();
+ else
+ destination = this.strand_[prop];
+
if (destination)
destination.addBead(sb);
else
{
- this.deferredBindings[binding.destination[0]] =
+ this.deferredBindings[prop] =
sb;
this.strand_.addEventListener('valueChange',
this.deferredBindingsHandler);
@@ -132,18 +136,19 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.initCompleteHandler =
cb.sourceID = binding.source[0];
cb.sourcePropertyName = binding.source[1];
cb.setDocument(this.strand_);
- destination = this.strand_[
- binding.destination[0]];
- if (destination == null &&
- typeof(this.strand_['get_' +
- binding.destination[0]] == 'function'))
+ prop = binding.destination[0];
+ if (typeof(this.strand_['get_' +
+ prop]) == 'function')
destination = this.strand_[
- 'get_' + binding.destination[0]]();
+ 'get_' + prop]();
+ else
+ destination = this.strand_[prop];
+
if (destination)
destination.addBead(cb);
else
{
- this.deferredBindings[binding.destination[0]] =
+ this.deferredBindings[prop] =
cb;
this.strand_.addEventListener('valueChange',
this.deferredBindingsHandler);
@@ -162,17 +167,19 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.initCompleteHandler =
sb.eventName = fieldWatcher.eventNames;
sb.sourcePropertyName = binding.source;
sb.setDocument(this.strand_);
- destination = this.strand_[binding.destination[0]];
- if (destination == null &&
- typeof(this.strand_['get_' +
- binding.destination[0]] == 'function'))
+ prop = binding.destination[0];
+ if (typeof(this.strand_['get_' +
+ prop]) == 'function')
destination = this.strand_[
- 'get_' + binding.destination[0]]();
+ 'get_' + prop]();
+ else
+ destination = this.strand_[prop];
+
if (destination)
destination.addBead(sb);
else
{
- this.deferredBindings[binding.destination[0]] = sb;
+ this.deferredBindings[prop] = sb;
this.strand_.addEventListener('valueChange',
this.deferredBindingsHandler);
}
@@ -198,6 +205,7 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.makeGenericBinding =
var gb = new org.apache.flex.binding.GenericBinding();
gb.setDocument(this.strand_);
gb.destinationData = binding.destination;
+ gb.destinationFunction = binding.destFunc;
gb.source = binding.source;
this.setupWatchers(gb, index, watchers.watchers, null);
};
@@ -274,14 +282,25 @@ org.apache.flex.core.ViewBaseDataBinding.prototype.decodeWatcher =
{
watcherData = { type: 'function' };
watcherData.functionName = bindingData[index++];
+ watcherData.paramFunction = bindingData[index++];
watcherData.eventNames = bindingData[index++];
watcherData.bindings = bindingData[index++];
break;
}
case 1:
+ {
+ watcherData = { type: 'static' };
+ watcherData.propertyName = bindingData[index++];
+ watcherData.eventNames = bindingData[index++];
+ watcherData.bindings = bindingData[index++];
+ watcherData.getterFunction = bindingData[index++];
+ watcherData.parentObj = bindingData[index++];
+ watcherMap[watcherData.propertyName] = watcherData;
+ break;
+ }
case 2:
{
- watcherData = { type: type == 1 ? 'static' : 'property' };
+ watcherData = { type: 'property' };
watcherData.propertyName = bindingData[index++];
watcherData.eventNames = bindingData[index++];
watcherData.bindings = bindingData[index++];
@@ -319,15 +338,15 @@ function(event) {
var p;
for (p in this.deferredBindings)
{
- if (this.strand_[p] != null)
+ if (typeof(this.strand_['get_' + p]) == 'function')
{
- var destination = this.strand_[p];
+ var destination = this.strand_['get_' + p]();
destination.addBead(this.deferredBindings[p]);
delete deferredBindings[p];
}
- else if (typeof(this.strand_['get_' + p]) == 'function')
+ else if (this.strand_[p] != null)
{
- var destination = this.strand_['get_' + p]();
+ var destination = this.strand_[p];
destination.addBead(this.deferredBindings[p]);
delete deferredBindings[p];
}
[2/3] git commit: [flex-asjs] [refs/heads/develop] - Looks like
'somestring' is String requires special casing because string literals are
not Strings
Posted by ah...@apache.org.
Looks like 'somestring' is String requires special casing because string literals are not Strings
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/8d222fa1
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/8d222fa1
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/8d222fa1
Branch: refs/heads/develop
Commit: 8d222fa19f0247dd4671d82d0fabb24014124d91
Parents: c5bec26
Author: Alex Harui <ah...@apache.org>
Authored: Wed Nov 6 08:05:21 2013 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Wed Nov 6 08:13:21 2013 -0800
----------------------------------------------------------------------
frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/8d222fa1/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
index a4d7792..a0f0ee8 100644
--- a/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
+++ b/frameworks/js/FlexJS/src/org/apache/flex/utils/Language.js
@@ -88,7 +88,8 @@ org.apache.flex.utils.Language.is = function(leftOperand, rightOperand) {
} else if (leftOperand.FLEXJS_CLASS_INFO &&
leftOperand.FLEXJS_CLASS_INFO.interfaces) {
return checkInterfaces(leftOperand);
- }
+ } else if (rightOperand === String && typeof leftOperand === "string")
+ return true;
return false;
};