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/10/08 23:50:01 UTC
[01/14] git commit: [flex-falcon] [refs/heads/develop] - try to fix
vector handling by not using forward references in the name pool
Updated Branches:
refs/heads/develop b8643df18 -> 6d071f01e
try to fix vector handling by not using forward references in the name pool
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/6481dc95
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/6481dc95
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/6481dc95
Branch: refs/heads/develop
Commit: 6481dc9580dadc160d3b1bdfcfe36500987b7f0d
Parents: b8643df
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:33:58 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:55 2013 -0700
----------------------------------------------------------------------
compiler/src/org/apache/flex/abc/ABCEmitter.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6481dc95/compiler/src/org/apache/flex/abc/ABCEmitter.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/abc/ABCEmitter.java b/compiler/src/org/apache/flex/abc/ABCEmitter.java
index 7398199..93c9b1a 100644
--- a/compiler/src/org/apache/flex/abc/ABCEmitter.java
+++ b/compiler/src/org/apache/flex/abc/ABCEmitter.java
@@ -1351,8 +1351,6 @@ public final class ABCEmitter implements IABCVisitor
{
verifyEmitterStatus();
- this.namePool.add(n);
-
if (null == n)
return;
@@ -1360,6 +1358,8 @@ public final class ABCEmitter implements IABCVisitor
if (kind != ABCConstants.CONSTANT_TypeName)
{
+ this.namePool.add(n);
+
visitPooledString(n.getBaseName());
if ((kind == ABCConstants.CONSTANT_Qname) || (kind == ABCConstants.CONSTANT_QnameA))
visitPooledNamespace(n.getSingleQualifier());
@@ -1370,6 +1370,7 @@ public final class ABCEmitter implements IABCVisitor
{
visitPooledName(n.getTypeNameBase());
visitPooledName(n.getTypeNameParameter());
+ this.namePool.add(n);
}
}
[09/14] git commit: [flex-falcon] [refs/heads/develop] - move chasing
of embeds so that dependencies get resolved correctly
Posted by ah...@apache.org.
move chasing of embeds so that dependencies get resolved correctly
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/a862e39b
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/a862e39b
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/a862e39b
Branch: refs/heads/develop
Commit: a862e39b87ed5067f1765152afdad7a70ae768dd
Parents: c5ea8ec
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:53:58 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:58 2013 -0700
----------------------------------------------------------------------
.../apache/flex/compiler/internal/units/ASCompilationUnit.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/a862e39b/compiler/src/org/apache/flex/compiler/internal/units/ASCompilationUnit.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/units/ASCompilationUnit.java b/compiler/src/org/apache/flex/compiler/internal/units/ASCompilationUnit.java
index cb97c0d..5ce596a 100644
--- a/compiler/src/org/apache/flex/compiler/internal/units/ASCompilationUnit.java
+++ b/compiler/src/org/apache/flex/compiler/internal/units/ASCompilationUnit.java
@@ -542,10 +542,10 @@ public class ASCompilationUnit extends CompilationUnitBase
Collection<ICompilerProblem> problems = new ArrayList<ICompilerProblem>();
- updateEmbedCompilationUnitDependencies(fn.getEmbedNodes(), problems);
-
getABCBytesRequest().get();
+ updateEmbedCompilationUnitDependencies(fn.getEmbedNodes(), problems);
+
IOutgoingDependenciesRequestResult result = new IOutgoingDependenciesRequestResult()
{
@Override
[06/14] git commit: [flex-falcon] [refs/heads/develop] - handle
binding to non-public entities
Posted by ah...@apache.org.
handle binding to non-public entities
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/2ec7343c
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/2ec7343c
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/2ec7343c
Branch: refs/heads/develop
Commit: 2ec7343c93848f22bbdf700525dfa8f929f92433
Parents: ad066de
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:49:06 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:57 2013 -0700
----------------------------------------------------------------------
.../databinding/BindingDestinationMaker.java | 35 +++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/2ec7343c/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java
index 5740285..e68a42c 100644
--- a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java
+++ b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java
@@ -25,13 +25,28 @@ import java.util.LinkedList;
import org.apache.flex.abc.instructionlist.InstructionList;
import org.apache.flex.abc.semantics.Name;
+import org.apache.flex.abc.semantics.Namespace;
+import org.apache.flex.compiler.definitions.IDefinition;
+import org.apache.flex.compiler.definitions.references.INamespaceReference;
+import org.apache.flex.compiler.internal.as.codegen.Binding;
import org.apache.flex.compiler.internal.as.codegen.InstructionListNode;
+import org.apache.flex.compiler.internal.as.codegen.LexicalScope;
+import org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor;
+import org.apache.flex.compiler.internal.definitions.DefinitionBase;
+import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
+import org.apache.flex.compiler.internal.definitions.SetterDefinition;
+import org.apache.flex.compiler.internal.definitions.VariableDefinition;
+import org.apache.flex.compiler.projects.ICompilerProject;
+import org.apache.flex.compiler.scopes.IASScope;
+import org.apache.flex.compiler.scopes.IDefinitionSet;
import org.apache.flex.compiler.tree.as.IASNode;
import org.apache.flex.compiler.tree.as.IExpressionNode;
import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
import org.apache.flex.compiler.tree.mxml.IMXMLModelNode;
import org.apache.flex.compiler.tree.mxml.IMXMLModelPropertyNode;
import org.apache.flex.compiler.tree.mxml.IMXMLModelRootNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLPropertySpecifierNode;
+import org.apache.flex.compiler.tree.mxml.IMXMLSingleDataBindingNode;
/**
* Utility class for analyze binding destinations and making
@@ -65,7 +80,8 @@ public class BindingDestinationMaker
*
* Do this by walking up and down the tree, building up instruction list
*/
- public static IExpressionNode makeDestinationFunctionInstructionList(IMXMLDataBindingNode dbnode)
+ public static IExpressionNode makeDestinationFunctionInstructionList(IMXMLDataBindingNode dbnode,
+ MXMLClassDirectiveProcessor host)
{
IExpressionNode ret = null;
final IASNode parent = dbnode.getParent();
@@ -116,6 +132,23 @@ public class BindingDestinationMaker
ret = new InstructionListNode(insns); // Wrap the IL in a node and return it
}
+ else if (parent instanceof IMXMLPropertySpecifierNode && dbnode instanceof IMXMLSingleDataBindingNode)
+ {
+ IMXMLPropertySpecifierNode psn = (IMXMLPropertySpecifierNode)parent;
+ IDefinition d = psn.getDefinition();
+ Name mname = ((DefinitionBase)d).getMName(host.getProject());
+ Binding b = host.getInstanceScope().getBinding(d);
+ INamespaceReference ns = psn.getDefinition().getNamespaceReference();
+ Namespace n = ns.resolveAETNamespace(host.getProject());
+ if (ns != NamespaceDefinition.getPublicNamespaceDefinition())
+ {
+ InstructionList insns = new InstructionList();
+ insns.addInstruction(OP_getlocal0);
+ insns.addInstruction(OP_getlocal1);
+ insns.addInstruction(OP_setproperty, b.getName());
+ ret = new InstructionListNode(insns); // Wrap the IL in a node and return it
+ }
+ }
return ret;
}
[04/14] git commit: [flex-falcon] [refs/heads/develop] - 3 fixes: 1)
when reducing a setter and are given a getter,
to find the setter because it may have a different access (private vs public)
than the getter. 2) AIR requires a coerce_a in ternary claus
Posted by ah...@apache.org.
3 fixes: 1) when reducing a setter and are given a getter, to find the setter because it may have a different access (private vs public) than the getter. 2) AIR requires a coerce_a in ternary clauses when assigning the results to a Dictionary (and maybe other bracket accesses). Putting the coerce_a elsewhere causes AIR (and not FlashPlayer) to insert a Number, not the object. 3) When generating the assignment to a bindable var, use null as the definition so the underlying code generates a reference to the backing variable and not the generated getter.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/ec7cb598
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/ec7cb598
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/ec7cb598
Branch: refs/heads/develop
Commit: ec7cb5984c4fea85d7173411597a8c87976a296c
Parents: d4ef754
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:41:28 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:57 2013 -0700
----------------------------------------------------------------------
.../as/codegen/ABCGeneratingReducer.java | 59 +++++++++++++++++++-
1 file changed, 57 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ec7cb598/compiler/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java
index 56bac61..776993f 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ABCGeneratingReducer.java
@@ -90,6 +90,7 @@ import org.apache.flex.compiler.tree.as.IUnaryOperatorNode;
import org.apache.flex.compiler.tree.as.IWhileLoopNode;
import org.apache.flex.compiler.tree.as.IWithNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode.LanguageIdentifierKind;
+import org.apache.flex.compiler.tree.as.IOperatorNode.OperatorType;
import org.apache.flex.compiler.tree.mxml.IMXMLEventSpecifierNode;
import org.apache.flex.compiler.internal.as.codegen.LexicalScope.NestingState;
import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
@@ -102,6 +103,7 @@ import org.apache.flex.compiler.internal.definitions.SetterDefinition;
import org.apache.flex.compiler.internal.definitions.TypeDefinitionBase;
import org.apache.flex.compiler.internal.tree.as.BaseDefinitionNode;
import org.apache.flex.compiler.internal.tree.as.BinaryOperatorInNode;
+import org.apache.flex.compiler.internal.tree.as.DynamicAccessNode;
import org.apache.flex.compiler.internal.tree.as.EmbedNode;
import org.apache.flex.compiler.internal.tree.as.ExpressionNodeBase;
import org.apache.flex.compiler.internal.tree.as.ForLoopNode;
@@ -113,6 +115,7 @@ import org.apache.flex.compiler.internal.tree.as.MemberAccessExpressionNode;
import org.apache.flex.compiler.internal.tree.as.NamespaceNode;
import org.apache.flex.compiler.internal.tree.as.RegExpLiteralNode;
import org.apache.flex.compiler.internal.tree.as.SwitchNode;
+import org.apache.flex.compiler.internal.tree.as.TernaryOperatorNode;
import org.apache.flex.compiler.internal.tree.as.VariableNode;
/*
@@ -1394,6 +1397,16 @@ public class ABCGeneratingReducer
if (!inlined)
{
+ IDefinition def = target.getDefinition();
+ if (def instanceof GetterDefinition)
+ {
+ boolean isSuper = target.isSuperQualified();
+ SetterDefinition setter = (SetterDefinition)((GetterDefinition)def).
+ resolveCorrespondingAccessor(currentScope.getProject());
+ target = currentScope.getBinding(setter);
+ if (isSuper)
+ target.setSuperQualified(true);
+ }
result.addAll(currentScope.findProperty(target, false));
result.addInstruction(OP_swap);
result.addInstruction(getAssignmentOpcode(iNode, target), target.getName());
@@ -2838,15 +2851,30 @@ public class ABCGeneratingReducer
{
IDynamicAccessNode arrayIndexNode = (IDynamicAccessNode)((IBinaryOperatorNode)iNode).getLeftOperandNode();
+ /*
+ ITypeDefinition destinationType = arrayIndexNode.resolveType(currentScope.getProject());
+ IExpressionNode valueNode = ((IBinaryOperatorNode)iNode).getRightOperandNode();
+
+ IDefinition type_def = valueNode.resolveType(currentScope.getProject()); //SemanticUtils.getDefinitionOfUnderlyingType(,
+ // true, currentScope.getProject());
+ boolean need_coerce = !type_def.equals(destinationType) || (valueNode instanceof TernaryOperatorNode);
+ */
+
currentScope.getMethodBodySemanticChecker().checkAssignToBracketExpr(iNode);
+
+ int num_ins = /*need_coerce ? 2 :*/ 1;
- InstructionList result = createInstructionList(iNode, (is_super ? 1:stem.size()) + index.size() + r.size() + 1);
+ InstructionList result = createInstructionList(iNode, (is_super ? num_ins : stem.size()) + index.size() + r.size() + num_ins);
if( is_super )
result.addInstruction(OP_getlocal0);
else
result.addAll(stem);
result.addAll(index);
result.addAll(r);
+ /*
+ if (need_coerce)
+ coerce(result, destinationType);
+ */
result.addInstruction(arrayAccess(arrayIndexNode, is_super ? OP_setsuper : OP_setproperty));
return result;
@@ -5861,14 +5889,39 @@ public class ABCGeneratingReducer
public InstructionList reduce_ternaryExpr(IASNode iNode, InstructionList test, InstructionList when_true, InstructionList when_false)
{
+ // AIR (and not FlashPlayer) requires a coerce_a at the end of each clause if the results will be
+ // assigned to a Dictionary.
+ IBinaryOperatorNode binaryNode = (IBinaryOperatorNode)iNode.getAncestorOfType(IBinaryOperatorNode.class);
+ boolean isBracketAssign = binaryNode != null && binaryNode.getOperator() == OperatorType.ASSIGNMENT
+ && binaryNode.getLeftOperandNode() instanceof DynamicAccessNode;
+ ITypeDefinition destinationType = null;
+ if (isBracketAssign)
+ destinationType = binaryNode.getLeftOperandNode().resolveType(currentScope.getProject());
+ TernaryOperatorNode ternaryNode = (TernaryOperatorNode)iNode;
+
+ IExpressionNode valueNode;
+ IDefinition type_def; //= valueNode.resolveType(currentScope.getProject()); //SemanticUtils.getDefinitionOfUnderlyingType(,
+ // true, currentScope.getProject());
+ boolean need_coerce = false;
+
InstructionList result = createInstructionList(iNode, test.size() + when_true.size() + when_false.size() + 2);
Label tail = new Label();
result.addAll(test);
result.addInstruction(OP_iffalse, when_false.getLabel());
result.addAll(when_true);
+ valueNode = ternaryNode.getLeftOperandNode();
+ type_def = valueNode.resolveType(currentScope.getProject());
+ need_coerce = type_def != null && !type_def.equals(destinationType);
+ if (need_coerce && isBracketAssign)
+ coerce(result, destinationType);
result.addInstruction(OP_jump, tail);
result.addAll(when_false);
+ valueNode = ternaryNode.getRightOperandNode();
+ type_def = valueNode.resolveType(currentScope.getProject());
+ need_coerce = type_def != null && !type_def.equals(destinationType);
+ if (need_coerce && isBracketAssign)
+ coerce(result, destinationType);
result.labelNext(tail);
return result;
@@ -6118,7 +6171,9 @@ public class ABCGeneratingReducer
currentScope.getMethodBodySemanticChecker().checkBindableVariableDeclaration(iNode, vn.getDefinition());
Binding var = currentScope.resolveName((IdentifierNode)vn.getNameExpressionNode());
currentScope.makeBindableVariable(var, var_type.getName(), vn.getMetaInfos());
- InstructionList result = generateAssignment(iNode, new Binding(iNode, BindableHelper.getBackingPropertyName(var_name), vn.getDefinition()), var_initializer);
+ // pass in null as definition so the assignment goes to the backing var and not the setter
+ // maybe we'll have to get the actual var def someday.
+ InstructionList result = generateAssignment(iNode, new Binding(iNode, BindableHelper.getBackingPropertyName(var_name), null), var_initializer);
for ( InstructionList decl: chained_decls )
result.addAll(decl);
[10/14] git commit: [flex-falcon] [refs/heads/develop] - changes
required to allow [Bindable] on getters and setters. Getters and setters may
be overrides,
and only one or the other has [Bindable] metadata. The basic premise is to
search the metadata f
Posted by ah...@apache.org.
changes required to allow [Bindable] on getters and setters. Getters and setters may be overrides, and only one or the other has [Bindable] metadata. The basic premise is to search the metadata for [Bindable] (isBindable) looks up the inheritance chain which is what we don't want). We find and search the metadata for the other accessor if it exists. Then if there is [Bindable] we move the method into the bindable namespace and generate the wrapper method.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/89968c43
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/89968c43
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/89968c43
Branch: refs/heads/develop
Commit: 89968c43a14d1e0ec3b45c1f2d4004cd65ded99d
Parents: 4201746
Author: Alex Harui <ah...@apache.org>
Authored: Tue Oct 8 07:47:40 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:58 2013 -0700
----------------------------------------------------------------------
.../internal/as/codegen/BindableHelper.java | 8 ++
.../as/codegen/ClassDirectiveProcessor.java | 102 ++++++++++++++++++-
.../internal/as/codegen/LexicalScope.java | 38 ++++++-
.../definitions/AccessorDefinition.java | 16 ++-
.../internal/definitions/DefinitionBase.java | 6 ++
.../compiler/internal/projects/FlexProject.java | 10 +-
.../flex/compiler/internal/scopes/ASScope.java | 4 +-
.../internal/tree/as/BaseDefinitionNode.java | 6 +-
.../tree/as/BaseTypedDefinitionNode.java | 87 ++++++++++++++++
.../internal/tree/as/BaseVariableNode.java | 56 ----------
.../compiler/internal/tree/as/FunctionNode.java | 5 +-
11 files changed, 264 insertions(+), 74 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/as/codegen/BindableHelper.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/BindableHelper.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/BindableHelper.java
index 21f5bda..ea1e0a3 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/BindableHelper.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/BindableHelper.java
@@ -526,6 +526,13 @@ public class BindableHelper
private static final Namespace bindablePrivateNamespace = new Namespace(CONSTANT_PrivateNs, ".BindableNamespace");
/**
+ * The namespace to put compiler generated members into so that they do not conflict with any user defined
+ * members.
+ */
+ public static final NamespaceDefinition bindableNamespaceDefinition = NamespaceDefinition.createNamespaceDefinition(bindablePrivateNamespace);
+
+
+ /**
* The mx.events package namespace
*/
public static Namespace NAMESPACE_MX_EVENTS = new Namespace(CONSTANT_PackageNs, "mx.events");
@@ -556,5 +563,6 @@ public class BindableHelper
private static final Name NAME_STATIC_EVENT_DISPATCHER = new Name("staticEventDispatcher");
public static String PROPERTY_CHANGE = "propertyChange";
+ public static String BINDABLE = "Bindable";
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
index 29d2a7b..2354faa 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
@@ -52,7 +52,10 @@ import org.apache.flex.compiler.definitions.IClassDefinition;
import org.apache.flex.compiler.definitions.IConstantDefinition;
import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.IInterfaceDefinition;
+import org.apache.flex.compiler.definitions.ITypeDefinition;
import org.apache.flex.compiler.definitions.metadata.IMetaTag;
+import org.apache.flex.compiler.definitions.metadata.IMetaTagAttribute;
+import org.apache.flex.compiler.definitions.references.INamespaceReference;
import org.apache.flex.compiler.exceptions.CodegenInterruptedException;
import org.apache.flex.compiler.problems.CircularTypeReferenceProblem;
import org.apache.flex.compiler.problems.ConstructorCannotHaveReturnTypeProblem;
@@ -83,9 +86,11 @@ import org.apache.flex.compiler.tree.as.IExpressionNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode.LanguageIdentifierKind;
import org.apache.flex.compiler.internal.as.codegen.ICodeGenerator.IConstantValue;
+import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
import org.apache.flex.compiler.internal.definitions.ClassDefinition;
import org.apache.flex.compiler.internal.definitions.DefinitionBase;
import org.apache.flex.compiler.internal.definitions.FunctionDefinition;
+import org.apache.flex.compiler.internal.definitions.GetterDefinition;
import org.apache.flex.compiler.internal.definitions.InterfaceDefinition;
import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
import org.apache.flex.compiler.internal.definitions.TypeDefinitionBase;
@@ -94,6 +99,7 @@ import org.apache.flex.compiler.internal.definitions.metadata.MetaTag;
import org.apache.flex.compiler.internal.definitions.metadata.ResourceBundleMetaTag;
import org.apache.flex.compiler.internal.embedding.EmbedData;
import org.apache.flex.compiler.internal.projects.CompilerProject;
+import org.apache.flex.compiler.internal.scopes.ASScope;
import org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker;
import org.apache.flex.compiler.internal.semantics.SemanticUtils;
import org.apache.flex.compiler.internal.tree.as.BaseDefinitionNode;
@@ -532,6 +538,23 @@ class ClassDirectiveProcessor extends DirectiveProcessor
cinit_insns.addAll(this.cinitInsns);
cinit_insns.addInstruction(OP_returnvoid);
+
+ if (this.cinfo.cInit == null)
+ {
+ // Speculatively initialize the class' cinit
+ // (static class initializer routine)'s data
+ // structures; the code generator may need to
+ // store information in them.
+ this.cinfo.cInit = new MethodInfo();
+ MethodBodyInfo cinit_info = new MethodBodyInfo();
+ cinit_info.setMethodInfo(this.cinfo.cInit);
+
+ this.classStaticScope.setMethodInfo(this.cinfo.cInit);
+ this.classStaticScope.methodVisitor = emitter.visitMethod(this.cinfo.cInit);
+ this.classStaticScope.methodVisitor.visit();
+ this.classStaticScope.methodBodyVisitor = this.classStaticScope.methodVisitor.visitBody(cinit_info);
+ this.classStaticScope.methodBodyVisitor.visit();
+ }
/*
* FIXME: NPE while compiling 'spark.swc'
@@ -650,6 +673,52 @@ class ClassDirectiveProcessor extends DirectiveProcessor
final FunctionDefinition funcDef = func.getDefinition();
final boolean is_constructor = func.isConstructor();
+
+ ICompilerProject project = classScope.getProject();
+
+ boolean isBindable = false;
+ if (funcDef instanceof AccessorDefinition)
+ {
+ IMetaTag[] metaTags = funcDef.getAllMetaTags();
+ for (IMetaTag metaTag : metaTags)
+ {
+ if (metaTag.getTagName().equals(BindableHelper.BINDABLE))
+ {
+ IMetaTagAttribute[] attrs = metaTag.getAllAttributes();
+ isBindable = attrs.length == 0;
+ }
+ }
+ if (!isBindable)
+ {
+ AccessorDefinition otherDef =
+ ((AccessorDefinition)funcDef).resolveCorrespondingAccessor(classScope.getProject());
+ // ignore if not in your class def
+ if (otherDef != null && otherDef.getContainingScope().equals(funcDef.getContainingScope()))
+ {
+ metaTags = otherDef.getAllMetaTags();
+ for (IMetaTag metaTag : metaTags)
+ {
+ if (metaTag.getTagName().equals(BindableHelper.BINDABLE))
+ {
+ IMetaTagAttribute[] attrs = metaTag.getAllAttributes();
+ isBindable = attrs.length == 0;
+ }
+ }
+ }
+ }
+ }
+ Name funcName = funcDef.getMName(classScope.getProject());
+ Name bindableName = null;
+ boolean wasOverride = false;
+ if (isBindable)
+ {
+ // move function into bindable namespace
+ bindableName = BindableHelper.getBackingPropertyName(funcName);
+ INamespaceReference ns = BindableHelper.bindableNamespaceDefinition;
+ wasOverride = funcDef.isOverride();
+ funcDef.setNamespaceReference(ns);
+ funcDef.unsetOverride();
+ }
functionSemanticChecks(func);
@@ -675,8 +744,8 @@ class ClassDirectiveProcessor extends DirectiveProcessor
if ( mi != null )
{
- Name funcName = funcDef.getMName(classScope.getProject());
- ITraitVisitor tv = ls.traitsVisitor.visitMethodTrait(functionTraitKind(func, TRAIT_Method), funcName, 0, mi);
+ ITraitVisitor tv = ls.traitsVisitor.visitMethodTrait(functionTraitKind(func, TRAIT_Method),
+ bindableName != null ? bindableName : funcName, 0, mi);
if (funcName != null)
classScope.getMethodBodySemanticChecker().checkFunctionForConflictingDefinitions(func, funcDef);
@@ -689,11 +758,38 @@ class ClassDirectiveProcessor extends DirectiveProcessor
if ( func.hasModifier(ASModifier.FINAL))
tv.visitAttribute(Trait.TRAIT_FINAL, Boolean.TRUE);
- if ( func.hasModifier(ASModifier.OVERRIDE) || funcDef.isOverride())
+ // don't set override if we've moved it to the bindable namespace
+ if (!wasOverride && (func.hasModifier(ASModifier.OVERRIDE) || funcDef.isOverride()))
tv.visitAttribute(Trait.TRAIT_OVERRIDE, Boolean.TRUE);
tv.visitEnd();
}
}
+ if (isBindable)
+ {
+ if (wasOverride)
+ funcDef.setOverride();
+ if (funcDef instanceof GetterDefinition)
+ {
+ DefinitionBase bindableGetter = func.buildBindableGetter(func.getName());
+ ASScope funcScope = (ASScope)funcDef.getContainingScope();
+ funcScope.addDefinition(bindableGetter);
+ LexicalScope ls = funcDef.isStatic()? classStaticScope: classScope;
+ ls.generateBindableGetter(bindableGetter, funcName, bindableName,
+ funcDef.resolveType(project).getMName(project), getAllMetaTags(funcDef));
+ }
+ else
+ {
+ TypeDefinitionBase typeDef = funcDef.resolveType(project);
+ ASScope funcScope = (ASScope)funcDef.getContainingScope();
+ DefinitionBase bindableSetter = func.buildBindableSetter(func.getName(),
+ funcScope,
+ funcDef.getTypeReference());
+ funcScope.addDefinition(bindableSetter);
+ LexicalScope ls = funcDef.isStatic()? classStaticScope: classScope;
+ ls.generateBindableSetter(bindableSetter, funcName, bindableName,
+ typeDef.getMName(project), getAllMetaTags(funcDef));
+ }
+ }
}
/**
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/as/codegen/LexicalScope.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/LexicalScope.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/LexicalScope.java
index d8128a2..92a2973 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/LexicalScope.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/LexicalScope.java
@@ -44,6 +44,7 @@ import org.apache.flex.abc.semantics.Name;
import org.apache.flex.abc.semantics.Namespace;
import org.apache.flex.abc.semantics.Nsset;
import org.apache.flex.abc.semantics.PooledValue;
+import org.apache.flex.abc.semantics.Trait;
import org.apache.flex.abc.visitors.IABCVisitor;
import org.apache.flex.abc.visitors.IMetadataVisitor;
import org.apache.flex.abc.visitors.IMethodBodyVisitor;
@@ -59,6 +60,7 @@ import org.apache.flex.compiler.definitions.metadata.IMetaTag;
import org.apache.flex.compiler.definitions.metadata.IMetaTagAttribute;
import org.apache.flex.compiler.internal.definitions.DefinitionBase;
import org.apache.flex.compiler.internal.definitions.metadata.MetaTag;
+import org.apache.flex.compiler.internal.definitions.metadata.MetaTagAttribute;
import org.apache.flex.compiler.internal.semantics.MethodBodySemanticChecker;
import org.apache.flex.compiler.internal.semantics.SemanticUtils;
import org.apache.flex.compiler.internal.tree.as.BaseVariableNode;
@@ -627,10 +629,16 @@ public class LexicalScope
var_type,
noInitializer
);
- ITraitVisitor getterTv = BindableHelper.generateBindableGetter(this, var_name, backingPropertyName, var_type);
-
IDefinition bindableVarDef = var.getDefinition();
+ generateBindableGetter(bindableVarDef, var_name, backingPropertyName, var_type, metaTags);
+ generateBindableSetter(bindableVarDef, var_name, backingPropertyName, var_type, metaTags);
+ }
+
+ public void generateBindableGetter(IDefinition bindableVarDef, Name var_name, Name backingPropertyName, Name var_type, IMetaInfo[] metaTags)
+ {
+ ITraitVisitor getterTv = BindableHelper.generateBindableGetter(this, var_name, backingPropertyName, var_type);
+
IMetaTag gotoDefinitionMetaTag = MetaTag.createGotoDefinitionHelp(bindableVarDef,
bindableVarDef.getContainingFilePath(),
Integer.toString(bindableVarDef.getNameStart()), false);
@@ -639,6 +647,9 @@ public class LexicalScope
// If we have an IMetaTagsNode use that, otherwise get the metadata from the definition
processMetadata(getterTv, metaTags);
+ if (bindableVarDef.isOverride())
+ getterTv.visitAttribute(Trait.TRAIT_OVERRIDE, Boolean.TRUE);
+
// We don't codegen classes in parallel right now,
// so we know that we are on the main code generation thread
// because bindable variables are always members of a class.
@@ -646,9 +657,23 @@ public class LexicalScope
// call visitEnd here and the vistEnd calls in generateBindableSetter
// are ok too.
getterTv.visitEnd();
- ITraitVisitor setterTv = BindableHelper.generateBindableSetter(this, var_name, backingPropertyName, var_type, var.getDefinition());
+ }
+
+ public void generateBindableSetter(IDefinition bindableVarDef, Name var_name, Name backingPropertyName, Name var_type, IMetaInfo[] metaTags)
+ {
+
+ ITraitVisitor setterTv = BindableHelper.generateBindableSetter(this, var_name, backingPropertyName, var_type, bindableVarDef);
+
+ IMetaTag gotoDefinitionMetaTag = MetaTag.createGotoDefinitionHelp(bindableVarDef,
+ bindableVarDef.getContainingFilePath(),
+ Integer.toString(bindableVarDef.getNameStart()), false);
+ metaTags = MetaTag.addMetaTag(metaTags, gotoDefinitionMetaTag);
+
+ processMetadata(setterTv, metaTags);
- processMetadata(setterTv, new IMetaInfo[] { gotoDefinitionMetaTag });
+ if (bindableVarDef.isOverride())
+ setterTv.visitAttribute(Trait.TRAIT_OVERRIDE, Boolean.TRUE);
+
setterTv.visitEnd();
}
@@ -1766,6 +1791,11 @@ public class LexicalScope
String name = meta_info.getTagName();
IMetaTagAttribute[] attrs = meta_info.getAllAttributes();
+ if (name.equals(BindableHelper.BINDABLE) && attrs.length == 0)
+ {
+ attrs = new MetaTagAttribute[1];
+ attrs[0] = new MetaTagAttribute("event", BindableHelper.PROPERTY_CHANGE);
+ }
String[] keys = new String[attrs.length];
String[] values = new String[attrs.length];
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java b/compiler/src/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
index 75e9d5e..aadd143 100644
--- a/compiler/src/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
+++ b/compiler/src/org/apache/flex/compiler/internal/definitions/AccessorDefinition.java
@@ -36,6 +36,7 @@ import org.apache.flex.compiler.scopes.IDefinitionSet;
import org.apache.flex.compiler.tree.as.IVariableNode;
import org.apache.flex.compiler.definitions.IScopedDefinition;
import org.apache.flex.compiler.definitions.references.INamespaceReference;
+import org.apache.flex.compiler.internal.as.codegen.BindableHelper;
import org.apache.flex.compiler.internal.scopes.ASScope;
/**
@@ -136,6 +137,8 @@ public abstract class AccessorDefinition extends FunctionDefinition implements I
final INamespaceDefinition thisNamespaceDef = namespaceReference.resolveNamespaceReference(project);
if (thisNamespaceDef == null)
return null;
+ final boolean isBindable = ((NamespaceDefinition)thisNamespaceDef).getAETNamespace().getName().equals(
+ BindableHelper.bindableNamespaceDefinition.getAETNamespace().getName());
final IDefinitionSet definitionSet = scope.getLocalDefinitionSetByName(name);
@@ -158,13 +161,16 @@ public abstract class AccessorDefinition extends FunctionDefinition implements I
if (this instanceof IGetterDefinition && definition instanceof ISetterDefinition ||
this instanceof ISetterDefinition && definition instanceof IGetterDefinition)
{
- /* aharui: namespaces shouldn't have to match. A subclass may only override
- * one of the protected methods, and it was legal to have a public getter with
- * a protected setter and other combinations like that
- // The namespace must match or it isn't considering to correspond.
INamespaceReference testDefRef = definition.getNamespaceReference();
INamespaceDefinition testNamespaceDef = testDefRef.resolveNamespaceReference(project);
- if (thisNamespaceDef.equals(testNamespaceDef)) */
+ final boolean testBindable = ((NamespaceDefinition)testNamespaceDef).getAETNamespace().getName().equals(
+ BindableHelper.bindableNamespaceDefinition.getAETNamespace().getName());
+ /* aharui: namespaces shouldn't have to match. A subclass may only override
+ * one of the protected methods, and it was legal to have a public getter with
+ * a protected setter and other combinations like that. Either both
+ * have to be in the bindable namespace, or both are not. */
+ if ((isBindable && testBindable) ||
+ (!isBindable && !testBindable))
return (AccessorDefinition)definition;
}
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/definitions/DefinitionBase.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/definitions/DefinitionBase.java b/compiler/src/org/apache/flex/compiler/internal/definitions/DefinitionBase.java
index c3ae2dd..3bf6df9 100644
--- a/compiler/src/org/apache/flex/compiler/internal/definitions/DefinitionBase.java
+++ b/compiler/src/org/apache/flex/compiler/internal/definitions/DefinitionBase.java
@@ -662,6 +662,12 @@ public abstract class DefinitionBase implements IDocumentableDefinition, IDefini
flags |= FLAG_OVERRIDE;
}
+ public void unsetOverride()
+ {
+ if (isOverride())
+ flags -= FLAG_OVERRIDE;
+ }
+
@Override
public boolean isStatic()
{
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java b/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
index f12f47a..2b525b9 100644
--- a/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
+++ b/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
@@ -45,15 +45,19 @@ import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.IEffectDefinition;
import org.apache.flex.compiler.definitions.IEventDefinition;
import org.apache.flex.compiler.definitions.IGetterDefinition;
+import org.apache.flex.compiler.definitions.INamespaceDefinition;
import org.apache.flex.compiler.definitions.ISetterDefinition;
import org.apache.flex.compiler.definitions.IStyleDefinition;
import org.apache.flex.compiler.definitions.IVariableDefinition;
+import org.apache.flex.compiler.definitions.references.INamespaceReference;
import org.apache.flex.compiler.definitions.references.IResolvedQualifiersReference;
import org.apache.flex.compiler.definitions.references.ReferenceFactory;
import org.apache.flex.compiler.exceptions.LibraryCircularDependencyException;
import org.apache.flex.compiler.filespecs.IFileSpecification;
+import org.apache.flex.compiler.internal.as.codegen.BindableHelper;
import org.apache.flex.compiler.internal.css.CSSManager;
import org.apache.flex.compiler.internal.definitions.ClassDefinition;
+import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
import org.apache.flex.compiler.internal.definitions.PackageDefinition;
import org.apache.flex.compiler.internal.mxml.MXMLDialect;
import org.apache.flex.compiler.internal.mxml.MXMLManifestManager;
@@ -1295,9 +1299,13 @@ public class FlexProject extends ASProject implements IFlexProject
// Can MXML set mx_internal properties if you've done
// 'use namesapce mx_internal' in a <Script>?
winner = definition;
+ final INamespaceReference namespaceReference = definition.getNamespaceReference();
+ final INamespaceDefinition thisNamespaceDef = namespaceReference.resolveNamespaceReference(this);
+ final boolean isBindable = ((NamespaceDefinition)thisNamespaceDef).getAETNamespace().getName().equals(
+ BindableHelper.bindableNamespaceDefinition.getAETNamespace().getName());
// if we find a setter always take it, otherwise
// keep looking for a setter
- if (winner instanceof ISetterDefinition)
+ if (winner instanceof ISetterDefinition && !isBindable)
break;
}
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/scopes/ASScope.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/scopes/ASScope.java b/compiler/src/org/apache/flex/compiler/internal/scopes/ASScope.java
index ff7aff7..84b6aa1 100644
--- a/compiler/src/org/apache/flex/compiler/internal/scopes/ASScope.java
+++ b/compiler/src/org/apache/flex/compiler/internal/scopes/ASScope.java
@@ -1682,7 +1682,9 @@ public abstract class ASScope extends ASScopeBase
{
IDefinition definition = project.getBuiltinType(builtinType);
- if( definition != null && builtinType != IASLanguageConstants.BuiltinType.ANY_TYPE )
+ if( definition != null &&
+ builtinType != IASLanguageConstants.BuiltinType.ANY_TYPE &&
+ builtinType != IASLanguageConstants.BuiltinType.VOID)
{
ASProjectScope projectScope = project.getScope();
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseDefinitionNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseDefinitionNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseDefinitionNode.java
index 86c53d4..2563416 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseDefinitionNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseDefinitionNode.java
@@ -377,7 +377,7 @@ public abstract class BaseDefinitionNode extends TreeNode implements IDocumentab
*
* @param db
*/
- void fillInNamespaceAndModifiers(DefinitionBase db)
+ protected void fillInNamespaceAndModifiers(DefinitionBase db)
{
INamespaceReference namespaceReference = NamespaceDefinition.createNamespaceReference(
getASScope(), getNamespaceNode(), this.hasModifier(ASModifier.STATIC));
@@ -387,7 +387,7 @@ public abstract class BaseDefinitionNode extends TreeNode implements IDocumentab
fillInModifiers(db);
}
- void fillInModifiers(DefinitionBase db)
+ protected void fillInModifiers(DefinitionBase db)
{
this.setDefinition(db);
@@ -403,7 +403,7 @@ public abstract class BaseDefinitionNode extends TreeNode implements IDocumentab
db.setStatic();
}
- void fillInMetadata(DefinitionBase definition)
+ protected void fillInMetadata(DefinitionBase definition)
{
IMetaTagsNode metaTagsNode = getMetaTagsNode();
if (metaTagsNode == null)
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java
index 3304f05..8bfc6f6 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java
@@ -19,11 +19,28 @@
package org.apache.flex.compiler.internal.tree.as;
+import org.apache.flex.compiler.common.ASModifier;
+import org.apache.flex.compiler.constants.IASLanguageConstants;
+import org.apache.flex.compiler.definitions.metadata.IMetaTag;
+import org.apache.flex.compiler.definitions.references.INamespaceReference;
+import org.apache.flex.compiler.definitions.references.IReference;
+import org.apache.flex.compiler.definitions.references.ReferenceFactory;
+import org.apache.flex.compiler.internal.definitions.DefinitionBase;
+import org.apache.flex.compiler.internal.definitions.GetterDefinition;
+import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
+import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
+import org.apache.flex.compiler.internal.definitions.SetterDefinition;
+import org.apache.flex.compiler.internal.definitions.SyntheticBindableGetterDefinition;
+import org.apache.flex.compiler.internal.definitions.SyntheticBindableSetterDefinition;
+import org.apache.flex.compiler.internal.scopes.ASScope;
+import org.apache.flex.compiler.internal.scopes.FunctionScope;
+import org.apache.flex.compiler.internal.tree.as.metadata.MetaTagsNode;
import org.apache.flex.compiler.parsing.IASToken;
import org.apache.flex.compiler.tree.as.IIdentifierNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
import org.apache.flex.compiler.tree.as.ITypedNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode.LanguageIdentifierKind;
+import org.apache.flex.compiler.tree.metadata.IMetaTagsNode;
/**
* Base class for definitions that have a type associated with them
@@ -139,4 +156,74 @@ public abstract class BaseTypedDefinitionNode extends BaseDefinitionNode impleme
typeNode = variableType;
}
+
+ /**
+ * Helper method to fill in a definition with appropriate metadata &
+ * namespace stuff. Used by both buildDefinition and
+ * buildBindableDefinitions
+ *
+ * @param definition the definition to "fill in"
+ */
+ protected void fillinDefinition(DefinitionBase definition)
+ {
+ definition.setNode(this);
+
+ fillInNamespaceAndModifiers(definition);
+ fillInMetadata(definition);
+
+ // Set the variable's type. If a type annotation doesn't appear in the source,
+ // the variable type in the definition will be null.
+ IReference typeRef = hasExplicitType() ? typeNode.computeTypeReference() : null;
+ definition.setTypeReference(typeRef);
+ }
+
+ public DefinitionBase buildBindableGetter(String definitionName)
+ {
+ GetterDefinition getter = new SyntheticBindableGetterDefinition(definitionName);
+ fillinDefinition(getter);
+
+ // set up the return type for the getter
+ IReference typeRef = getter.getTypeReference();
+ getter.setReturnTypeReference(typeRef);
+
+ return getter;
+ }
+
+ public DefinitionBase buildBindableSetter(String definitionName, ASScope containingScope, IReference typeRef)
+ {
+ SetterDefinition setter = new SyntheticBindableSetterDefinition(definitionName);
+
+ fillinDefinition(setter);
+
+ // Set up the params for the setter
+ ParameterDefinition param = new ParameterDefinition("");
+ param.setTypeReference(typeRef);
+ setter.setParameters(new ParameterDefinition[] {param});
+ setter.setTypeReference(typeRef);
+ ASScope setterContainedScope = new FunctionScope(containingScope);
+ setter.setContainedScope(setterContainedScope);
+ setterContainedScope.addDefinition(param);
+ setter.setReturnTypeReference(ReferenceFactory.builtinReference(IASLanguageConstants.BuiltinType.VOID));
+
+ return setter;
+ }
+
+ /**
+ * Build the definitions for a bindable variable that needs a generated
+ * getter/setter.
+ *
+ * @return An Array with all of the definitions built for this Node.
+ */
+ DefinitionBase[] buildBindableDefinitions(ASScope containingScope)
+ {
+ String definitionName = nameNode.computeSimpleReference();
+
+ DefinitionBase[] definitions = new DefinitionBase[2];
+ definitions[0] = buildBindableGetter(definitionName);
+ definitions[1] = buildBindableSetter(definitionName, containingScope, definitions[0].getTypeReference());
+
+ return definitions;
+ }
+
+
}
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java
index a6ccb2a..3ce33b6 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java
@@ -316,62 +316,6 @@ public abstract class BaseVariableNode extends BaseTypedDefinitionNode implement
}
/**
- * Helper method to fill in a definition with appropriate metadata &
- * namespace stuff. Used by both buildDefinition and
- * buildBindableDefinitions
- *
- * @param definition the definition to "fill in"
- */
- private void fillinDefinition(DefinitionBase definition)
- {
- definition.setNode(this);
-
- fillInNamespaceAndModifiers(definition);
- fillInMetadata(definition);
-
- // Set the variable's type. If a type annotation doesn't appear in the source,
- // the variable type in the definition will be null.
- IReference typeRef = hasExplicitType() ? typeNode.computeTypeReference() : null;
- definition.setTypeReference(typeRef);
- }
-
- /**
- * Build the definitions for a bindable variable that needs a generated
- * getter/setter.
- *
- * @return An Array with all of the definitions built for this Node.
- */
- DefinitionBase[] buildBindableDefinitions(ASScope containingScope)
- {
- String definitionName = nameNode.computeSimpleReference();
-
- GetterDefinition getter = new SyntheticBindableGetterDefinition(definitionName);
- SetterDefinition setter = new SyntheticBindableSetterDefinition(definitionName);
-
- fillinDefinition(getter);
- fillinDefinition(setter);
-
- // set up the return type for the getter
- IReference typeRef = getter.getTypeReference();
- getter.setReturnTypeReference(typeRef);
-
- // Set up the params for the setter
- ParameterDefinition param = new ParameterDefinition("");
- param.setTypeReference(typeRef);
- setter.setParameters(new ParameterDefinition[] {param});
- setter.setTypeReference(typeRef);
- ASScope setterContainedScope = new FunctionScope(containingScope);
- setter.setContainedScope(setterContainedScope);
- setterContainedScope.addDefinition(param);
-
- DefinitionBase[] definitions = new DefinitionBase[2];
- definitions[0] = getter;
- definitions[1] = setter;
-
- return definitions;
- }
-
- /**
* Does this variable node need to construct a special definition this is
* true for variables that have bindable metadata and no attributes, or are
* "public" and inside of a ClassNode with bindable metadata with no
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/89968c43/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java
index 07b630f..77a79ba 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java
@@ -205,6 +205,7 @@ public class FunctionNode extends BaseTypedDefinitionNode implements IFunctionNo
if (set.contains(PostProcessStep.POPULATE_SCOPE))
{
FunctionDefinition definition = buildDefinition();
+ boolean isBindable = definition.isBindable();
setDefinition(definition);
// if the parent is an anonymous function, then don't add the function definition to the scope
@@ -246,7 +247,9 @@ public class FunctionNode extends BaseTypedDefinitionNode implements IFunctionNo
{
scope = functionDef.getContainedScope();
ScopedBlockNode contents = contentsPart.getContents();
- if (contents != null)
+ // scope can be null for generated binding wrappers of
+ // getters and setters
+ if (contents != null && scope != null)
{
contents.reconnectScope(scope);
}
[11/14] git commit: [flex-falcon] [refs/heads/develop] - update title
of SWFDump
Posted by ah...@apache.org.
update title of SWFDump
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/4201746f
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/4201746f
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/4201746f
Branch: refs/heads/develop
Commit: 4201746f5e5ee709fd45c0674ac333a90f2de62a
Parents: a862e39
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:54:37 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:58 2013 -0700
----------------------------------------------------------------------
compiler/src/org/apache/flex/swf/io/SWFDump.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/4201746f/compiler/src/org/apache/flex/swf/io/SWFDump.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/swf/io/SWFDump.java b/compiler/src/org/apache/flex/swf/io/SWFDump.java
index 5a8651b..df25eec 100644
--- a/compiler/src/org/apache/flex/swf/io/SWFDump.java
+++ b/compiler/src/org/apache/flex/swf/io/SWFDump.java
@@ -2383,7 +2383,7 @@ public final class SWFDump
public static void main(String[] args) throws IOException
{
// This message should not be localized.
- System.err.println("Apache SWF Dump Utility");
+ System.err.println("Apache Flex SWF Dump Utility");
System.err.println(VersionInfo.buildMessage());
System.err.println("");
[08/14] git commit: [flex-falcon] [refs/heads/develop] - handle
properties of type Vector or Array that don't have explicit fx:Vector or
fx:Array subtags
Posted by ah...@apache.org.
handle properties of type Vector or Array that don't have explicit fx:Vector or fx:Array subtags
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/c5ea8ecb
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/c5ea8ecb
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/c5ea8ecb
Branch: refs/heads/develop
Commit: c5ea8ecb8aea4e2b2097a35de9b8cb961c493499
Parents: 838cbbe
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:52:57 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:58 2013 -0700
----------------------------------------------------------------------
.../tree/mxml/MXMLPropertySpecifierNode.java | 91 +++++++++++++++++++-
1 file changed, 89 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/c5ea8ecb/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
index 3815d94..5ffd3aa 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
@@ -19,6 +19,7 @@
package org.apache.flex.compiler.internal.tree.mxml;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.EnumSet;
import java.util.List;
@@ -36,6 +37,7 @@ import org.apache.flex.compiler.internal.projects.FlexProject;
import org.apache.flex.compiler.internal.scopes.ASScope;
import org.apache.flex.compiler.internal.scopes.MXMLFileScope;
import org.apache.flex.compiler.internal.tree.as.NodeBase;
+import org.apache.flex.compiler.internal.tree.mxml.MXMLNodeBase.MXMLNodeInfo;
import org.apache.flex.compiler.mxml.IMXMLTagAttributeData;
import org.apache.flex.compiler.mxml.IMXMLTagData;
import org.apache.flex.compiler.mxml.IMXMLTextData;
@@ -257,6 +259,59 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
}
/**
+ * This override makes sure that array and vectors have a child tag
+ * of fx:Array or fx:Vector, or fakes that condition.
+ */
+ @Override
+ protected void initializeFromTag(MXMLTreeBuilder builder, IMXMLTagData tag)
+ {
+ MXMLNodeInfo info = createNodeInfo(builder);
+
+ String propertyTypeName = getPropertyTypeName(builder);
+
+ if (propertyTypeName.contains(IASLanguageConstants.Vector + ".<") ||
+ propertyTypeName.equals(IASLanguageConstants.Array))
+ {
+ // Process each content unit.
+ for (IMXMLUnitData unit = tag.getFirstChildUnit(); unit != null; unit = unit.getNextSiblingUnit())
+ {
+ if (unit instanceof IMXMLTagData)
+ {
+ IMXMLTagData unitTag = (IMXMLTagData)unit;
+ IDefinition definition = builder.getFileScope().resolveTagToDefinition(unitTag);
+ if (propertyTypeName.contains(IASLanguageConstants.Vector + ".<") &&
+ !definition.getQualifiedName().contains(IASLanguageConstants.Vector + ".<"))
+ {
+ initializeDefaultProperty(builder, (IVariableDefinition)getDefinition(),
+ getListOfUnits(tag));
+ return;
+ }
+ else if (propertyTypeName.equals(IASLanguageConstants.Array) &&
+ !definition.getQualifiedName().equals(IASLanguageConstants.Array))
+ {
+ initializeDefaultProperty(builder, (IVariableDefinition)getDefinition(),
+ getListOfUnits(tag));
+ return;
+ }
+ }
+ }
+ }
+ super.initializeFromTag(builder, tag);
+ }
+
+ List<IMXMLUnitData> getListOfUnits(IMXMLTagData tag)
+ {
+ ArrayList<IMXMLUnitData> list = new ArrayList<IMXMLUnitData>();
+
+ // Process each content unit.
+ for (IMXMLUnitData unit = tag.getFirstChildUnit(); unit != null; unit = unit.getNextSiblingUnit())
+ {
+ list.add(unit);
+ }
+ return list;
+ }
+
+ /**
* This override handles text specifying a default property.
*/
@Override
@@ -298,14 +353,16 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
((MXMLDeferredInstanceNode)instanceNode).initializeDefaultProperty(
builder, defaultPropertyDefinition, contentUnits);
}
- else if (propertyTypeName.equals(IASLanguageConstants.Array))
+ else if (propertyTypeName.equals(IASLanguageConstants.Array) &&
+ oneChildIsNotArray(builder, contentUnits))
{
// Create an implicit array node.
instanceNode = new MXMLArrayNode(this);
((MXMLArrayNode)instanceNode).initializeDefaultProperty(
builder, defaultPropertyDefinition, contentUnits);
}
- else if (propertyTypeName.contains(IASLanguageConstants.Vector + ".<"))
+ else if (propertyTypeName.contains(IASLanguageConstants.Vector + ".<") &&
+ oneChildIsNotVector(builder, contentUnits))
{
// Create an implicit array node.
instanceNode = new MXMLVectorNode(this);
@@ -325,6 +382,36 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
}
}
}
+
+ private boolean oneChildIsNotArray(MXMLTreeBuilder builder, List<IMXMLUnitData> contentUnits)
+ {
+ if (contentUnits.size() != 1)
+ return true;
+
+ if (contentUnits.get(0) instanceof IMXMLTagData)
+ {
+ IMXMLTagData tag = (IMXMLTagData)contentUnits.get(0);
+ IDefinition definition = builder.getFileScope().resolveTagToDefinition(tag);
+ if (definition.getQualifiedName().equals(IASLanguageConstants.Array))
+ return false;
+ }
+ return true;
+ }
+
+ private boolean oneChildIsNotVector(MXMLTreeBuilder builder, List<IMXMLUnitData> contentUnits)
+ {
+ if (contentUnits.size() != 1)
+ return true;
+
+ if (contentUnits.get(0) instanceof IMXMLTagData)
+ {
+ IMXMLTagData tag = (IMXMLTagData)contentUnits.get(0);
+ IDefinition definition = builder.getFileScope().resolveTagToDefinition(tag);
+ if (definition.getQualifiedName().contains(IASLanguageConstants.Vector + ".<"))
+ return false;
+ }
+ return true;
+ }
/**
* This override handles a child tag in a property tag, such as
[02/14] git commit: [flex-falcon] [refs/heads/develop] - Try to fix
vector handling of nested vectors. Forward reference chasing has to be
recursive, not just a one-level search
Posted by ah...@apache.org.
Try to fix vector handling of nested vectors. Forward reference chasing has to be recursive, not just a one-level search
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/d4ef754a
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/d4ef754a
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/d4ef754a
Branch: refs/heads/develop
Commit: d4ef754a98d066085db0d37bf70a66af02c28b01
Parents: 6481dc9
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:35:28 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:56 2013 -0700
----------------------------------------------------------------------
compiler/src/org/apache/flex/abc/ABCParser.java | 21 +++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/d4ef754a/compiler/src/org/apache/flex/abc/ABCParser.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/abc/ABCParser.java b/compiler/src/org/apache/flex/abc/ABCParser.java
index 8aa64bb..fbacda6 100644
--- a/compiler/src/org/apache/flex/abc/ABCParser.java
+++ b/compiler/src/org/apache/flex/abc/ABCParser.java
@@ -235,7 +235,8 @@ public class ABCParser
Name name;
int name_pos = p.pos;
names[i] = name = readName(p);
- if (name.isTypeName() && (name.getTypeNameBase() == null || name.getTypeNameParameter() == null))
+ if (name.isTypeName() &&
+ usesForwardReference(name))
{
// If this typename refers to names later in the table, we need to reprocess them later
// after the entire table has been read in
@@ -353,6 +354,24 @@ public class ABCParser
vabc.visitEnd();
}
+ private boolean usesForwardReference(Name name)
+ {
+ Name nameBase = name.getTypeNameBase();
+ Name nameParam = name.getTypeNameParameter();
+ if (nameBase == null || nameParam == null)
+ return true;
+
+ if (nameBase != null && nameBase.isTypeName() &&
+ usesForwardReference(nameBase))
+ return true;
+
+ if (nameParam != null && nameParam.isTypeName() &&
+ usesForwardReference(nameParam))
+ return true;
+
+ return false;
+ }
+
/**
* Simple struct to keep track of Names, and where in the abc they come from
*/
[13/14] git commit: [flex-falcon] [refs/heads/develop] - clean up
warnings
Posted by ah...@apache.org.
clean up warnings
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/7641a69e
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/7641a69e
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/7641a69e
Branch: refs/heads/develop
Commit: 7641a69e3129adf03d8b018b2fda5ae9491b50ce
Parents: a997ce6
Author: Alex Harui <ah...@apache.org>
Authored: Tue Oct 8 13:42:02 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:59 2013 -0700
----------------------------------------------------------------------
.../internal/as/codegen/ClassDirectiveProcessor.java | 1 -
.../codegen/databinding/BindingDestinationMaker.java | 10 ----------
.../internal/tree/as/BaseTypedDefinitionNode.java | 6 ------
.../flex/compiler/internal/tree/as/BaseVariableNode.java | 7 -------
.../flex/compiler/internal/tree/as/FunctionNode.java | 1 -
.../internal/tree/mxml/MXMLPropertySpecifierNode.java | 3 ---
6 files changed, 28 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7641a69e/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
index 1b09064..bf162bb 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
@@ -54,7 +54,6 @@ import org.apache.flex.compiler.definitions.IClassDefinition;
import org.apache.flex.compiler.definitions.IConstantDefinition;
import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.IInterfaceDefinition;
-import org.apache.flex.compiler.definitions.ITypeDefinition;
import org.apache.flex.compiler.definitions.metadata.IMetaTag;
import org.apache.flex.compiler.definitions.metadata.IMetaTagAttribute;
import org.apache.flex.compiler.definitions.references.INamespaceReference;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7641a69e/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java
index e68a42c..0e78d5d 100644
--- a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java
+++ b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingDestinationMaker.java
@@ -25,20 +25,12 @@ import java.util.LinkedList;
import org.apache.flex.abc.instructionlist.InstructionList;
import org.apache.flex.abc.semantics.Name;
-import org.apache.flex.abc.semantics.Namespace;
import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.references.INamespaceReference;
import org.apache.flex.compiler.internal.as.codegen.Binding;
import org.apache.flex.compiler.internal.as.codegen.InstructionListNode;
-import org.apache.flex.compiler.internal.as.codegen.LexicalScope;
import org.apache.flex.compiler.internal.as.codegen.MXMLClassDirectiveProcessor;
-import org.apache.flex.compiler.internal.definitions.DefinitionBase;
import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
-import org.apache.flex.compiler.internal.definitions.SetterDefinition;
-import org.apache.flex.compiler.internal.definitions.VariableDefinition;
-import org.apache.flex.compiler.projects.ICompilerProject;
-import org.apache.flex.compiler.scopes.IASScope;
-import org.apache.flex.compiler.scopes.IDefinitionSet;
import org.apache.flex.compiler.tree.as.IASNode;
import org.apache.flex.compiler.tree.as.IExpressionNode;
import org.apache.flex.compiler.tree.mxml.IMXMLDataBindingNode;
@@ -136,10 +128,8 @@ public class BindingDestinationMaker
{
IMXMLPropertySpecifierNode psn = (IMXMLPropertySpecifierNode)parent;
IDefinition d = psn.getDefinition();
- Name mname = ((DefinitionBase)d).getMName(host.getProject());
Binding b = host.getInstanceScope().getBinding(d);
INamespaceReference ns = psn.getDefinition().getNamespaceReference();
- Namespace n = ns.resolveAETNamespace(host.getProject());
if (ns != NamespaceDefinition.getPublicNamespaceDefinition())
{
InstructionList insns = new InstructionList();
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7641a69e/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java
index 8bfc6f6..0b21c6e 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseTypedDefinitionNode.java
@@ -19,28 +19,22 @@
package org.apache.flex.compiler.internal.tree.as;
-import org.apache.flex.compiler.common.ASModifier;
import org.apache.flex.compiler.constants.IASLanguageConstants;
-import org.apache.flex.compiler.definitions.metadata.IMetaTag;
-import org.apache.flex.compiler.definitions.references.INamespaceReference;
import org.apache.flex.compiler.definitions.references.IReference;
import org.apache.flex.compiler.definitions.references.ReferenceFactory;
import org.apache.flex.compiler.internal.definitions.DefinitionBase;
import org.apache.flex.compiler.internal.definitions.GetterDefinition;
-import org.apache.flex.compiler.internal.definitions.NamespaceDefinition;
import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
import org.apache.flex.compiler.internal.definitions.SetterDefinition;
import org.apache.flex.compiler.internal.definitions.SyntheticBindableGetterDefinition;
import org.apache.flex.compiler.internal.definitions.SyntheticBindableSetterDefinition;
import org.apache.flex.compiler.internal.scopes.ASScope;
import org.apache.flex.compiler.internal.scopes.FunctionScope;
-import org.apache.flex.compiler.internal.tree.as.metadata.MetaTagsNode;
import org.apache.flex.compiler.parsing.IASToken;
import org.apache.flex.compiler.tree.as.IIdentifierNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
import org.apache.flex.compiler.tree.as.ITypedNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode.LanguageIdentifierKind;
-import org.apache.flex.compiler.tree.metadata.IMetaTagsNode;
/**
* Base class for definitions that have a type associated with them
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7641a69e/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java
index 3ce33b6..7f25145 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/as/BaseVariableNode.java
@@ -24,17 +24,10 @@ import java.util.EnumSet;
import org.apache.flex.compiler.constants.IMetaAttributeConstants;
import org.apache.flex.compiler.constants.INamespaceConstants;
-import org.apache.flex.compiler.definitions.references.IReference;
import org.apache.flex.compiler.internal.definitions.ConstantDefinition;
import org.apache.flex.compiler.internal.definitions.DefinitionBase;
-import org.apache.flex.compiler.internal.definitions.GetterDefinition;
-import org.apache.flex.compiler.internal.definitions.ParameterDefinition;
-import org.apache.flex.compiler.internal.definitions.SetterDefinition;
-import org.apache.flex.compiler.internal.definitions.SyntheticBindableGetterDefinition;
-import org.apache.flex.compiler.internal.definitions.SyntheticBindableSetterDefinition;
import org.apache.flex.compiler.internal.definitions.VariableDefinition;
import org.apache.flex.compiler.internal.scopes.ASScope;
-import org.apache.flex.compiler.internal.scopes.FunctionScope;
import org.apache.flex.compiler.internal.semantics.PostProcessStep;
import org.apache.flex.compiler.internal.tree.as.parts.IDecorationPart;
import org.apache.flex.compiler.internal.tree.as.parts.VariableDecorationPart;
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7641a69e/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java
index 77a79ba..90d7960 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/as/FunctionNode.java
@@ -205,7 +205,6 @@ public class FunctionNode extends BaseTypedDefinitionNode implements IFunctionNo
if (set.contains(PostProcessStep.POPULATE_SCOPE))
{
FunctionDefinition definition = buildDefinition();
- boolean isBindable = definition.isBindable();
setDefinition(definition);
// if the parent is an anonymous function, then don't add the function definition to the scope
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/7641a69e/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
index 5ffd3aa..8644fa0 100644
--- a/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
+++ b/compiler/src/org/apache/flex/compiler/internal/tree/mxml/MXMLPropertySpecifierNode.java
@@ -37,7 +37,6 @@ import org.apache.flex.compiler.internal.projects.FlexProject;
import org.apache.flex.compiler.internal.scopes.ASScope;
import org.apache.flex.compiler.internal.scopes.MXMLFileScope;
import org.apache.flex.compiler.internal.tree.as.NodeBase;
-import org.apache.flex.compiler.internal.tree.mxml.MXMLNodeBase.MXMLNodeInfo;
import org.apache.flex.compiler.mxml.IMXMLTagAttributeData;
import org.apache.flex.compiler.mxml.IMXMLTagData;
import org.apache.flex.compiler.mxml.IMXMLTextData;
@@ -265,8 +264,6 @@ class MXMLPropertySpecifierNode extends MXMLSpecifierNodeBase implements IMXMLPr
@Override
protected void initializeFromTag(MXMLTreeBuilder builder, IMXMLTagData tag)
{
- MXMLNodeInfo info = createNodeInfo(builder);
-
String propertyTypeName = getPropertyTypeName(builder);
if (propertyTypeName.contains(IASLanguageConstants.Vector + ".<") ||
[05/14] git commit: [flex-falcon] [refs/heads/develop] - handle
binding to non-public entities
Posted by ah...@apache.org.
handle binding to non-public entities
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/e25f8453
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/e25f8453
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/e25f8453
Branch: refs/heads/develop
Commit: e25f8453669ee681395c1bd13d6a123088d520f8
Parents: 2ec7343
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:49:55 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:57 2013 -0700
----------------------------------------------------------------------
.../flex/compiler/internal/codegen/databinding/BindingInfo.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/e25f8453/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingInfo.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingInfo.java b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingInfo.java
index 62e2b2a..daf1fc6 100644
--- a/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingInfo.java
+++ b/compiler/src/org/apache/flex/compiler/internal/codegen/databinding/BindingInfo.java
@@ -103,7 +103,7 @@ public class BindingInfo implements Comparable<BindingInfo>
// now attempt to make a destination function and a destination string
// for the binding.
- expressionNodeForSetter = BindingDestinationMaker.makeDestinationFunctionInstructionList(dbnode);
+ expressionNodeForSetter = BindingDestinationMaker.makeDestinationFunctionInstructionList(dbnode, host);
destinationString = findDestinationString(dbnode, host);
finishInit(host);
[12/14] git commit: [flex-falcon] [refs/heads/develop] - Add skinpart
codegen
Posted by ah...@apache.org.
Add skinpart codegen
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/a997ce6f
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/a997ce6f
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/a997ce6f
Branch: refs/heads/develop
Commit: a997ce6fe25b3cd1f5dbf62502b464142e02323c
Parents: 89968c4
Author: Alex Harui <ah...@apache.org>
Authored: Tue Oct 8 12:38:08 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:59 2013 -0700
----------------------------------------------------------------------
.../as/codegen/ClassDirectiveProcessor.java | 67 ++++++++++++++++++++
1 file changed, 67 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/a997ce6f/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
index 2354faa..1b09064 100644
--- a/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
+++ b/compiler/src/org/apache/flex/compiler/internal/as/codegen/ClassDirectiveProcessor.java
@@ -33,6 +33,8 @@ import org.apache.flex.abc.semantics.InstanceInfo;
import org.apache.flex.abc.semantics.MethodBodyInfo;
import org.apache.flex.abc.semantics.MethodInfo;
import org.apache.flex.abc.semantics.Name;
+import org.apache.flex.abc.semantics.Namespace;
+import org.apache.flex.abc.semantics.Nsset;
import org.apache.flex.abc.semantics.PooledValue;
import org.apache.flex.abc.semantics.Trait;
import org.apache.flex.abc.visitors.IABCVisitor;
@@ -85,6 +87,7 @@ import org.apache.flex.compiler.tree.as.IDefinitionNode;
import org.apache.flex.compiler.tree.as.IExpressionNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode;
import org.apache.flex.compiler.tree.as.ILanguageIdentifierNode.LanguageIdentifierKind;
+import org.apache.flex.compiler.internal.abc.FunctionGeneratorHelper;
import org.apache.flex.compiler.internal.as.codegen.ICodeGenerator.IConstantValue;
import org.apache.flex.compiler.internal.definitions.AccessorDefinition;
import org.apache.flex.compiler.internal.definitions.ClassDefinition;
@@ -116,6 +119,15 @@ import org.apache.flex.compiler.internal.tree.as.VariableNode;
*/
class ClassDirectiveProcessor extends DirectiveProcessor
{
+
+ /**
+ * The namespace to put compiler generated skin part object into so that it does not conflict with any user defined
+ * members.
+ */
+ private static final Namespace skinPartPrivateNamespace = new Namespace(CONSTANT_PrivateNs, ".SkinPartNamespace");
+ private static final Name NAME_OBJECT = new Name(IASLanguageConstants.Object);
+
+
/**
* Get all the user defined metadata plus
* "go to definition help" metadata.
@@ -430,6 +442,61 @@ class ClassDirectiveProcessor extends DirectiveProcessor
*/
void finishClassDefinition()
{
+ // should be able to pass null here because GlobalDirectiveProcessor
+ // already called getSkinsParts and collected problems. This
+ // call should get the cached array.
+ IMetaTag[] skinParts = classDefinition.findSkinParts(classScope.getProject(), null);
+ if (skinParts.length > 0)
+ {
+ Name var_name = new Name(CONSTANT_Qname, new Nsset(skinPartPrivateNamespace), "skinParts");
+ classStaticScope.declareVariableName(var_name);
+ ITraitVisitor tv = classStaticScope.traitsVisitor.visitSlotTrait(TRAIT_Var, var_name,
+ ITraitsVisitor.RUNTIME_SLOT, NAME_OBJECT, LexicalScope.noInitializer);
+ tv.visitEnd();
+
+ cinitInsns.addInstruction(OP_findproperty, var_name);
+
+ for (IMetaTag skinPart : skinParts)
+ {
+ cinitInsns.addInstruction(OP_pushstring, skinPart.getDecoratedDefinition().getBaseName());
+ cinitInsns.addInstruction(OP_convert_s);
+ IMetaTagAttribute attr = skinPart.getAttribute("required");
+ if (attr == null || attr.getValue().equals("true"))
+ cinitInsns.addInstruction(OP_pushtrue);
+ else
+ cinitInsns.addInstruction(OP_pushfalse);
+ }
+ cinitInsns.addInstruction(OP_newobject, skinParts.length);
+ cinitInsns.addInstruction(OP_setproperty, var_name);
+
+ // Equivalent AS:
+ //
+ // protected function get skinParts():Object
+ // {
+ // return ClassName._skinParts;
+ // }
+ //
+ MethodInfo mi = new MethodInfo();
+ mi.setMethodName("skinParts");
+
+ mi.setReturnType(NAME_OBJECT);
+
+ InstructionList insns = new InstructionList(3);
+ insns.addInstruction(OP_getlocal0);
+ insns.addInstruction(OP_findpropstrict, var_name);
+ insns.addInstruction(OP_getproperty, var_name);
+ insns.addInstruction(OP_returnvalue);
+
+ FunctionGeneratorHelper.generateFunction(classScope.getEmitter(), mi, insns);
+
+ NamespaceDefinition nd = (NamespaceDefinition)classDefinition.getProtectedNamespaceReference();
+ Name func_name = new Name(nd.getAETNamespace(), "skinParts");
+ tv = classScope.traitsVisitor.visitMethodTrait(TRAIT_Getter, func_name, 0, mi);
+ tv.visitAttribute(Trait.TRAIT_OVERRIDE, Boolean.TRUE);
+ tv.visitEnd();
+
+ }
+
// the generation of instructions for variable initialization is delayed
// until now, so we can add that initialization to the front of
// the cinit instruction list.
[14/14] git commit: [flex-falcon] [refs/heads/develop] - fix jx tests
after falcon fixes
Posted by ah...@apache.org.
fix jx tests after falcon fixes
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/6d071f01
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/6d071f01
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/6d071f01
Branch: refs/heads/develop
Commit: 6d071f01ef7f6a917866a546b8ce66971b065002
Parents: 7641a69
Author: Alex Harui <ah...@apache.org>
Authored: Tue Oct 8 14:49:34 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 14:49:34 2013 -0700
----------------------------------------------------------------------
.../flexjs/files/FlexJSTest_again_result.js | 6 +-
.../flexjs/files/MyInitialView_result.js | 64 ++++++++++----------
2 files changed, 35 insertions(+), 35 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6d071f01/compiler.jx.tests/test-files/flexjs/files/FlexJSTest_again_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/files/FlexJSTest_again_result.js b/compiler.jx.tests/test-files/flexjs/files/FlexJSTest_again_result.js
index f29d279..dc592ed 100644
--- a/compiler.jx.tests/test-files/flexjs/files/FlexJSTest_again_result.js
+++ b/compiler.jx.tests/test-files/flexjs/files/FlexJSTest_again_result.js
@@ -58,13 +58,13 @@ FlexJSTest_again = function() {
* @private
* @type {org.apache.flex.net.JSONInputParser}
*/
- this.$ID6;
+ this.$ID4;
/**
* @private
* @type {StockDataJSONItemConverter}
*/
- this.$ID7;
+ this.$ID5;
/**
* @private
@@ -159,7 +159,7 @@ false,
false,
[controllers.MyController, 1, '_id', true, '$ID3', 0, 0, null],
'beads',
-null, [org.apache.flex.net.HTTPService, 2, 'id', true, 'service', 'beads', null, [org.apache.flex.net.dataConverters.LazyCollection, 3, 'id', true, 'collection', 'inputParser', false, [org.apache.flex.net.JSONInputParser, 1, '_id', true, '$ID6', 0, 0, null], 'itemConverter', false, [StockDataJSONItemConverter, 1, '_id', true, '$ID7', 0, 0, null], 0, 0, null], 0, 0, null],
+null, [org.apache.flex.net.HTTPService, 2, 'id', true, 'service', 'beads', null, [org.apache.flex.net.dataConverters.LazyCollection, 3, 'id', true, 'collection', 'inputParser', false, [org.apache.flex.net.JSONInputParser, 1, '_id', true, '$ID4', 0, 0, null], 'itemConverter', false, [StockDataJSONItemConverter, 1, '_id', true, '$ID5', 0, 0, null], 0, 0, null], 0, 0, null],
0,
1,
'initialize',
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/6d071f01/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
----------------------------------------------------------------------
diff --git a/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js b/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
index 1f4462a..7667a63 100644
--- a/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
+++ b/compiler.jx.tests/test-files/flexjs/files/MyInitialView_result.js
@@ -33,19 +33,19 @@ MyInitialView = function() {
* @private
* @type {org.apache.flex.binding.SimpleBinding}
*/
- this.$ID1;
+ this.$ID0;
/**
* @private
* @type {org.apache.flex.html.staticControls.TextButton}
*/
- this.$ID2;
+ this.$ID1;
/**
* @private
* @type {org.apache.flex.html.staticControls.TextButton}
*/
- this.$ID3;
+ this.$ID2;
/**
* @private
@@ -63,19 +63,19 @@ MyInitialView = function() {
* @private
* @type {org.apache.flex.binding.ConstantBinding}
*/
- this.$ID5;
+ this.$ID3;
/**
* @private
* @type {org.apache.flex.html.staticControls.TextArea}
*/
- this.$ID8;
+ this.$ID5;
/**
* @private
* @type {org.apache.flex.binding.SimpleBinding}
*/
- this.$ID7;
+ this.$ID4;
/**
* @private
@@ -87,7 +87,7 @@ MyInitialView = function() {
* @private
* @type {org.apache.flex.html.staticControls.TextButton}
*/
- this.$ID9;
+ this.$ID6;
/**
* @private
@@ -99,37 +99,37 @@ MyInitialView = function() {
* @private
* @type {org.apache.flex.html.staticControls.RadioButton}
*/
- this.$ID10;
+ this.$ID7;
/**
* @private
* @type {org.apache.flex.html.staticControls.RadioButton}
*/
- this.$ID11;
+ this.$ID8;
/**
* @private
* @type {org.apache.flex.html.staticControls.RadioButton}
*/
- this.$ID12;
+ this.$ID9;
/**
* @private
* @type {org.apache.flex.html.staticControls.RadioButton}
*/
- this.$ID13;
+ this.$ID10;
/**
* @private
* @type {org.apache.flex.html.staticControls.RadioButton}
*/
- this.$ID14;
+ this.$ID11;
/**
* @private
* @type {org.apache.flex.html.staticControls.RadioButton}
*/
- this.$ID15;
+ this.$ID12;
/**
* @private
@@ -141,13 +141,13 @@ MyInitialView = function() {
* @private
* @type {org.apache.flex.binding.ConstantBinding}
*/
- this.$ID17;
+ this.$ID13;
/**
* @private
* @type {org.apache.flex.html.staticControls.TextButton}
*/
- this.$ID18;
+ this.$ID14;
/**
* @private
@@ -159,7 +159,7 @@ MyInitialView = function() {
* @private
* @type {org.apache.flex.binding.ConstantBinding}
*/
- this.$ID20;
+ this.$ID15;
/**
* @private
@@ -474,7 +474,7 @@ true,
true,
100,
'beads',
-null, [org.apache.flex.binding.SimpleBinding, 5, '_id', true, '$ID1', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'labelText', 'eventName', true, 'labelTextChanged', 'destinationPropertyName', true, 'text', 0, 0, null],
+null, [org.apache.flex.binding.SimpleBinding, 5, '_id', true, '$ID0', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'labelText', 'eventName', true, 'labelTextChanged', 'destinationPropertyName', true, 'text', 0, 0, null],
0,
0,
null,
@@ -482,7 +482,7 @@ org.apache.flex.html.staticControls.TextButton,
4,
'_id',
true,
-'$ID2',
+'$ID1',
'text',
true,
'Let\'s Start Timer',
@@ -501,7 +501,7 @@ org.apache.flex.html.staticControls.TextButton,
4,
'_id',
true,
-'$ID3',
+'$ID2',
'text',
true,
'Stop Timer',
@@ -548,7 +548,7 @@ true,
true,
200,
'beads',
-null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID5', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'cities', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
+null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID3', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'cities', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
0,
1,
'change',
@@ -558,7 +558,7 @@ org.apache.flex.html.staticControls.TextArea,
6,
'_id',
true,
-'$ID8',
+'$ID5',
'height',
true,
75,
@@ -572,7 +572,7 @@ true,
true,
320,
'beads',
-null, [org.apache.flex.binding.SimpleBinding, 5, '_id', true, '$ID7', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'labelText', 'eventName', true, 'labelTextChanged', 'destinationPropertyName', true, 'text', 0, 0, null],
+null, [org.apache.flex.binding.SimpleBinding, 5, '_id', true, '$ID4', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'labelText', 'eventName', true, 'labelTextChanged', 'destinationPropertyName', true, 'text', 0, 0, null],
0,
0,
null,
@@ -594,7 +594,7 @@ org.apache.flex.html.staticControls.TextButton,
4,
'_id',
true,
-'$ID9',
+'$ID6',
'text',
true,
'Transfer',
@@ -630,7 +630,7 @@ org.apache.flex.html.staticControls.RadioButton,
6,
'_id',
true,
-'$ID10',
+'$ID7',
'text',
true,
'Apples',
@@ -653,7 +653,7 @@ org.apache.flex.html.staticControls.RadioButton,
7,
'_id',
true,
-'$ID11',
+'$ID8',
'selected',
true,
true,
@@ -679,7 +679,7 @@ org.apache.flex.html.staticControls.RadioButton,
6,
'_id',
true,
-'$ID12',
+'$ID9',
'text',
true,
'Grapes',
@@ -702,7 +702,7 @@ org.apache.flex.html.staticControls.RadioButton,
7,
'_id',
true,
-'$ID13',
+'$ID10',
'selected',
true,
true,
@@ -728,7 +728,7 @@ org.apache.flex.html.staticControls.RadioButton,
6,
'_id',
true,
-'$ID14',
+'$ID11',
'text',
true,
'Green',
@@ -751,7 +751,7 @@ org.apache.flex.html.staticControls.RadioButton,
6,
'_id',
true,
-'$ID15',
+'$ID12',
'text',
true,
'Blue',
@@ -788,7 +788,7 @@ true,
true,
200,
'beads',
-null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID17', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'strings', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
+null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID13', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'strings', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
0,
1,
'change',
@@ -798,7 +798,7 @@ org.apache.flex.html.staticControls.TextButton,
4,
'_id',
true,
-'$ID18',
+'$ID14',
'text',
true,
'OK',
@@ -828,7 +828,7 @@ true,
true,
320,
'beads',
-null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID20', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'cities', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
+null, [org.apache.flex.binding.ConstantBinding, 4, '_id', true, '$ID15', 'sourceID', true, 'applicationModel', 'sourcePropertyName', true, 'cities', 'destinationPropertyName', true, 'dataProvider', 0, 0, null],
0,
1,
'change',
[03/14] git commit: [flex-falcon] [refs/heads/develop] - When
searching for a setter,
keep looking for a setter not just the first writable thing otherwise you may
find the backing variable for a binding
Posted by ah...@apache.org.
When searching for a setter, keep looking for a setter not just the first writable thing otherwise you may find the backing variable for a binding
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/838cbbec
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/838cbbec
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/838cbbec
Branch: refs/heads/develop
Commit: 838cbbece196b120beeba95ed5e05b45439e73f1
Parents: e25f845
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:51:25 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:57 2013 -0700
----------------------------------------------------------------------
.../flex/compiler/internal/projects/FlexProject.java | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/838cbbec/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
----------------------------------------------------------------------
diff --git a/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java b/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
index c187ed3..f12f47a 100644
--- a/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
+++ b/compiler/src/org/apache/flex/compiler/internal/projects/FlexProject.java
@@ -45,6 +45,7 @@ import org.apache.flex.compiler.definitions.IDefinition;
import org.apache.flex.compiler.definitions.IEffectDefinition;
import org.apache.flex.compiler.definitions.IEventDefinition;
import org.apache.flex.compiler.definitions.IGetterDefinition;
+import org.apache.flex.compiler.definitions.ISetterDefinition;
import org.apache.flex.compiler.definitions.IStyleDefinition;
import org.apache.flex.compiler.definitions.IVariableDefinition;
import org.apache.flex.compiler.definitions.references.IResolvedQualifiersReference;
@@ -1277,6 +1278,8 @@ public class FlexProject extends ASProject implements IFlexProject
IDefinitionSet definitionSet = classScope.getLocalDefinitionSetByName(propertyName);
if (definitionSet != null)
{
+ IDefinition winner = null;
+
int n = definitionSet.getSize();
for (int i = 0; i < n; i++)
{
@@ -1291,9 +1294,15 @@ public class FlexProject extends ASProject implements IFlexProject
// Can MXML set protected properties?
// Can MXML set mx_internal properties if you've done
// 'use namesapce mx_internal' in a <Script>?
- return definition;
+ winner = definition;
+ // if we find a setter always take it, otherwise
+ // keep looking for a setter
+ if (winner instanceof ISetterDefinition)
+ break;
}
}
+ if (winner != null)
+ return winner;
}
}
[07/14] git commit: [flex-falcon] [refs/heads/develop] - 3 fixes: 1)
set properties to the full qname. They can be private and protected
properties,
not just public. 2) don't add style class traits more than once if there are
multiple fx:Style blocks. 3
Posted by ah...@apache.org.
3 fixes: 1) set properties to the full qname. They can be private and protected properties, not just public. 2) don't add style class traits more than once if there are multiple fx:Style blocks. 3) If there is no id, set the target to null, not empty string.
Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/ad066ded
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/ad066ded
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/ad066ded
Branch: refs/heads/develop
Commit: ad066ded631e913ef8933f716eca93256711c85e
Parents: ec7cb59
Author: Alex Harui <ah...@apache.org>
Authored: Wed Oct 2 20:47:11 2013 -0700
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Oct 8 13:50:57 2013 -0700
----------------------------------------------------------------------
.../as/codegen/MXMLClassDirectiveProcessor.java | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/ad066ded/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 cbf4cf0..a868416 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
@@ -3455,7 +3455,11 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
// Set the property.
// unless it's a databinding, then the property is set indiretly
if (!isDb)
- context.addInstruction(OP_setproperty, new Name(propertyName));
+ {
+ IDefinition def = propertyNode.getDefinition();
+ Name n = ((DefinitionBase)def).getMName(getProject());
+ context.addInstruction(OP_setproperty, n);
+ }
}
context.stopUsing(IL.PROPERTIES, 1);
@@ -3928,7 +3932,8 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
}
getProblems().addAll(problems);
- reducer.visitClassTraits(ctraits);
+ if (!hasStyleTags) // don't duplicate traits if there's a second style block
+ reducer.visitClassTraits(ctraits);
cinitInsns.addAll(reducer.getClassInitializationInstructions());
hasStyleTags = true;
}
@@ -4139,7 +4144,10 @@ public class MXMLClassDirectiveProcessor extends ClassDirectiveProcessor
// Set its 'target' property to the id of the object
// whose property or style this override will set.
context.addInstruction(OP_dup);
- context.addInstruction(OP_pushstring, id);
+ if (id.length() == 0)
+ context.addInstruction(OP_pushnull);
+ else
+ context.addInstruction(OP_pushstring, id);
context.addInstruction(OP_setproperty, NAME_TARGET);
// Set its 'name' property to the name of the property or style.