You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ms...@apache.org on 2013/01/11 00:46:38 UTC
svn commit: r1431733 - in /flex/whiteboard/mschmalle/falconjx:
compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestGlobalClasses.java
compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
Author: mschmalle
Date: Thu Jan 10 23:46:28 2013
New Revision: 1431733
URL: http://svn.apache.org/viewvc?rev=1431733&view=rev
Log:
Flex:FalconJx:
- TestClass unit test
Modified:
flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestGlobalClasses.java
flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
Modified: flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestGlobalClasses.java
URL: http://svn.apache.org/viewvc/flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestGlobalClasses.java?rev=1431733&r1=1431732&r2=1431733&view=diff
==============================================================================
--- flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestGlobalClasses.java (original)
+++ flex/whiteboard/mschmalle/falconjx/compiler.jx.tests/src/org/apache/flex/compiler/internal/as/codegen/TestGlobalClasses.java Thu Jan 10 23:46:28 2013
@@ -61,14 +61,12 @@ public class TestGlobalClasses extends T
assertOut("var a:Boolean = new Boolean(1)");
}
- @Ignore
@Test
public void testClass()
{
- // TODO (erikdebruin) how to test?
- IVariableNode node = getVariable("");
+ IVariableNode node = getVariable("var a:Class = Class(FooBar)");
visitor.visitVariable(node);
- assertOut("");
+ assertOut("var a:Class = Class(FooBar)");
}
@Test
Modified: flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java
URL: http://svn.apache.org/viewvc/flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java?rev=1431733&r1=1431732&r2=1431733&view=diff
==============================================================================
--- flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java (original)
+++ flex/whiteboard/mschmalle/falconjx/compiler.jx/src/org/apache/flex/compiler/internal/as/codegen/ASEmitter.java Thu Jan 10 23:46:28 2013
@@ -22,6 +22,7 @@ package org.apache.flex.compiler.interna
import java.io.FilterWriter;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.List;
import org.apache.flex.compiler.as.codegen.IASEmitter;
import org.apache.flex.compiler.as.codegen.IDocEmitter;
@@ -70,6 +71,15 @@ public class ASEmitter implements IASEmi
private final FilterWriter out;
+ List<ICompilerProblem> problems;
+
+ // (mschmalle) think about how this should be implemented, we can add our
+ // own problems to this, they don't just have to be parse problems
+ public List<ICompilerProblem> getProblems()
+ {
+ return problems;
+ }
+
private IDocEmitter docEmitter;
@Override
@@ -108,6 +118,7 @@ public class ASEmitter implements IASEmi
public ASEmitter(FilterWriter out)
{
this.out = out;
+ problems = new ArrayList<ICompilerProblem>();
}
@Override
@@ -361,7 +372,6 @@ public class ASEmitter implements IASEmi
indentPush();
write(NL);
- // TODO (mschmalle) Check to see if the node order is the order of member parsed
final int len = members.length;
int i = 0;
for (IDefinitionNode mnode : members)
@@ -492,10 +502,7 @@ public class ASEmitter implements IASEmi
}
FunctionNode fn = (FunctionNode) node;
- // XXX (mschmalle) parseFunctionBody() TEMP until I figure out the correct way to do this
- // will need to pass these problems back to the visitor
- // Figure out where this is getting parsed!
- fn.parseFunctionBody(new ArrayList<ICompilerProblem>());
+ fn.parseFunctionBody(problems);
IFunctionDefinition definition = node.getDefinition();
@@ -503,7 +510,7 @@ public class ASEmitter implements IASEmi
emitModifiers(definition);
emitMemberKeyword(node);
- // TODO (mschmalle) I'm cheating right here, I haven't "seen" the light
+ // I'm cheating right here, I haven't "seen" the light
// on how to properly and efficiently deal with accessors since they are SO alike
// I don't want to lump them in with methods because implementations in the
// future need to know the difference without loopholes