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 2014/10/06 23:34:06 UTC
[1/3] git commit: [flex-falcon] [refs/heads/develop] - MXMLC is more
forgiving parsing lists
Repository: flex-falcon
Updated Branches:
refs/heads/develop 2d127b3f6 -> 9e9b19b7c
MXMLC is more forgiving parsing lists
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d0034139
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d0034139
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d0034139
Branch: refs/heads/develop
Commit: d0034139e60abe947cdc1c7d268863163ba649dd
Parents: 2d127b3
Author: Alex Harui <ah...@apache.org>
Authored: Mon Oct 6 12:06:58 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Oct 6 12:06:58 2014 -0700
----------------------------------------------------------------------
.../flex/compiler/internal/mxml/MXMLDialect2006.java | 11 +++++++++++
1 file changed, 11 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d0034139/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDialect2006.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDialect2006.java b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDialect2006.java
index 2aad57c..d473820 100644
--- a/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDialect2006.java
+++ b/compiler/src/org/apache/flex/compiler/internal/mxml/MXMLDialect2006.java
@@ -123,6 +123,17 @@ public class MXMLDialect2006 extends MXMLDialect
@Override
public String[] splitAndTrim(String s)
{
+ // first make sure it isn't in array format
+ int c = s.indexOf('[');
+ if (c != -1)
+ s = s.substring(c + 1);
+ c = s.indexOf(']');
+ if (c != -1)
+ s = s.substring(0, c);
+
+ //check for quotes
+ s = s.replace("'", "");
+
String[] a = s.split(",");
if (a == null)
[3/3] git commit: [flex-falcon] [refs/heads/develop] - handle
state-specific events
Posted by ah...@apache.org.
handle state-specific events
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/9e9b19b7
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/9e9b19b7
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/9e9b19b7
Branch: refs/heads/develop
Commit: 9e9b19b7cf99082bcb9d7cbdb01cc3cd4ebbd7bd
Parents: b9e45b6
Author: Alex Harui <ah...@apache.org>
Authored: Mon Oct 6 12:28:28 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Oct 6 12:28:28 2014 -0700
----------------------------------------------------------------------
.../as/codegen/MXMLClassDirectiveProcessor.java | 76 +++++++++++++++-----
1 file changed, 58 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/9e9b19b7/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
index 5eb1dd0..a2f9e46 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
@@ -4483,26 +4483,66 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
Name eventHandler = getEventHandlerName(eventNode);
- // Construct the SetEventHandler object.
- context.addInstruction(OP_findpropstrict, eventOverride);
- context.addInstruction(OP_constructprop, new Object[] { eventOverride, 0 });
-
- // Set its 'target' property to the id of the object
- // whose event this override will set.
- context.addInstruction(OP_dup);
- context.addInstruction(OP_pushstring, id);
- context.addInstruction(OP_setproperty, NAME_TARGET);
+ if (getProject().getTargetSettings().getMxmlChildrenAsData())
+ {
+ // Construct the SetProperty or SetStyle object.
+ context.addInstruction(OP_findpropstrict, eventOverride);
+ context.addInstruction(OP_getproperty, eventOverride);
+
+ boolean valueIsDataBound = isDataBindingNode(eventNode.getChild(0));
+ context.pushNumericConstant(valueIsDataBound ? 2 : 3);
+ // Set its 'target' property to the id of the object
+ // whose property or style this override will set.
+ context.addInstruction(OP_pushstring, "target");
+ context.addInstruction(OP_pushtrue);
+ if (id.length() == 0)
+ context.addInstruction(OP_pushnull);
+ else
+ context.addInstruction(OP_pushstring, id);
- // Set its 'name' property to the name of the event.
- context.addInstruction(OP_dup);
- context.addInstruction(OP_pushstring, name);
- context.addInstruction(OP_setproperty, NAME_NAME);
+ // Set its 'name' property to the name of the property or style.
+ context.addInstruction(OP_pushstring, "name");
+ context.addInstruction(OP_pushtrue);
+ context.addInstruction(OP_pushstring, name);
- // Set its 'handlerFunction' property to the autogenerated event handler.
- context.addInstruction(OP_dup);
- context.addInstruction(OP_getlocal0);
- context.addInstruction(OP_getproperty, eventHandler);
- context.addInstruction(OP_setproperty, NAME_HANDLER_FUNCTION);
+ if (!valueIsDataBound)
+ {
+ // Set its 'value' property to the value of the property or style.
+ context.addInstruction(OP_pushstring, "handlerFunction");
+ context.addInstruction(OP_pushtrue);
+ context.addInstruction(OP_getlocal0);
+ context.addInstruction(OP_getproperty, eventHandler);
+ }
+
+ context.pushNumericConstant(0); // styles
+ context.pushNumericConstant(0); // effects
+ context.pushNumericConstant(0); // events
+ context.addInstruction(OP_pushnull);
+ context.incrementCounter(IL.MXML_OVERRIDE_PROPERTIES, valueIsDataBound ? 12 : 15);
+ }
+ else
+ {
+ // Construct the SetEventHandler object.
+ context.addInstruction(OP_findpropstrict, eventOverride);
+ context.addInstruction(OP_constructprop, new Object[] { eventOverride, 0 });
+
+ // Set its 'target' property to the id of the object
+ // whose event this override will set.
+ context.addInstruction(OP_dup);
+ context.addInstruction(OP_pushstring, id);
+ context.addInstruction(OP_setproperty, NAME_TARGET);
+
+ // Set its 'name' property to the name of the event.
+ context.addInstruction(OP_dup);
+ context.addInstruction(OP_pushstring, name);
+ context.addInstruction(OP_setproperty, NAME_NAME);
+
+ // Set its 'handlerFunction' property to the autogenerated event handler.
+ context.addInstruction(OP_dup);
+ context.addInstruction(OP_getlocal0);
+ context.addInstruction(OP_getproperty, eventHandler);
+ context.addInstruction(OP_setproperty, NAME_HANDLER_FUNCTION);
+ }
}
/**
[2/3] git commit: [flex-falcon] [refs/heads/develop] - change when we
set isContentFactory flag to false
Posted by ah...@apache.org.
change when we set isContentFactory flag to false
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/b9e45b60
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/b9e45b60
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/b9e45b60
Branch: refs/heads/develop
Commit: b9e45b6088faf201a3c46db148f9f079e3154b2a
Parents: d003413
Author: Alex Harui <ah...@apache.org>
Authored: Mon Oct 6 12:07:22 2014 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Mon Oct 6 12:07:22 2014 -0700
----------------------------------------------------------------------
.../internal/as/codegen/MXMLClassDirectiveProcessor.java | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/b9e45b60/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
index 8844133..5eb1dd0 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/MXMLClassDirectiveProcessor.java
@@ -3565,6 +3565,7 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
traverse(propertyNode, context);
+ context.isContentFactory = false;
context.stopUsing(IL.MXML_CONTENT_FACTORY, 0);
}
@@ -3619,8 +3620,6 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
context.addInstruction(OP_pushstring, propertyName);
- context.isContentFactory = false;
-
traverse(propertyNode, context);
context.stopUsing(IL.PROPERTIES, 1);
@@ -3843,8 +3842,6 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
// Push the first argument: the name of the style.
context.addInstruction(OP_pushstring, styleName);
- context.isContentFactory = false;
-
// Push the second argument: the value of the style.
// Do this by codegen'ing sole child, which is an IMXMLInstanceNode.
traverse(styleNode, context);
@@ -3882,8 +3879,6 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
// Push the first argument: the name of the style.
context.addInstruction(OP_pushstring, styleName);
- context.isContentFactory = false;
-
// Push the second argument: the value of the style.
// Do this by codegen'ing sole child, which is an IMXMLInstanceNode.
traverse(styleNode, context);